GetTypeID() public static method

public static GetTypeID ( Type type ) : string
type System.Type
return string
示例#1
0
        public void HandleMember(MemberInfo info, XmlDoc xmldoc)
        {
            Type currentType;

            if (info is Type)
            {
                currentType = (Type)info;
            }
            else
            {
                if (info == null)
                {
                    return;
                }
                currentType = info.ReflectedType;
            }
            if (currentType == null ||
                !(currentType.IsNested ? currentType.IsNestedPublic :
                  currentType.IsPublic))
            {
                return;
            }
            var typeFullName = currentType.FullName;

            if (!this.docs.ContainsKey(typeFullName))
            {
                var docVisitor = new DocVisitor();
                this.docs[typeFullName]         = docVisitor;
                this.typeIDs[typeFullName]      = DocVisitor.GetTypeID(currentType);
                this.memSummaries[typeFullName] = new MemberSummaryVisitor();
            }
            this.docs[typeFullName].HandleMember(info, xmldoc);
            this.memSummaries[typeFullName].HandleMember(info, xmldoc);
        }
示例#2
0
            public TypeLinkAndBuilder(Type type)
            {
                var typeName = DocVisitor.FormatType(type);

                typeName = "[" + DocGenUtil.HtmlEscape(typeName) + "](" +
                           DocVisitor.GetTypeID(type) + ".md)";
                this.TypeLink = typeName;
                this.Builder  = new StringBuilder();
            }
示例#3
0
            public TypeLinkAndBuilder(Type type)
            {
                var typeName = DocVisitor.FormatType(type);

                typeName      = typeName.Replace("&", "&");
                typeName      = typeName.Replace("<", "&lt;");
                typeName      = typeName.Replace(">", "&gt;");
                typeName      = "[" + typeName + "](" + DocVisitor.GetTypeID(type) + ".md)";
                this.TypeLink = typeName;
                this.Builder  = new StringBuilder();
            }
示例#4
0
 public void Finish()
 {
     foreach (var key in this.docs.Keys)
     {
         var finalString = this.docs[key].ToString();
         var filename    = Path.Combine(
             this.directory,
             DocVisitor.GetTypeID(key) + ".md");
         using (var writer = new StreamWriter(filename, false, Encoding.UTF8)) {
             finalString = Regex.Replace(
                 finalString,
                 @"\r?\n(\r?\n)+",
                 "\r\n\r\n");
             writer.WriteLine(finalString);
         }
     }
 }
示例#5
0
 public void Finish()
 {
     this.writer.Write("## API Documentation\r\n\r\n");
     foreach (var key in this.docs.Keys)
     {
         var finalString = this.docs[key].ToString();
         var typeName    = DocVisitor.FormatType(key);
         typeName = typeName.Replace("&", "&amp;");
         typeName = typeName.Replace("<", "&lt;");
         typeName = typeName.Replace(">", "&gt;");
         typeName = "[" + typeName + "](" + DocVisitor.GetTypeID(key) + ".md)";
         if (finalString.IndexOf(".", StringComparison.Ordinal) >= 0)
         {
             finalString = finalString.Substring(
                 0,
                 finalString.IndexOf(".", StringComparison.Ordinal) + 1);
         }
         finalString = Regex.Replace(finalString, @"\r?\n(\r?\n)+", "\r\n\r\n");
         this.writer.Write(" * " + typeName + " - ");
         this.writer.WriteLine(finalString);
     }
 }