XML模式的XElement对象的IntelliSense[英] IntelliSense for XElement objects with XML schema

本文是小编为大家收集整理的关于XML模式的XElement对象的IntelliSense的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

阅读一篇名为的文章"增加linq查询性能" 在7月的MSDN杂志中,作者指出,在VB中使用Imports在当前项目中提供通往架构的途径将打开IntelliSense的途径. XElement.在提供的代码中,他使用xelement.@name之类的语句来重新属性值等.

我没有在VB中尝试一下,但我想在C#中使用它.这实际上看起来像XSD.

c#中有任何等效的吗?似乎无法在C#代码内使用名称空间,没有等同于此Import语句.

推荐答案

这篇文章声称具有指向视频的链接,该视频显示了如何在C#中使用VB9的XML文字.但是,它只会真正讨论它们,从我可以收集的内容中,您不能在C#中使用它们. http://blogs.msdn.com/bethmassi/archive/2008/07/03/teched-panel-vb-xml-literals-for-c-developers.aspx

本文地址:https://www.itbaoku.cn/post/1556905.html

问题描述

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. In the code provided, he uses statements like xelement.@name to retreive attributes values and so on.

I did not try this out myself in VB but I would like to use that in C#. This really looks like LINQ to XSD.

Is there any equivalent in C#? It seems that it is not possible to use a namespace inside C# code, there is no using equivalent to this Import statement.

推荐答案

This post claims to have a link to a video that shows how to use VB9's XML Literals in C#. However, it only really discusses them and from what I can gather, you cannot use them in C#. http://blogs.msdn.com/bethmassi/archive/2008/07/03/teched-panel-vb-xml-literals-for-c-developers.aspx

相关标签/搜索