Пример #1
0
        public static DocClass GetClass(string name)
        {
            DocClass result = classes.Find((a) => a.name == name);

            if (result == null)
            {
                throw new Exception($"Couldn't find a class with docs by name of '{name}'. Are you missing a <Summary> for this class?");
            }
            return(result);
        }
Пример #2
0
        static void ReadClass(string signature, XmlReader reader)
        {
            DocClass result = new DocClass();

            // Get names
            string[] segs = signature.Split('.');
            result.name = segs[segs.Length - 1];

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

            classes.Add(result);
            items.Add(result);
        }
Пример #3
0
        public static string TypeName(string type)
        {
            switch (type)
            {
            case "Single": return("float");

            case "Double": return("double");

            case "Int32": return("int");

            case "String": return("string");

            case "Boolean": return("bool");

            case "Void": return("void");

            default: {
                DocClass typeDoc = Program.GetClass(type);
                return(typeDoc != null ? $"[{type}]({typeDoc.UrlName})" : type);
            }
            }
        }
Пример #4
0
 public static bool TryGetClass(string name, out DocClass result)
 {
     result = classes.Find((a) => a.name == name);
     return(result != null);
 }
Пример #5
0
 public DocMethod(DocClass aParent, string aName)
 {
     parent = aParent;
     name   = aName;
     parent.methods.Add(this);
 }
Пример #6
0
 public DocField(DocClass aParent, string aName)
 {
     parent = aParent;
     name   = aName;
     parent.fields.Add(this);
 }