实现在C#中的脚本语言 [英] Implementing a scripting language in C#

查看:662
本文介绍了实现在C#中的脚本语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们得到了在这里我们应该让第三方开发人员能够创建他们自己的GUI / codeBehind驱动程序的项目。我们的GUI是WPF的运行。

We got a project where we're supposed to let 3rd party developers create their own GUI / CodeBehind drivers. Our GUI is running on WPF.

现在,我们得到了一些可能性,这样做,但我们正在考虑的事情之一就是创造某种子的XAML XSD的,让他们创建使用图形用户界面的标记(说不上来,如果这将是XAML还是我们自己的基于XML的语言,然后让他们通过一个脚本语言做他们的code-落后。

Now, we got a number of possibilities for doing so, but one of the things we're considering is to create some sort of sub-Xaml XSD to let the create their GUI using markup (dunno if it'll be XAML or our own XML-"language", and then let them do their code-behind through a scripting language.

我想过这个问题,而这种模式似乎有许多相似之处魔兽世界的方式让人们创建自己的GUI。魔兽世界做的方式,是通过实现LUA脚本语言,然后暴露了自己的一些API调用。我们希望类似的行为。

I thought about it, and this model seems to have many similarities to the way World of Warcraft let's people create their own GUI. The way WoW does it, is by implementing the LUA scripting language and then expose some of their own API calls. We want similar behaviour.

不过,我们是在严格的截止日期排序,而这种实现是不是我们的最高优先事项。所以我在寻找一个.net兼容的脚本解析器/编译,在我们的项目中使用。我们正在使用的脚本语言是不是一个大问题,我们只是希望能够实现它相当快,没有太多的细毛。

However, we're on a sort-of strict deadline, and this implementation ain't the highest of our priorities. Therefore I'm looking for a .Net compliant script parser / "compiler", to use in our project. Which scripting language we're using is not a major concern, we just want to be able to implement it rather fast, without too much fuzz.

有谁知道这种库的?或者,你们对这些要求的更智能的解决方案吗?

Does anyone know of this sort of library? Or do you guys have a smarter solution for these requirements?

显然,我们是在做梦创建自己的所见即所得的编辑器和我们自己的领域特定语言,但是这似乎有点小题大做了我们。我们只想要一个脚本语言,它可以做什么,但同时让第三方开发人员使用条件做,虽然我们的API调用,循环,也许OO等。

Obviously, we're dreaming of creating our own WYSIWYG editor and our own domain specific language, but this seems like overkill for us. We just want a scripting language which can do nothing but to do calls though our API while letting the 3rd party developer use conditionals, loops, maybe OO, etc..

在此先感谢:)

推荐答案

您可以使用的IronPython的脚本语言。这里有一个<一个href="http://blogs.microsoft.co.il/blogs/berniea/archive/2008/12/04/extending-your-c-application-with-ironpython.aspx"相对=nofollow>的文章,给出了一个基本的想法的你如何能做到这一点。

You can use IronPython as your scripting language. Here's an article that gives a basic idea how you can do it.

这篇关于实现在C#中的脚本语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆