I really like using Console applications to learn different aspects of .NET programming. I'm wondering if there is a way to emulate the Console in a Silverlight or WPF application.
我非常喜欢使用控制台应用程序来学习。net编程的不同方面。我想知道是否有办法在Silverlight或WPF应用程序中模拟控制台。
Is there already an open source Console control that I could plug into my application?
是否已经有一个开源控制台控件可以插入到我的应用程序中?
Most importantly, I'd need to be able to emulate the appropriate Read
and Write
methods of System.Console
.
最重要的是,我需要能够模拟System.Console的适当读写方法。
Obviously, re-using a component someone else has already built would be ideal, but if I needed to build a "Console control" from scratch, what might I need to consider?
显然,重用别人已经构建的组件是理想的,但是如果我需要从头构建“控制台控件”,我需要考虑什么?
3 个解决方案
#1
1
Try Silverlight Console on CodePlex. It seems like it's got a few dependencies you need to add to your project in order to get it to work, but it might meet your needs.
在CodePlex上试试Silverlight控制台。看起来它有一些依赖项,您需要添加到项目中以使其工作,但它可能满足您的需要。
Personally, I'd like an application that allows me to take my Console application code and drop it into a Silverlight app with minimal tweaking. Maybe I'll make that my next big at-home project :-).
就我个人而言,我想要一个应用程序,它允许我将我的控制台应用程序代码放到一个Silverlight应用程序中,并进行最小的调整。也许我会把它做成我的下一个家庭大项目:-)。
#2
0
A similar idea is implemented as an example of IronPython
running on Silverlight
.
类似的想法被实现为运行在Silverlight上的IronPython示例。
Try Python is an interactive Python tutorial created for Silverlight and Moonlight by Michael Foord.
Try Python是Michael Foord为Silverlight和Moonlight创建的交互式Python教程。
Browse the source to get an idea how an interactive Silverlight console is built.
浏览源代码,了解如何构建交互式Silverlight控制台。
#3
0
How about in the properties of the WPF Application setting it to Console Application? That way you get both the console and the WPF application and can use the Console.WriteLine etc. as normal? Otherwise, use the output window in Visual Studio when you run in debug.
在WPF应用程序的属性中如何将其设置为控制台应用程序?这样,您可以同时获得控制台和WPF应用程序,并可以使用控制台。WriteLine等正常吗?否则,在调试中运行时,请使用Visual Studio中的output窗口。
Not sure about Silverlight tho.
对Silverlight tho并不确定。
#1
1
Try Silverlight Console on CodePlex. It seems like it's got a few dependencies you need to add to your project in order to get it to work, but it might meet your needs.
在CodePlex上试试Silverlight控制台。看起来它有一些依赖项,您需要添加到项目中以使其工作,但它可能满足您的需要。
Personally, I'd like an application that allows me to take my Console application code and drop it into a Silverlight app with minimal tweaking. Maybe I'll make that my next big at-home project :-).
就我个人而言,我想要一个应用程序,它允许我将我的控制台应用程序代码放到一个Silverlight应用程序中,并进行最小的调整。也许我会把它做成我的下一个家庭大项目:-)。
#2
0
A similar idea is implemented as an example of IronPython
running on Silverlight
.
类似的想法被实现为运行在Silverlight上的IronPython示例。
Try Python is an interactive Python tutorial created for Silverlight and Moonlight by Michael Foord.
Try Python是Michael Foord为Silverlight和Moonlight创建的交互式Python教程。
Browse the source to get an idea how an interactive Silverlight console is built.
浏览源代码,了解如何构建交互式Silverlight控制台。
#3
0
How about in the properties of the WPF Application setting it to Console Application? That way you get both the console and the WPF application and can use the Console.WriteLine etc. as normal? Otherwise, use the output window in Visual Studio when you run in debug.
在WPF应用程序的属性中如何将其设置为控制台应用程序?这样,您可以同时获得控制台和WPF应用程序,并可以使用控制台。WriteLine等正常吗?否则,在调试中运行时,请使用Visual Studio中的output窗口。
Not sure about Silverlight tho.
对Silverlight tho并不确定。