コード例 #1
0
ファイル: FieldHelper.cs プロジェクト: kcamp/cake-website
 public static IHtmlString FieldName(this ApiServices context, DocumentedField field)
 {
     if (field != null)
     {
         return(MvcHtmlString.Create(field.Definition.Name));
     }
     return(MvcHtmlString.Create(string.Empty));
 }
コード例 #2
0
 public void Text_PlotFields_AllHaveSummaries()
 {
     foreach (FieldInfo info in ScottPlot.Cookbook.Locate.GetPlotFields())
     {
         var f = new DocumentedField(info, LoadedXmlDocument);
         Assert.IsNotNull(f.Summary);
     }
 }
コード例 #3
0
 protected void AddDetailedInfo(DocumentedField f)
 {
     AddHeading(f.Name, 3);
     if (!string.IsNullOrWhiteSpace(f.Summary))
     {
         Add($"**Summary:** {f.Summary}");
     }
     Add($"**Name:** `{f.FullName}`");
     Add($"**Type:** `{f.Type}`");
 }
コード例 #4
0
        protected string OneLineInfo(DocumentedField field, string baseUrl)
        {
            string        url = Sanitize(field.Name);
            StringBuilder sb  = new StringBuilder();

            sb.Append($"<a href='{baseUrl}#{url}'><strong>{field.Name}</strong></a>");
            if (!string.IsNullOrWhiteSpace(field.Summary))
            {
                sb.Append(" - " + field.Summary);
            }
            return(sb.ToString());
        }
コード例 #5
0
        static void MatchField(List <IDocumentationMember> members, XmlNode node)
        {
            var member = IdentifierFor.XmlString(node.Attributes["name"].Value);

            for (int i = 0; i < members.Count; i++)
            {
                var reflected = members[i] as ReflectedField;
                if (reflected != null && reflected.Match(member))
                {
                    members[i] = new DocumentedField(reflected.Name, node, reflected.Field, reflected.TargetType);
                }
            }
        }
コード例 #6
0
ファイル: DocumentationXmlMatcher.cs プロジェクト: wsky/docu
        private void ParseField(List <IDocumentationMember> members, XmlNode node)
        {
            var member = Identifier.FromString(node.Attributes["name"].Value);

            for (int i = 0; i < members.Count; i++)
            {
                var eventMember = members[i] as UndocumentedField;

                if (eventMember != null && eventMember.Match(member))
                {
                    members[i] = new DocumentedField(member, node, eventMember.Field, eventMember.TargetType);
                }
            }
        }
コード例 #7
0
        public void Add(List <Namespace> namespaces, DocumentedField association)
        {
            if (association.Field == null)
            {
                return;
            }

            var ns   = FindNamespace(association, namespaces);
            var type = FindType(ns, association);

            var returnType = DeclaredType.Unresolved(Identifier.FromType(association.Field.FieldType),
                                                     association.Field.FieldType,
                                                     Namespace.Unresolved(
                                                         Identifier.FromNamespace(association.Field.FieldType.Namespace)));
            var doc = Field.Unresolved(Identifier.FromField(association.Field, association.TargetType), type, returnType);

            ParseSummary(association, doc);
            ParseRemarks(association, doc);
            ParseExample(association, doc);

            matchedAssociations[association.Name] = doc;
            type.AddField(doc);
        }