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


C# CodeIdentifiers.Remove方法代碼示例

本文整理匯總了C#中System.Xml.Serialization.CodeIdentifiers.Remove方法的典型用法代碼示例。如果您正苦於以下問題:C# CodeIdentifiers.Remove方法的具體用法?C# CodeIdentifiers.Remove怎麽用?C# CodeIdentifiers.Remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.Serialization.CodeIdentifiers的用法示例。


在下文中一共展示了CodeIdentifiers.Remove方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ImportElementMember

        void ImportElementMember(XmlSchemaElement element, string identifier, CodeIdentifiers members, string ns, bool repeats) {
            XmlSchemaElement abstractElement = GetAbstractElement(element);
            if (abstractElement != null) {
                ImportAbstractMember(abstractElement, identifier, members, ns, repeats);
                return;
            }
            ElementAccessor accessor;
            if ((accessor = ImportArray(element, identifier, ns, repeats)) == null) {
                if ((accessor = ImportSerializable(element, identifier, ns, repeats)) == null) {
                    accessor = ImportElement(element, identifier, typeof(TypeMapping), null, ns);
                }
            }

            MemberMapping member = new MemberMapping();
            member.Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name));
            member.Name = members.AddUnique(member.Name, member);
            if (member.Name.EndsWith("Specified")) {
                string name = member.Name;
                member.Name = members.AddUnique(member.Name, member);
                members.Remove(name);
            }
            member.TypeDesc = ((TypeMapping)accessor.Mapping).TypeDesc;
            member.Elements = new ElementAccessor[] { accessor };
            if (element.IsMultipleOccurrence || repeats)
                member.TypeDesc = member.TypeDesc.CreateArrayTypeDesc();

            if (element.MinOccurs == 0 && member.TypeDesc.IsValueType && !element.HasDefault && !member.TypeDesc.HasIsEmpty) {
                member.CheckSpecified = true;
            }
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:30,代碼來源:xmlschemaimporter.cs

示例2: ImportElementMember

        void ImportElementMember(XmlSchemaElement element, CodeIdentifiers members, string ns) {
            ElementAccessor accessor;
            if ((accessor = ImportArray(element, ns)) == null) {
                accessor = ImportElement(element, ns);
            }

            MemberMapping member = new MemberMapping();
            member.Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name));
            member.Name = members.AddUnique(member.Name, member);
            if (member.Name.EndsWith("Specified", StringComparison.Ordinal)) {
                string name = member.Name;
                member.Name = members.AddUnique(member.Name, member);
                members.Remove(name);
            }
            member.TypeDesc = ((TypeMapping)accessor.Mapping).TypeDesc;
            member.Elements = new ElementAccessor[] { accessor };
            if (element.IsMultipleOccurrence)
                member.TypeDesc = member.TypeDesc.CreateArrayTypeDesc();

            if (element.MinOccurs == 0 && member.TypeDesc.IsValueType && !member.TypeDesc.HasIsEmpty) {
                member.CheckSpecified = true;
            }
        }
開發者ID:gbarnett,項目名稱:shared-source-cli-2.0,代碼行數:23,代碼來源:soapschemaimporter.cs

示例3: ImportAttributeMember

        void ImportAttributeMember(XmlSchemaAttribute attribute, string identifier, CodeIdentifiers members, string ns) {
            AttributeAccessor accessor = ImportAttribute(attribute, identifier, ns);
            if (accessor == null) return;
            MemberMapping member = new MemberMapping();
            member.Elements = new ElementAccessor[0];
            member.Attribute = accessor;
            member.Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name));
            member.Name = members.AddUnique(member.Name, member);
            if (member.Name.EndsWith("Specified")) {
                string name = member.Name;
                member.Name = members.AddUnique(member.Name, member);
                members.Remove(name);
            }
            member.TypeDesc = accessor.IsList ? accessor.Mapping.TypeDesc.CreateArrayTypeDesc() : accessor.Mapping.TypeDesc;

            if ((attribute.Use == XmlSchemaUse.Optional || attribute.Use == XmlSchemaUse.None) && member.TypeDesc.IsValueType && !attribute.HasDefault && !member.TypeDesc.HasIsEmpty) {
                member.CheckSpecified = true;
            }
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:19,代碼來源:xmlschemaimporter.cs

示例4: ImportElementMember

        private void ImportElementMember(XmlSchemaElement element, string identifier, CodeIdentifiers members, CodeIdentifiers membersScope, INameScope elementsScope, string ns, bool repeats, ref bool needExplicitOrder, bool allowDuplicates, bool allowUnboundedElements)
        {
            repeats = repeats | element.IsMultipleOccurrence;
            XmlSchemaElement headElement = GetTopLevelElement(element);
            if (headElement != null && ImportSubstitutionGroupMember(headElement, identifier, members, membersScope, ns, repeats, ref needExplicitOrder, allowDuplicates))
            {
                return;
            }
            ElementAccessor accessor;
            if ((accessor = ImportArray(element, identifier, ns, repeats)) == null)
            {
                accessor = ImportElement(element, identifier, typeof(TypeMapping), null, ns, false);
            }

            MemberMapping member = new MemberMapping();
            string name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name));
            member.Name = membersScope.AddUnique(name, member);

            if (member.Name.EndsWith("Specified", StringComparison.Ordinal))
            {
                name = member.Name;
                member.Name = membersScope.AddUnique(member.Name, member);
                membersScope.Remove(name);
            }
            members.Add(member.Name, member);
            // we do not support lists for elements
            if (accessor.Mapping.IsList)
            {
                accessor.Mapping = GetDefaultMapping(TypeFlags.CanBeElementValue | TypeFlags.CanBeTextValue);
                member.TypeDesc = accessor.Mapping.TypeDesc;
            }
            else
            {
                member.TypeDesc = accessor.Mapping.TypeDesc;
            }

            AddScopeElement(elementsScope, accessor, ref needExplicitOrder, allowDuplicates);
            member.Elements = new ElementAccessor[] { accessor };

            if (element.IsMultipleOccurrence || repeats)
            {
                if (!allowUnboundedElements && accessor.Mapping is ArrayMapping)
                {
                    accessor.Mapping = ((ArrayMapping)accessor.Mapping).TopLevelMapping;
                    accessor.Mapping.ReferencedByTopLevelElement = false;
                    accessor.Mapping.ReferencedByElement = true;
                }
                member.TypeDesc = accessor.Mapping.TypeDesc.CreateArrayTypeDesc();
            }

            if (element.MinOccurs == 0 && member.TypeDesc.IsValueType && !element.HasDefault && !member.TypeDesc.HasIsEmpty)
            {
                member.CheckSpecified = SpecifiedAccessor.ReadWrite;
            }
        }
開發者ID:geoffkizer,項目名稱:corefx,代碼行數:55,代碼來源:XmlSchemaImporter.cs

示例5: ImportAttributeMember

 private void ImportAttributeMember(XmlSchemaAttribute attribute, string identifier, CodeIdentifiers members, CodeIdentifiers membersScope, string ns)
 {
     AttributeAccessor accessor = this.ImportAttribute(attribute, identifier, ns, attribute);
     if (accessor != null)
     {
         MemberMapping mapping;
         mapping = new MemberMapping {
             Elements = new ElementAccessor[0],
             Attribute = accessor,
             Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name)),
             Name = membersScope.AddUnique(mapping.Name, mapping)
         };
         if (mapping.Name.EndsWith("Specified", StringComparison.Ordinal))
         {
             string name = mapping.Name;
             mapping.Name = membersScope.AddUnique(mapping.Name, mapping);
             membersScope.Remove(name);
         }
         members.Add(mapping.Name, mapping);
         mapping.TypeDesc = accessor.IsList ? accessor.Mapping.TypeDesc.CreateArrayTypeDesc() : accessor.Mapping.TypeDesc;
         if (((attribute.Use == XmlSchemaUse.Optional) || (attribute.Use == XmlSchemaUse.None)) && ((mapping.TypeDesc.IsValueType && !attribute.HasDefault) && !mapping.TypeDesc.HasIsEmpty))
         {
             mapping.CheckSpecified = SpecifiedAccessor.ReadWrite;
         }
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:26,代碼來源:XmlSchemaImporter.cs

示例6: ImportElementMember

        void ImportElementMember(XmlSchemaElement element, CodeIdentifiers members, string ns) {
            ElementAccessor accessor;
            if ((accessor = ImportArray(element, ns)) == null) {
                accessor = ImportElement(element, ns);
            }

            MemberMapping member = new MemberMapping();
            member.Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name));
            member.Name = members.AddUnique(member.Name, member);
            if (member.Name.EndsWith("Specified")) {
                string name = member.Name;
                member.Name = members.AddUnique(member.Name, member);
                members.Remove(name);
            }
            member.TypeDesc = ((TypeMapping)accessor.Mapping).TypeDesc;
            member.Elements = new ElementAccessor[] { accessor };
            if (element.IsMultipleOccurrence)
                member.TypeDesc = member.TypeDesc.CreateArrayTypeDesc();
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:19,代碼來源:soapschemaimporter.cs

示例7: ImportElementMember

 private void ImportElementMember(XmlSchemaElement element, CodeIdentifiers members, string ns)
 {
     MemberMapping mapping;
     ElementAccessor accessor = this.ImportArray(element, ns);
     if (accessor == null)
     {
         accessor = this.ImportElement(element, ns);
     }
     mapping = new MemberMapping {
         Name = CodeIdentifier.MakeValid(Accessor.UnescapeName(accessor.Name)),
         Name = members.AddUnique(mapping.Name, mapping)
     };
     if (mapping.Name.EndsWith("Specified", StringComparison.Ordinal))
     {
         string name = mapping.Name;
         mapping.Name = members.AddUnique(mapping.Name, mapping);
         members.Remove(name);
     }
     mapping.TypeDesc = accessor.Mapping.TypeDesc;
     mapping.Elements = new ElementAccessor[] { accessor };
     if (element.IsMultipleOccurrence)
     {
         mapping.TypeDesc = mapping.TypeDesc.CreateArrayTypeDesc();
     }
     if (((element.MinOccurs == 0M) && mapping.TypeDesc.IsValueType) && !mapping.TypeDesc.HasIsEmpty)
     {
         mapping.CheckSpecified = SpecifiedAccessor.ReadWrite;
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:29,代碼來源:SoapSchemaImporter.cs


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