System.Xml.XmlQualifiedName.SetNamespace C# (CSharp) Méthode

SetNamespace() private méthode

private SetNamespace ( string ns ) : void
ns string
Résultat void
        internal void SetNamespace(string ns)
        {
            Debug.Assert(ns != null);
            _ns = ns; //Not changing hash since ns is not used to compute hashcode
        }

Usage Example

 private void ValidateQNameAttribute(XmlSchemaObject xso, string attributeName, XmlQualifiedName value)
 {
     try
     {
         value.Verify();
         value.Atomize(base.NameTable);
         if (this.currentSchema.IsChameleon && (value.Namespace.Length == 0))
         {
             value.SetNamespace(this.currentSchema.TargetNamespace);
         }
         if (this.referenceNamespaces[value.Namespace] == null)
         {
             base.SendValidationEvent("Sch_UnrefNS", value.Namespace, xso, XmlSeverityType.Warning);
         }
     }
     catch (FormatException exception)
     {
         base.SendValidationEvent("Sch_InvalidAttribute", new string[] { attributeName, exception.Message }, exception, xso);
     }
     catch (XmlException exception2)
     {
         base.SendValidationEvent("Sch_InvalidAttribute", new string[] { attributeName, exception2.Message }, exception2, xso);
     }
 }