Example #1
0
        /// <summary>
        /// Write out a reference
        /// </summary>
        /// <param name="reference">The reference information</param>
        /// <param name="options">The link display options</param>
        /// <param name="writer">The write to which the information is written</param>
        public void WriteReference(Reference reference, DisplayOptions options, XmlWriter writer)
        {
            if (reference == null)
            {
                throw new ArgumentNullException("reference");
            }

            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            NamespaceReference space = reference as NamespaceReference;

            if (space != null)
            {
                WriteNamespace(space, writer);
                return;
            }

            TypeReference type = reference as TypeReference;

            if (type != null)
            {
                WriteType(type, options, writer);
                return;
            }

            MemberReference member = reference as MemberReference;

            if (member != null)
            {
                WriteMember(member, options, writer);
                return;
            }

            ExtensionMethodReference extMethod = reference as ExtensionMethodReference;

            if (extMethod != null)
            {
                WriteExtensionMethod(extMethod, options, writer);
                return;
            }

            InvalidReference invalid = reference as InvalidReference;

            if (invalid != null)
            {
                WriteInvalid(invalid, writer);
                return;
            }

            throw new InvalidOperationException("Unknown target type");
        }
Example #2
0
        /// <summary>
        /// Write out a namespace reference
        /// </summary>
        /// <param name="spaceReference">The namespace reference information</param>
        /// <param name="writer">The write to which the information is written</param>
        public void WriteNamespace(NamespaceReference spaceReference, XmlWriter writer)
        {
            if (spaceReference == null)
            {
                throw new ArgumentNullException("spaceReference");
            }

            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            NamespaceTarget spaceTarget = targets[spaceReference.Id] as NamespaceTarget;

            if (spaceTarget != null)
            {
                WriteNamespaceTarget(spaceTarget, writer);
            }
            else
            {
                TextReferenceUtilities.WriteNamespaceReference(spaceReference, writer);
            }
        }
        // Writing link text for unresolved simple references

        internal static void WriteNamespaceReference(NamespaceReference space, XmlWriter writer)
        {
            writer.WriteString(space.Id.Substring(2));
        }
Example #4
0
        /// <summary>
        /// Write out a namespace reference
        /// </summary>
        /// <param name="spaceReference">The namespace reference information</param>
        /// <param name="writer">The write to which the information is written</param>
        public void WriteNamespace(NamespaceReference spaceReference, XmlWriter writer)
        {
            if(spaceReference == null)
                throw new ArgumentNullException("spaceReference");

            if(writer == null)
                throw new ArgumentNullException("writer");

            NamespaceTarget spaceTarget = targets[spaceReference.Id] as NamespaceTarget;

            if(spaceTarget != null)
                WriteNamespaceTarget(spaceTarget, writer);
            else
                TextReferenceUtilities.WriteNamespaceReference(spaceReference, writer);
        }
Example #5
0
        // Writing link text for unresolved simple references

        internal static void WriteNamespaceReference(NamespaceReference space, XmlWriter writer)
        {
            writer.WriteString(space.Id.Substring(2));
        }