本文整理汇总了C#中System.Xml.Schema.XmlSchemaAny.set_MinOccurs方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaAny.set_MinOccurs方法的具体用法?C# XmlSchemaAny.set_MinOccurs怎么用?C# XmlSchemaAny.set_MinOccurs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XmlSchemaAny
的用法示例。
在下文中一共展示了XmlSchemaAny.set_MinOccurs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTypedTableSchema
public static XmlSchemaComplexType GetTypedTableSchema(XmlSchemaSet xs)
{
XmlSchemaComplexType type = new XmlSchemaComplexType();
XmlSchemaSequence sequence = new XmlSchemaSequence();
StreetsHousesFlatsDS sds = new StreetsHousesFlatsDS();
XmlSchemaAny any = new XmlSchemaAny();
any.set_Namespace("http://www.w3.org/2001/XMLSchema");
any.set_MinOccurs(0M);
any.set_MaxOccurs(79228162514264337593543950335M);
any.set_ProcessContents(XmlSchemaContentProcessing.Lax);
sequence.Items.Add(any);
XmlSchemaAny any2 = new XmlSchemaAny();
any2.set_Namespace("urn:schemas-microsoft-com:xml-diffgram-v1");
any2.set_MinOccurs(1M);
any2.set_ProcessContents(XmlSchemaContentProcessing.Lax);
sequence.Items.Add(any2);
XmlSchemaAttribute attribute = new XmlSchemaAttribute();
attribute.set_Name("namespace");
attribute.set_FixedValue(sds.get_Namespace());
type.Attributes.Add(attribute);
XmlSchemaAttribute attribute2 = new XmlSchemaAttribute();
attribute2.set_Name("tableTypeName");
attribute2.set_FixedValue("FlatsDataTable");
type.Attributes.Add(attribute2);
type.set_Particle(sequence);
XmlSchema schemaSerializable = sds.GetSchemaSerializable();
if (xs.Contains(schemaSerializable.get_TargetNamespace()))
{
System.IO.MemoryStream stream = new System.IO.MemoryStream();
System.IO.MemoryStream stream2 = new System.IO.MemoryStream();
try
{
XmlSchema schema2 = null;
schemaSerializable.Write(stream);
System.Collections.IEnumerator enumerator = xs.Schemas(schemaSerializable.get_TargetNamespace()).GetEnumerator();
while (enumerator.MoveNext())
{
schema2 = (XmlSchema) enumerator.get_Current();
stream2.SetLength((long) 0L);
schema2.Write(stream2);
if (stream.get_Length() == stream2.get_Length())
{
stream.set_Position((long) 0L);
stream2.set_Position((long) 0L);
while ((stream.get_Position() != stream.get_Length()) && (stream.ReadByte() == stream2.ReadByte()))
{
}
if (stream.get_Position() == stream.get_Length())
{
return type;
}
}
}
}
finally
{
if (stream != null)
{
stream.Close();
}
if (stream2 != null)
{
stream2.Close();
}
}
}
xs.Add(schemaSerializable);
return type;
}