本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
}
示例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();
}
示例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;
}
}