本文整理汇总了C#中System.Xml.Schema.XmlSchemaElement.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaElement.GetType方法的具体用法?C# XmlSchemaElement.GetType怎么用?C# XmlSchemaElement.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XmlSchemaElement
的用法示例。
在下文中一共展示了XmlSchemaElement.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write46_XmlSchemaElement
private void Write46_XmlSchemaElement(XmlSchemaElement o)
{
if (o != null)
{
o.GetType();
this.WriteStartElement("element");
this.WriteAttribute("id", "", o.Id);
this.WriteAttribute("minOccurs", "", XmlConvert.ToString(o.MinOccurs));
this.WriteAttribute("maxOccurs", "", (o.MaxOccurs == 79228162514264337593543950335M) ? "unbounded" : XmlConvert.ToString(o.MaxOccurs));
if (o.IsAbstract)
{
this.WriteAttribute("abstract", "", XmlConvert.ToString(o.IsAbstract));
}
this.WriteAttribute("block", "", this.Write11_XmlSchemaDerivationMethod(o.BlockResolved));
this.WriteAttribute("default", "", o.DefaultValue);
this.WriteAttribute("final", "", this.Write11_XmlSchemaDerivationMethod(o.FinalResolved));
this.WriteAttribute("fixed", "", o.FixedValue);
if ((o.Parent != null) && !(o.Parent is XmlSchema))
{
if (((o.QualifiedName != null) && !o.QualifiedName.IsEmpty) && ((o.QualifiedName.Namespace != null) && (o.QualifiedName.Namespace.Length != 0)))
{
this.WriteAttribute("form", "", "qualified");
}
else
{
this.WriteAttribute("form", "", "unqualified");
}
}
if ((o.Name != null) && (o.Name.Length != 0))
{
this.WriteAttribute("name", "", o.Name);
}
if (o.IsNillable)
{
this.WriteAttribute("nillable", "", XmlConvert.ToString(o.IsNillable));
}
if (!o.SubstitutionGroup.IsEmpty)
{
this.WriteAttribute("substitutionGroup", "", o.SubstitutionGroup);
}
if (!o.RefName.IsEmpty)
{
this.WriteAttribute("ref", "", o.RefName);
}
else if (!o.SchemaTypeName.IsEmpty)
{
this.WriteAttribute("type", "", o.SchemaTypeName);
}
this.WriteAttributes(o.UnhandledAttributes, o);
this.Write5_XmlSchemaAnnotation(o.Annotation);
if (o.SchemaType is XmlSchemaComplexType)
{
this.Write35_XmlSchemaComplexType((XmlSchemaComplexType) o.SchemaType);
}
else if (o.SchemaType is XmlSchemaSimpleType)
{
this.Write9_XmlSchemaSimpleType((XmlSchemaSimpleType) o.SchemaType);
}
this.WriteSortedItems(o.Constraints);
this.WriteEndElement();
}
}
示例2: Write46_XmlSchemaElement
void Write46_XmlSchemaElement(XmlSchemaElement o) {
if ((object)o == null) return;
System.Type t = o.GetType();
WriteStartElement("element");
WriteAttribute(@"id", @"", o.Id);
WriteAttribute("minOccurs", "", XmlConvert.ToString(o.MinOccurs));
WriteAttribute("maxOccurs", "", o.MaxOccurs == decimal.MaxValue ? "unbounded" : XmlConvert.ToString(o.MaxOccurs));
if (((System.Boolean)[email protected]) != false) {
WriteAttribute(@"abstract", @"", XmlConvert.ToString((System.Boolean)((System.Boolean)[email protected])));
}
WriteAttribute(@"block", @"", Write11_XmlSchemaDerivationMethod(o.BlockResolved));
WriteAttribute(@"default", @"", o.DefaultValue);
WriteAttribute(@"final", @"", Write11_XmlSchemaDerivationMethod(o.FinalResolved));
WriteAttribute(@"fixed", @"", o.FixedValue);
if (o.Parent != null && !(o.Parent is XmlSchema)) {
if (o.QualifiedName != null && !o.QualifiedName.IsEmpty && o.QualifiedName.Namespace != null && o.QualifiedName.Namespace.Length != 0) {
WriteAttribute(@"form", @"", "qualified");
}
else {
WriteAttribute(@"form", @"", "unqualified");
}
}
if (o.Name != null && o.Name.Length != 0) {
WriteAttribute(@"name", @"", o.Name);
}
if (o.IsNillable) {
WriteAttribute(@"nillable", @"", XmlConvert.ToString(o.IsNillable));
}
if (!o.SubstitutionGroup.IsEmpty) {
WriteAttribute("substitutionGroup", "", o.SubstitutionGroup);
}
if (!o.RefName.IsEmpty) {
WriteAttribute("ref", "", o.RefName);
}
else if (!o.SchemaTypeName.IsEmpty) {
WriteAttribute("type", "", o.SchemaTypeName);
}
WriteAttributes((XmlAttribute[])[email protected], o);
Write5_XmlSchemaAnnotation(o.Annotation);
if (o.SchemaType is XmlSchemaComplexType) {
Write35_XmlSchemaComplexType((XmlSchemaComplexType)o.SchemaType);
}
else if (o.SchemaType is XmlSchemaSimpleType) {
Write9_XmlSchemaSimpleType((XmlSchemaSimpleType)o.SchemaType);
}
WriteSortedItems(o.Constraints);
WriteEndElement();
}
示例3: Write52_XmlSchemaElement
private void Write52_XmlSchemaElement(string n, string ns, XmlSchemaElement o, bool isNullable, bool needType)
{
if (o == null)
{
if (isNullable)
{
base.WriteNullTagLiteral(n, ns);
}
}
else
{
if (!needType && !(o.GetType() == typeof(XmlSchemaElement)))
{
throw base.CreateUnknownTypeException(o);
}
base.EscapeName = false;
base.WriteStartElement(n, ns, o, false, o.Namespaces);
if (needType)
{
base.WriteXsiType("XmlSchemaElement", "http://www.w3.org/2001/XMLSchema");
}
base.WriteAttribute("id", "", o.Id);
XmlAttribute[] unhandledAttributes = o.UnhandledAttributes;
if (unhandledAttributes != null)
{
for (int i = 0; i < unhandledAttributes.Length; i++)
{
XmlAttribute node = unhandledAttributes[i];
base.WriteXmlAttribute(node, o);
}
}
base.WriteAttribute("minOccurs", "", o.MinOccursString);
base.WriteAttribute("maxOccurs", "", o.MaxOccursString);
if (o.IsAbstract)
{
base.WriteAttribute("abstract", "", XmlConvert.ToString(o.IsAbstract));
}
if (o.Block != XmlSchemaDerivationMethod.None)
{
base.WriteAttribute("block", "", this.Write7_XmlSchemaDerivationMethod(o.Block));
}
base.WriteAttribute("default", "", o.DefaultValue);
if (o.Final != XmlSchemaDerivationMethod.None)
{
base.WriteAttribute("final", "", this.Write7_XmlSchemaDerivationMethod(o.Final));
}
base.WriteAttribute("fixed", "", o.FixedValue);
if (o.Form != XmlSchemaForm.None)
{
base.WriteAttribute("form", "", this.Write6_XmlSchemaForm(o.Form));
}
if ((o.Name != null) && (o.Name.Length != 0))
{
base.WriteAttribute("name", "", o.Name);
}
if (o.IsNillable)
{
base.WriteAttribute("nillable", "", XmlConvert.ToString(o.IsNillable));
}
base.WriteAttribute("ref", "", base.FromXmlQualifiedName(o.RefName));
base.WriteAttribute("substitutionGroup", "", base.FromXmlQualifiedName(o.SubstitutionGroup));
base.WriteAttribute("type", "", base.FromXmlQualifiedName(o.SchemaTypeName));
this.Write11_XmlSchemaAnnotation("annotation", "http://www.w3.org/2001/XMLSchema", o.Annotation, false, false);
if (o.SchemaType is XmlSchemaComplexType)
{
this.Write62_XmlSchemaComplexType("complexType", "http://www.w3.org/2001/XMLSchema", (XmlSchemaComplexType) o.SchemaType, false, false);
}
else if (o.SchemaType is XmlSchemaSimpleType)
{
this.Write34_XmlSchemaSimpleType("simpleType", "http://www.w3.org/2001/XMLSchema", (XmlSchemaSimpleType) o.SchemaType, false, false);
}
else if (o.SchemaType != null)
{
throw base.CreateUnknownTypeException(o.SchemaType);
}
XmlSchemaObjectCollection constraints = o.Constraints;
if (constraints != null)
{
for (int j = 0; j < constraints.Count; j++)
{
XmlSchemaObject obj2 = constraints[j];
if (obj2 is XmlSchemaKeyref)
{
this.Write51_XmlSchemaKeyref("keyref", "http://www.w3.org/2001/XMLSchema", (XmlSchemaKeyref) obj2, false, false);
}
else if (obj2 is XmlSchemaUnique)
{
this.Write50_XmlSchemaUnique("unique", "http://www.w3.org/2001/XMLSchema", (XmlSchemaUnique) obj2, false, false);
}
else if (obj2 is XmlSchemaKey)
{
this.Write49_XmlSchemaKey("key", "http://www.w3.org/2001/XMLSchema", (XmlSchemaKey) obj2, false, false);
}
else if (obj2 != null)
{
throw base.CreateUnknownTypeException(obj2);
}
}
}
base.WriteEndElement(o);
//.........这里部分代码省略.........
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:101,代码来源:ServiceDescriptionSerializationWriter.cs