Beispiel #1
0
        static void ReadField(string signature, XmlReader reader)
        {
            // Get names
            string[] segs           = signature.Split('(');
            string   nameSignature  = segs[0];
            string   paramSignature = segs.Length > 1 ? segs[1] : "";

            segs = nameSignature.Split('.');

            DocField result = new DocField(GetClass(segs[segs.Length - 2]), segs[segs.Length - 1]);

            // Read properties
            while (reader.Read())
            {
                switch (reader.Name.ToLower())
                {
                case "summary": result.summary = StringHelper.CleanMultiLine(reader.ReadElementContentAsString().Trim()); break;

                case "inheritdoc": {
                    string reference = reader.GetAttribute("cref").Trim();
                    int    start     = reference.IndexOf('.');
                    start          = start == -1 ? 0 : start + 1;
                    result.summary = $"See `{reference.Substring(start)}`";
                    inheritFields.Add(new DocInheritField(result, reader.GetAttribute("cref")));
                } break;
                }
            }

            fields.Add(result);
            items.Add(result);
        }
Beispiel #2
0
        static void ReadField(string signature, XmlReader reader)
        {
            // Get names
            string[] segs           = signature.Split('(');
            string   nameSignature  = segs[0];
            string   paramSignature = segs.Length > 1 ? segs[1] : "";

            segs = nameSignature.Split('.');
            if (segs.Length != 3)
            {
                Console.WriteLine("Unexpected signature length, " + signature);
            }

            DocField result = new DocField(GetClass(segs[1]), segs[2]);

            // Read properties
            while (reader.Read())
            {
                switch (reader.Name.ToLower())
                {
                case "summary": result.summary = StringHelper.CleanMultiLine(reader.ReadElementContentAsString().Trim()); break;
                }
            }

            fields.Add(result);
            items.Add(result);
        }
        public DocInheritField(DocField destination, string reference)
        {
            destinationField = destination;
            inheritReference = reference.Trim();
            int start = inheritReference.IndexOf('.');

            start            = start == -1 ? 0 : start + 1;
            inheritReference = inheritReference.Substring(start);
        }