当前位置: 首页>>代码示例>>C#>>正文


C# XmlQualifiedName.Equals方法代码示例

本文整理汇总了C#中System.Xml.XmlQualifiedName.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# XmlQualifiedName.Equals方法的具体用法?C# XmlQualifiedName.Equals怎么用?C# XmlQualifiedName.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlQualifiedName的用法示例。


在下文中一共展示了XmlQualifiedName.Equals方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetBuiltInComplexType

 public static XmlSchemaComplexType GetBuiltInComplexType(XmlQualifiedName qualifiedName)
 {
     if (qualifiedName == null)
     {
         throw new ArgumentNullException("qualifiedName");
     }
     if (qualifiedName.Equals(XmlSchemaComplexType.AnyType.QualifiedName))
     {
         return XmlSchemaComplexType.AnyType;
     }
     if (qualifiedName.Equals(XmlSchemaComplexType.UntypedAnyType.QualifiedName))
     {
         return XmlSchemaComplexType.UntypedAnyType;
     }
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:XmlSchemaType.cs

示例2: MatchEnumeration

 private bool MatchEnumeration(XmlQualifiedName value, ArrayList enumeration)
 {
     for (int i = 0; i < enumeration.Count; i++)
     {
         if (value.Equals((XmlQualifiedName) enumeration[i]))
         {
             return true;
         }
     }
     return false;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:QNameFacetsChecker.cs

示例3: CheckChoiceType

		bool CheckChoiceType (XmlQualifiedName typeQName, XmlSchemaParticle particle, ArrayList types, ref bool multiValue)
		{
			XmlQualifiedName type = null;

			multiValue = multiValue || particle.MaxOccurs > 1;

			if (particle is XmlSchemaGroupRef)
				return CheckChoiceType (typeQName, GetRefGroupParticle ((XmlSchemaGroupRef)particle), types, ref multiValue);

			if (particle is XmlSchemaElement) {
				string ns;
				XmlSchemaElement elem = (XmlSchemaElement)particle;
				XmlSchemaElement refElem = GetRefElement (typeQName, elem, out ns);
				if (refElem.SchemaType != null) return true;
				type = refElem.SchemaTypeName;
			}
			else if (particle is XmlSchemaAny) {
				type = anyType;
			}
			else if (particle is XmlSchemaSequence)
			{
				XmlSchemaSequence seq = particle as XmlSchemaSequence;
				foreach (XmlSchemaParticle par in seq.Items)
					if (!CheckChoiceType (typeQName, par, types, ref multiValue)) return false;
				return true;
			}
			else if (particle is XmlSchemaChoice)
			{
				foreach (XmlSchemaParticle choice in ((XmlSchemaChoice)particle).Items)
					if (!CheckChoiceType (typeQName, choice, types, ref multiValue)) return false;
				return true;
			}

			if (typeQName.Equals (type)) return false;

			// For primitive types, compare using CLR types, since several
			// xml types can be mapped to a single CLR type

			string t;
			if (IsPrimitiveTypeNamespace (type.Namespace))
				t = TypeTranslator.GetPrimitiveTypeData (type.Name).FullTypeName + ":" + type.Namespace;

			else
				t = type.Name + ":" + type.Namespace;

			if (types.Contains (t)) return false;
			types.Add (t);
			return true;
		}
开发者ID:nestalk,项目名称:mono,代码行数:49,代码来源:XmlSchemaImporter.cs

示例4: CanBeArray

		bool CanBeArray (XmlQualifiedName typeQName, XmlSchemaParticle particle, bool multiValue)
		{
			// To be an array, there can't be a direct child of type typeQName

			if (particle == null) return false;

			multiValue = multiValue || particle.MaxOccurs > 1;

			if (particle is XmlSchemaGroupRef)
				return CanBeArray (typeQName, GetRefGroupParticle ((XmlSchemaGroupRef)particle), multiValue);

			if (particle is XmlSchemaElement)
			{
				XmlSchemaElement elem = (XmlSchemaElement)particle;
				if (!elem.RefName.IsEmpty)
					return CanBeArray (typeQName, FindRefElement (elem), multiValue);
				else
					return multiValue && !typeQName.Equals (((XmlSchemaElement)particle).SchemaTypeName);
			}

			if (particle is XmlSchemaAny)
				return multiValue;

			if (particle is XmlSchemaSequence)
			{
				XmlSchemaSequence seq = particle as XmlSchemaSequence;
				if (seq.Items.Count != 1) return false;
				return CanBeArray (typeQName, (XmlSchemaParticle)seq.Items[0], multiValue);
			}

			if (particle is XmlSchemaChoice)
			{
				// Can be array if all choices have different types
				ArrayList types = new ArrayList ();
				if(!CheckChoiceType (typeQName, particle, types, ref multiValue)) return false;
				return multiValue;
			}

			return false;
		}
开发者ID:nestalk,项目名称:mono,代码行数:40,代码来源:XmlSchemaImporter.cs

示例5: FastGetElementDecl

 private SchemaElementDecl FastGetElementDecl(XmlQualifiedName elementName, object particle)
 {
     SchemaElementDecl elementDecl = null;
     if (particle != null)
     {
         XmlSchemaElement element = particle as XmlSchemaElement;
         if (element != null)
         {
             elementDecl = element.ElementDecl;
         }
         else
         {
             XmlSchemaAny any = (XmlSchemaAny) particle;
             this.processContents = any.ProcessContentsCorrect;
         }
     }
     if ((elementDecl != null) || (this.processContents == XmlSchemaContentProcessing.Skip))
     {
         return elementDecl;
     }
     if (this.isRoot && (this.partialValidationType != null))
     {
         if (this.partialValidationType is XmlSchemaElement)
         {
             XmlSchemaElement partialValidationType = (XmlSchemaElement) this.partialValidationType;
             if (elementName.Equals(partialValidationType.QualifiedName))
             {
                 return partialValidationType.ElementDecl;
             }
             this.SendValidationEvent("Sch_SchemaElementNameMismatch", elementName.ToString(), partialValidationType.QualifiedName.ToString());
             return elementDecl;
         }
         if (this.partialValidationType is XmlSchemaType)
         {
             XmlSchemaType type = (XmlSchemaType) this.partialValidationType;
             return type.ElementDecl;
         }
         this.SendValidationEvent("Sch_ValidateElementInvalidCall", string.Empty);
         return elementDecl;
     }
     return this.compiledSchemaInfo.GetElementDecl(elementName);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:42,代码来源:XmlSchemaValidator.cs

示例6: MatchEnumeration

 private bool MatchEnumeration(XmlQualifiedName value, ArrayList enumeration, XmlSchemaDatatype datatype)
 {
     foreach (XmlQualifiedName correctValue in enumeration)
     {
         if (value.Equals(correctValue))
         {
             return true;
         }
     }
     return false;
 }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:11,代码来源:FacetChecker.cs

示例7: FindElement

		/// <summary>
		/// Finds an element in the schema.
		/// </summary>
		/// <remarks>
		/// Only looks at the elements that are defined in the
		/// root of the schema so it will not find any elements
		/// that are defined inside any complex types.
		/// </remarks>
		XmlSchemaElement FindElement(XmlQualifiedName name)
		{
			foreach (XmlSchemaElement element in schema.Elements.Values) {
				if (name.Equals(element.QualifiedName)) {
					return element;
				}
			}
			return null;
		}
开发者ID:Netring,项目名称:SharpDevelop,代码行数:17,代码来源:XmlSchemaCompletion.cs

示例8: FastGetElementDecl

 private SchemaElementDecl FastGetElementDecl(XmlQualifiedName elementName, object particle) {
     SchemaElementDecl elementDecl = null;
     if (particle != null) {
         XmlSchemaElement element = particle as XmlSchemaElement;
         if (element != null) {
             elementDecl = element.ElementDecl;
         }
         else {
             XmlSchemaAny any = (XmlSchemaAny)particle;
             processContents = any.ProcessContentsCorrect;
         }
     }
     if (elementDecl == null && processContents != XmlSchemaContentProcessing.Skip) {
         if (isRoot && partialValidationType != null) {
             if (partialValidationType is XmlSchemaElement) {
                 XmlSchemaElement element = (XmlSchemaElement)partialValidationType;
                 if (elementName.Equals(element.QualifiedName)) {
                     elementDecl = element.ElementDecl;
                 }
                 else {
                     SendValidationEvent(Res.Sch_SchemaElementNameMismatch, elementName.ToString(), element.QualifiedName.ToString());
                 }
             }
             else if (partialValidationType is XmlSchemaType) { //Element name is wildcard
                 XmlSchemaType type = (XmlSchemaType)partialValidationType;
                 elementDecl = type.ElementDecl;
             }
             else { //its XmlSchemaAttribute
                 Debug.Assert(partialValidationType is XmlSchemaAttribute);
                 SendValidationEvent(Res.Sch_ValidateElementInvalidCall, string.Empty);
             }
         }
         else {
             elementDecl = compiledSchemaInfo.GetElementDecl(elementName);
         }
     }
     return elementDecl;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:38,代码来源:XmlSchemaValidator.cs

示例9: GetAttributeXsd

 internal SchemaAttDef GetAttributeXsd(SchemaElementDecl ed, XmlQualifiedName qname, XmlSchemaObject partialValidationType, out AttributeMatchState attributeMatchState) {
     SchemaAttDef attdef = null;
     attributeMatchState = AttributeMatchState.UndeclaredAttribute;
     if (ed != null) {
         attdef = ed.GetAttDef(qname);
         if (attdef != null) {
             attributeMatchState = AttributeMatchState.AttributeFound;
             return attdef;
         }
         XmlSchemaAnyAttribute any = ed.AnyAttribute;
         if (any != null) {
             if (!any.NamespaceList.Allows(qname)) {
                 attributeMatchState = AttributeMatchState.ProhibitedAnyAttribute;
             }
             else if (any.ProcessContentsCorrect != XmlSchemaContentProcessing.Skip) {
                 if (attributeDecls.TryGetValue(qname, out attdef)) {
                     if (attdef.Datatype.TypeCode == XmlTypeCode.Id) { //anyAttribute match whose type is ID
                         attributeMatchState = AttributeMatchState.AnyIdAttributeFound;
                     }
                     else {
                         attributeMatchState = AttributeMatchState.AttributeFound;
                     }
                 }
                 else if (any.ProcessContentsCorrect == XmlSchemaContentProcessing.Lax) {
                     attributeMatchState = AttributeMatchState.AnyAttributeLax;
                 }
             }
             else {
                 attributeMatchState = AttributeMatchState.AnyAttributeSkip;
             }
         }
         else if (ed.ProhibitedAttributes.ContainsKey(qname)) {
             attributeMatchState = AttributeMatchState.ProhibitedAttribute;
         }
     }
     else if (partialValidationType != null) {
         XmlSchemaAttribute attr = partialValidationType as XmlSchemaAttribute;
         if (attr != null) {
             if (qname.Equals(attr.QualifiedName)) {
                 attdef = attr.AttDef;
                 attributeMatchState = AttributeMatchState.AttributeFound;
             }
             else {
                 attributeMatchState = AttributeMatchState.AttributeNameMismatch;
             }
         }
         else {
             attributeMatchState = AttributeMatchState.ValidateAttributeInvalidCall;
         }
     }
     else {
         if (attributeDecls.TryGetValue(qname, out attdef)) {
             attributeMatchState = AttributeMatchState.AttributeFound;
         }
         else {
             attributeMatchState = AttributeMatchState.UndeclaredElementAndAttribute;
         }
     }
     return attdef;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:60,代码来源:SchemaInfo.cs

示例10: FindElement

		/// <summary>
		/// Finds an element in the schema.
		/// </summary>
		/// <remarks>
		/// Only looks at the elements that are defined in the 
		/// root of the schema so it will not find any elements
		/// that are defined inside any complex types.
		/// </remarks>
		XmlSchemaElement FindElement (XmlQualifiedName name)
		{
			XmlSchemaElement matchedElement = null;
			foreach (XmlSchemaElement element in schema.Elements.Values) {
				if (name.Equals(element.QualifiedName)) {
					matchedElement = element;
					break;
				}
			}
			
			return matchedElement;
		}		
开发者ID:Kalnor,项目名称:monodevelop,代码行数:20,代码来源:XmlSchemaCompletionData.cs

示例11: DeleteSpannedAnnotations

        /// <summary> 
        /// Finds and removes all annotations of the specified type that have part or the entire
        /// anchor covered by the start-end range. If the delete range is adjacent to the anchor it 
        /// it will not be deleted 
        /// </summary>
        /// <param name="service">service to use for this operation</param> 
        /// <param name="annotationType">type of the annotations to be removed</param>
        private static void DeleteSpannedAnnotations(AnnotationService service, XmlQualifiedName annotationType)
        {
            CheckInputs(service); 

            // Limited set of annotation types supported in V1 
            Invariant.Assert(annotationType != null && 
                (annotationType == HighlightComponent.TypeName ||
                annotationType == StickyNoteControl.TextSchemaName || 
                annotationType == StickyNoteControl.InkSchemaName), "Invalid Annotation Type");

            // Get the selection from the viewer
            ITextSelection selection = GetTextSelection((FrameworkElement)service.Root); 
            Invariant.Assert(selection != null, "TextSelection is null");
 
            // Get annotations spanned by current selection 
            IList<IAttachedAnnotation> attachedAnnotations = GetSpannedAnnotations(service);
 
            // Find the annotations that overlap with the selection
            foreach (IAttachedAnnotation attachedAnnot in attachedAnnotations)
            {
                if (annotationType.Equals(attachedAnnot.Annotation.AnnotationType)) 
                {
                    // Only annotations with TextRange anchors can be compared to 
                    // the text selection, we ignore others 

                    TextAnchor anchor = attachedAnnot.AttachedAnchor as TextAnchor; 
                    if (anchor == null)
                        continue;

                    // Remove any annotations that overlap in anyway 
                    if (((selection.Start.CompareTo(anchor.Start) > 0) && (selection.Start.CompareTo(anchor.End) < 0)) ||
                        ((selection.End.CompareTo(anchor.Start) > 0) && (selection.End.CompareTo(anchor.End) < 0)) || 
                        ((selection.Start.CompareTo(anchor.Start) <= 0) && (selection.End.CompareTo(anchor.End) >= 0)) || 
                        CheckCaret(selection, anchor, annotationType))
                    { 
                        service.Store.DeleteAnnotation(attachedAnnot.Annotation.Id);
                    }
                }
            } 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:47,代码来源:AnnotationHelper.cs


注:本文中的System.Xml.XmlQualifiedName.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。