Example #1
0
        /// <summary>
        /// Write out a namespace target
        /// </summary>
        /// <param name="space">The namespace target information</param>
        /// <param name="writer">The write to which the information is written</param>
        public static void WriteNamespaceTarget(NamespaceTarget space, XmlWriter writer)
        {
            if(space == null)
                throw new ArgumentNullException("space");

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

            writer.WriteString(space.Name);
        }
Example #2
0
        /// <summary>
        /// Write out a namespace target
        /// </summary>
        /// <param name="space">The namespace target information</param>
        /// <param name="writer">The write to which the information is written</param>
        public static void WriteNamespaceTarget(NamespaceTarget space, XmlWriter writer)
        {
            if (space == null)
            {
                throw new ArgumentNullException("space");
            }

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

            writer.WriteString(space.Name);
        }
Example #3
0
        /// <summary>
        /// Write out the target link information
        /// </summary>
        /// <param name="target">The target for which to write link information</param>
        /// <param name="options">The link display options</param>
        /// <param name="writer">The write to which the information is written</param>
        public void WriteTarget(Target target, DisplayOptions options, XmlWriter writer)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

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

            NamespaceTarget space = target as NamespaceTarget;

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

            TypeTarget type = target as TypeTarget;

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

            MemberTarget member = target as MemberTarget;

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

            if (target.Id.StartsWith("R:", StringComparison.OrdinalIgnoreCase))
            {
                WriteInvalid(new InvalidReference(target.Id), writer);
                return;
            }

            throw new InvalidOperationException("Unknown target type");
        }
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);
            }
        }