Пример #1
0
        public void Apply(
            Operation operation,
            SchemaRegistry schemaRegistry,
            ApiDescription apiDescription)
        {
            ReflectedHttpActionDescriptor actionDescriptor = apiDescription.get_ActionDescriptor() as ReflectedHttpActionDescriptor;

            if (actionDescriptor == null)
            {
                return;
            }
            XPathNavigator navigator;

            lock (this._xmlDoc)
                navigator = this._xmlDoc.CreateNavigator();
            string         commentIdForMethod = XmlCommentsIdHelper.GetCommentIdForMethod(actionDescriptor.get_MethodInfo());
            XPathNavigator methodNode         = navigator.SelectSingleNode(string.Format("/doc/members/member[@name='{0}']", (object)commentIdForMethod));

            if (methodNode == null)
            {
                return;
            }
            XPathNavigator node1 = methodNode.SelectSingleNode("summary");

            if (node1 != null)
            {
                operation.summary = node1.ExtractContent();
            }
            XPathNavigator node2 = methodNode.SelectSingleNode("remarks");

            if (node2 != null)
            {
                operation.description = node2.ExtractContent();
            }
            ApplyXmlActionComments.ApplyParamComments(operation, methodNode, actionDescriptor.get_MethodInfo());
            ApplyXmlActionComments.ApplyResponseComments(operation, methodNode);
        }