本文整理匯總了C#中System.Xml.Schema.XmlSchemaComplexType.set_Particle方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlSchemaComplexType.set_Particle方法的具體用法?C# XmlSchemaComplexType.set_Particle怎麽用?C# XmlSchemaComplexType.set_Particle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Schema.XmlSchemaComplexType
的用法示例。
在下文中一共展示了XmlSchemaComplexType.set_Particle方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例2: GetTypedDataSetSchema
public static XmlSchemaComplexType GetTypedDataSetSchema(XmlSchemaSet xs)
{
StreetsHousesFlatsDS sds = new StreetsHousesFlatsDS();
XmlSchemaComplexType type = new XmlSchemaComplexType();
XmlSchemaSequence sequence = new XmlSchemaSequence();
XmlSchemaAny any = new XmlSchemaAny();
any.set_Namespace(sds.get_Namespace());
sequence.Items.Add(any);
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;
}