當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlSchemaAny.set_MinOccurs方法代碼示例

本文整理匯總了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;
 }
開發者ID:u4097,項目名稱:SQLScript,代碼行數:69,代碼來源:StreetsHousesFlatsDS.cs


注:本文中的System.Xml.Schema.XmlSchemaAny.set_MinOccurs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。