Exemplo n.º 1
0
        //
        // Generates xml doc comments (if any), and if required,
        // handle warning report.
        //
        internal void GenerateDocumentationForMember(MemberCore mc)
        {
            string name = mc.DocCommentHeader + mc.GetSignatureForDocumentation();

            XmlNode n = GetDocCommentNode(mc, name);

            XmlElement el = n as XmlElement;

            if (el != null)
            {
                var pm = mc as IParametersMember;
                if (pm != null)
                {
                    CheckParametersComments(mc, pm, el);
                }

                // FIXME: it could be done with XmlReader
                XmlNodeList nl = n.SelectNodes(".//include");
                if (nl.Count > 0)
                {
                    // It could result in current node removal, so prepare another list to iterate.
                    var al = new List <XmlNode> (nl.Count);
                    foreach (XmlNode inc in nl)
                    {
                        al.Add(inc);
                    }
                    foreach (XmlElement inc in al)
                    {
                        if (!HandleInclude(mc, inc))
                        {
                            inc.ParentNode.RemoveChild(inc);
                        }
                    }
                }

                // FIXME: it could be done with XmlReader
                DeclSpace ds_target = mc as DeclSpace;
                if (ds_target == null)
                {
                    ds_target = mc.Parent;
                }

                foreach (XmlElement see in n.SelectNodes(".//see"))
                {
                    HandleSee(mc, ds_target, see);
                }
                foreach (XmlElement seealso in n.SelectNodes(".//seealso"))
                {
                    HandleSeeAlso(mc, ds_target, seealso);
                }
                foreach (XmlElement see in n.SelectNodes(".//exception"))
                {
                    HandleException(mc, ds_target, see);
                }
            }

            n.WriteTo(XmlCommentOutput);
        }
Exemplo n.º 2
0
Arquivo: doc.cs Projeto: royleban/mono
		//
		// Generates xml doc comments (if any), and if required,
		// handle warning report.
		//
		internal void GenerateDocumentationForMember (MemberCore mc)
		{
			string name = mc.DocCommentHeader + mc.GetSignatureForDocumentation ();

			XmlNode n = GetDocCommentNode (mc, name);

			XmlElement el = n as XmlElement;
			if (el != null) {
				var pm = mc as IParametersMember;
				if (pm != null) {
					CheckParametersComments (mc, pm, el);
				}

				// FIXME: it could be done with XmlReader
				XmlNodeList nl = n.SelectNodes (".//include");
				if (nl.Count > 0) {
					// It could result in current node removal, so prepare another list to iterate.
					var al = new List<XmlNode> (nl.Count);
					foreach (XmlNode inc in nl)
						al.Add (inc);
					foreach (XmlElement inc in al)
						if (!HandleInclude (mc, inc))
							inc.ParentNode.RemoveChild (inc);
				}

				// FIXME: it could be done with XmlReader
				var ds_target = mc as TypeContainer;
				if (ds_target == null)
					ds_target = mc.Parent;

				foreach (XmlElement see in n.SelectNodes (".//see"))
					HandleSee (mc, ds_target, see);
				foreach (XmlElement seealso in n.SelectNodes (".//seealso"))
					HandleSeeAlso (mc, ds_target, seealso);
				foreach (XmlElement see in n.SelectNodes (".//exception"))
					HandleException (mc, ds_target, see);
				foreach (XmlElement node in n.SelectNodes (".//typeparam"))
					HandleTypeParam (mc, node);
				foreach (XmlElement node in n.SelectNodes (".//typeparamref"))
					HandleTypeParamRef (mc, node);
			}

			n.WriteTo (XmlCommentOutput);
		}