예제 #1
0
        void SaveReference(bool hasNamespace, Span namespaceSpan, Span nameSpan, XmlNameReferenceKind refKind, bool findDefsOnly)
        {
            var aliasSpan = hasNamespace ? namespaceSpan : new Span(0, 0);
            XmlNamespaceReference nsRef;

            if (findDefsOnly)
            {
                var alias = GetSubstring(aliasSpan);
                var def   = xmlNamespaces.GetOrCreate(alias);
                nsRef = new XmlNamespaceReference(alias)
                {
                    Definition = def
                };
            }
            else
            {
                nsRef = GetAttributeNamespaceReference(aliasSpan);
            }

            if (hasNamespace)
            {
                var @ref = new XmlNamespaceTextViewerReference(nsRef);
                references.Add(new ReferenceInfo(namespaceSpan, @ref, false));
            }

            var nameRef = new XmlNameTextViewerReference(nsRef, GetSubstring(nameSpan), refKind);

            references.Add(new ReferenceInfo(nameSpan, nameRef, false));
        }
예제 #2
0
 public XmlNameTextViewerReference(XmlNamespaceReference nsRef, string name, XmlNameReferenceKind refKind)
 {
     if (nsRef == null)
     {
         throw new ArgumentNullException(nameof(nsRef));
     }
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     this.nsRef   = nsRef;
     this.name    = name;
     this.refKind = refKind;
 }
예제 #3
0
 void SaveReference(NameToken name, XmlNameReferenceKind refKind, bool findDefsOnly) =>
 SaveReference(name.HasNamespace, name.Namespace.Span, name.Name.Span, refKind, findDefsOnly);
예제 #4
0
 void SaveReference(NameToken name, XmlNameReferenceKind refKind) =>
 owner.SaveReference(name.HasNamespace, name.Namespace.Span, name.Name.Span, refKind, findDefsOnly: false);
			void SaveReference(NameToken name, XmlNameReferenceKind refKind) =>
				owner.SaveReference(name.HasNamespace, name.Namespace.Span, name.Name.Span, refKind, findDefsOnly: false);