简体   繁体   English

具有XML架构的XIElement对象的IntelliSense

[英]IntelliSense for XElement objects with XML schema

Reading an article called "Increase LINQ Query Performance" in July's MSDN magazine, the author states that using an Imports in VB providing a path to schema in the current project will turn IntelliSense on for XElement. 作者在7月的MSDN杂志上阅读了一篇名为“提高LINQ查询性能”的文章,该文章指出,使用VB中的Imports提供当前项目中的模式路径将使智能感知开启XElement。 In the code provided, he uses statements like xelement.@name to retreive attributes values and so on. 在提供的代码中,他使用xelement.@name等语句来检索属性值等等。

I did not try this out myself in VB but I would like to use that in C#. 我没有在VB中尝试过这个,但我想在C#中使用它。 This really looks like LINQ to XSD. 这看起来真的像LINQ到XSD。

Is there any equivalent in C#? C#中有没有相应的东西? It seems that it is not possible to use a namespace inside C# code, there is no using equivalent to this Import statement. 似乎不可能在C#代码中使用命名空间,没有using等效于此Import语句。

This post claims to have a link to a video that shows how to use VB9's XML Literals in C#. 这篇文章声称有一个视频链接,显示如何在C#中使用VB9的XML Literals。 However, it only really discusses them and from what I can gather, you cannot use them in C#. 但是,它只是真正讨论它们,并且从我可以收集的内容中,你不能在C#中使用它们。 http://blogs.msdn.com/bethmassi/archive/2008/07/03/teched-panel-vb-xml-literals-for-c-developers.aspx http://blogs.msdn.com/bethmassi/archive/2008/07/03/teched-panel-vb-xml-literals-for-c-developers.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM