原始XSD片段:
<xs:simpleType name="stopLocation"> <xs:restriction base="xs:string"> <xs:enumeration value="default"/> <xs:enumeration value="near"/> <xs:enumeration value="far"/> <xs:enumeration value="nearExact"/> <xs:enumeration value="farexact"/> </xs:restriction> </xs:simpleType>
生成的类片段:
public enum stopLocation { @default,near,far,nearExact,farexact,}
(是的,最后的元素有一个逗号,VS似乎很满意)
谢谢.
解决方法 它从C#中转义默认关键字.看到这个问题:What’s the use/meaning of the @ character in variable names in C#?
总结以上是内存溢出为你收集整理的枚举中的C#@从XSD生成类全部内容,希望文章能够帮你解决枚举中的C#@从XSD生成类所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)