silverlight/wp7 的 telnet/终端仿真
我正在尝试为 wp7 mango 组装一个 telnet 客户端,这样我就可以在我的开发手机上玩一些泥浆。我很难找到一个适用于 Silverlight 的合适的开源终端仿真库(mango 大致相当于 sl 4 堆栈)。我觉得很有趣,但那是为 wpf 编写的,而 sl 似乎没有用于显示 telnet 控制台的流布局控制。有什么建议吗?我已经能够连接到 telnet 服务器并获得双向流,但是当然,如果没有术语模拟,我得到的大部分都是垃圾。
编辑:我最终实现了自己的 ascii 转义代码(本质上是 VT100 的子集,解析但忽略了不支持的选项)和 telnet 服务器命令解析引擎(它并不像我想象的那么困难),而且我自己的渲染代码使用 RichTextBox 控件,这是必要的,因为手机上的 silverlight 的限制在浏览器的 silverlight 或 Windows 的 WPF 中都不存在。
I'm attempting to put together a telnet client for wp7 mango, so I can play some muds on my dev phone. I am having difficulty finding a decent open source terminal emulation library that will work for Silverlight (mango is roughly equivalent to the sl 4 stack). I see amuse, but that was written for wpf and sl doesn't seem to have that flow layout control it uses to display the telnet console. Any suggestions? I am already able to connect to a telnet server and get a two way stream, but of course i get mostly garbage without term emulation.
Edit: I ended up implementing my own ascii escape code (a sub-set of VT100 essentially, with unsupported options parsed but ignored) and telnet server command parsing engine (it wasn't as difficult as I thought it would be), and also my own rendering code using the RichTextBox control, which was necessary due to limitations of silverlight on the phone which aren't there in either silverlight for the browser or WPF in windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试联系 Stefan Olson,他为 Silverlight 实现了 FlowDocument Viewer(不幸的是,他还没有时间清理它并发布代码):
http://www.olsonsoft.com/blogs /stefanolson/post/FlowDocument-for-Silverlight.aspx 简介
You could try to contact Stefan Olson, who implemented a FlowDocument Viewer for Silverlight (unfortunately he didn't have time yet to clean it up and release the code):
http://www.olsonsoft.com/blogs/stefanolson/post/Introduction-to-FlowDocument-for-Silverlight.aspx
您需要技术布局还是完整的组件?关于流程布局,您所需要的只是表示文本,因此带有 TextBlock 的 StackPanel 应该可以正常工作。
TextBlock
可以支持多个Run
元素,这实际上为您提供了流布局。无论哪种方式,对于手机,您都应该考虑自定义 UI 来满足您的需求,而不是期望组件为您做这件事。如果有一个组件,很可能会有一个应用程序,那么就没有理由为它编写另一个应用程序,现在会吗?-)
Are you asking for a technical layout, or a complete component? In regards to the flow layout, all you need is to represent text, so a
StackPanel
with TextBlock's in should work just fine.A
TextBlock
can support multipleRun
elements, which pratically gives you a flow-layout.Either way, for a phone you should look into customizing the UI to suit your needs, rather than expecting a component to do it for you. If there was a component for it, there most likely would be a app for it, and then there wouldn't be a reason to write another app for it, would there now?-)
我最终从头开始实现了自己的终端仿真/telnet 协商代码。
I ended up implementing my own terminal emulation/telnet negotiation code from scratch.