为 .NET 类生成 Javascript 智能感知文件
我有一个 .net 控件,旨在用作网页中的 ActiveX 控件,实例化如下:
<object id="TheControl" name="TheControl" classid="clsid:012937D0-E1D8-4a80-A17F-DEADBEEFF00D"></object>
有没有办法获取 Visual Studio for TheControl
生成的 XML 文档并将其转换为 < Visual Studio 然后可以使用 code>.js 文件来为页面中的控件实例提供智能感知?
I have a .net control which is intended for use as an ActiveX control in web pages, instantiated thus:
<object id="TheControl" name="TheControl" classid="clsid:012937D0-E1D8-4a80-A17F-DEADBEEFF00D"></object>
Is there a way to take the XML documentation generated by Visual Studio for TheControl
and transform it into a .js
file that Visual Studio could then consume to provide intellisense for an instance of the control in a page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您要么必须使用 .NET Reflection 来获取所有属性和方法的列表,要么编写 XML 解析器工具来获取相同的列表,然后从中生成 .JS 源代码。
我认为这两种方法都需要花费相同的精力来编写,但是如果您没有方便的 Visual Studio 来生成文档 XML,那么反射方法也可以仅与 ActiveX 文件一起使用。
如果您想要的只是一个用于属性和方法的“空壳”.JS 文件,那么本文中的代码应该提供良好的基础:
http://www.codeproject.com/KB/dotnet/Reflection.aspx
You would either have to use .NET Reflection to get a list of all properties and methods, or write an XML parser tool to get the same list, and then generate .JS source code from it.
I think both of these would take about the same effort to write, but the Reflection approach can also be used with just the ActiveX file- if you don't have Visual Studio handy to generate the documentation XML.
If all you want is an "empty shell" .JS file for the properties and methods, then the code in this article should provide a good basis:
http://www.codeproject.com/KB/dotnet/Reflection.aspx