コード例 #1
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public MethodDocumentation(MethodDefinition method, TypeDocumentation declaringType)
     : base(method.Name, declaringType)
 {
     this.method = method;
     Parameters.AddRange(method.Parameters.Select(x => new ParameterDocumentation(x, this)));
     GenericParameters.AddRange(method.GenericParameters.Select(x => new GenericParameterDocumentation(x, this)));
 }
コード例 #2
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public MethodDocumentation(MethodDefinition method, TypeDocumentation declaringType)
     : base(method.Name, declaringType)
 {
     this.method = method;
     Parameters.AddRange(method.Parameters.Select(x => new ParameterDocumentation(x, this)));
     GenericParameters.AddRange(method.GenericParameters.Select(x => new GenericParameterDocumentation(x, this)));
 }
コード例 #3
0
ファイル: DocumentationSet.cs プロジェクト: Xtremrules/dot42
 /// <summary>
 /// Try to find a type in this set that matches the given type.
 /// </summary>
 private bool TryGetMatchingType(TypeDocumentation type, out TypeDocumentation result)
 {
     result = null;
     NamespaceDocumentation ns;
     if (!TryGetNamespace(type.Namespace, out ns))
         return false;
     return ns.TryGetMatchingType(type, out result);
 }
コード例 #4
0
ファイル: TypeDocumentation.cs プロジェクト: Xtremrules/dot42
 /// <summary>
 /// Default ctor
 /// </summary>
 public TypeDocumentation(TypeDefinition type, TypeDocumentation declaringType)
     : base(type.Name, declaringType)
 {
     this.type = type;
     fullName = type.FullName;
     @namespace = type.Namespace;
     GenericParameters.AddRange(type.GenericParameters.Select(x => new GenericParameterDocumentation(x, this)));
 }
コード例 #5
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public TypeDocumentation(TypeDefinition type, TypeDocumentation declaringType)
     : base(type.Name, declaringType)
 {
     this.type  = type;
     fullName   = type.FullName;
     @namespace = type.Namespace;
     GenericParameters.AddRange(type.GenericParameters.Select(x => new GenericParameterDocumentation(x, this)));
 }
コード例 #6
0
ファイル: DocumentationSet.cs プロジェクト: Xtremrules/dot42
 /// <summary>
 /// Add the given type to this set.
 /// </summary>
 internal void Add(TypeDocumentation type)
 {
     NamespaceDocumentation ns;
     if (!namespaceTypes.TryGetValue(type.Namespace, out ns))
     {
         ns = new NamespaceDocumentation(type.Namespace);
         namespaceTypes.Add(type.Namespace, ns);
     }
     ns.Add(type);
 }
コード例 #7
0
        /// <summary>
        /// Add the given type to this set.
        /// </summary>
        internal void Add(TypeDocumentation type)
        {
            NamespaceDocumentation ns;

            if (!namespaceTypes.TryGetValue(type.Namespace, out ns))
            {
                ns = new NamespaceDocumentation(type.Namespace);
                namespaceTypes.Add(type.Namespace, ns);
            }
            ns.Add(type);
        }
コード例 #8
0
        /// <summary>
        /// Try to find a type in this set that matches the given type.
        /// </summary>
        private bool TryGetMatchingType(TypeDocumentation type, out TypeDocumentation result)
        {
            result = null;
            NamespaceDocumentation ns;

            if (!TryGetNamespace(type.Namespace, out ns))
            {
                return(false);
            }
            return(ns.TryGetMatchingType(type, out result));
        }
コード例 #9
0
        /// <summary>
        /// Load type documentation for the given type and all its members
        /// </summary>
        private void LoadType(TypeDefinition type, TypeDocumentation declaringType, SummaryFile summary)
        {
            // Exclude non-visible types
            if (type.IsNotPublic || type.IsNestedAssembly || type.IsNestedPrivate || type.IsNestedFamilyAndAssembly)
            {
                return;
            }

            // Generate documentation
            var doc = new TypeDocumentation(type, declaringType);

            foreach (var nestedType in type.NestedTypes)
            {
                LoadType(nestedType, doc, summary);
            }
            doc.Events.AddRange(type.Events.Where(IsVisible).OrderBy(Descriptor.Create).Select(x => new EventDocumentation(x, doc)));
            doc.Fields.AddRange(type.Fields.Where(IsVisible).OrderBy(Descriptor.Create).Select(x => new FieldDocumentation(x, doc)));
            doc.Methods.AddRange(type.Methods.Where(IsVisibleAndNormal).OrderBy(x => Descriptor.Create(x, true)).Select(x => new MethodDocumentation(x, doc)));
            doc.Properties.AddRange(type.Properties.Where(IsVisible).OrderBy(x => Descriptor.Create(x, true)).Select(x => new PropertyDocumentation(x, doc)));

            doc.LoadSummary(summary);
            Add(doc);
        }
コード例 #10
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public EventDocumentation(EventDefinition evt, TypeDocumentation declaringType)
     : base(evt.Name, declaringType)
 {
     this.evt = evt;
 }
コード例 #11
0
        /// <summary>
        /// Load type documentation for the given type and all its members
        /// </summary>
        private void LoadType(TypeDefinition type, TypeDocumentation declaringType, SummaryFile summary)
        {
            // Exclude non-visible types
            if (type.IsNotPublic || type.IsNestedAssembly || type.IsNestedPrivate || type.IsNestedFamilyAndAssembly)
                return;

            // Generate documentation
            var doc = new TypeDocumentation(type, declaringType);

            foreach (var nestedType in type.NestedTypes)
            {
                LoadType(nestedType, doc, summary);
            }
            doc.Events.AddRange(type.Events.Where(IsVisible).OrderBy(Descriptor.Create).Select(x => new EventDocumentation(x, doc)));
            doc.Fields.AddRange(type.Fields.Where(IsVisible).OrderBy(Descriptor.Create).Select(x => new FieldDocumentation(x, doc)));
            doc.Methods.AddRange(type.Methods.Where(IsVisibleAndNormal).OrderBy(x => Descriptor.Create(x, true)).Select(x => new MethodDocumentation(x, doc)));
            doc.Properties.AddRange(type.Properties.Where(IsVisible).OrderBy(x => Descriptor.Create(x, true)).Select(x => new PropertyDocumentation(x, doc)));

            doc.LoadSummary(summary);
            Add(doc);
        }
コード例 #12
0
 /// <summary>
 /// Does this set contain a matching type?
 /// </summary>
 public bool ContainsMatching(TypeDocumentation type)
 {
     TypeDocumentation mine;
     return TryGetMatchingType(type, out mine);
 }
コード例 #13
0
 /// <summary>
 /// Add the given type to this set.
 /// </summary>
 internal void Add(TypeDocumentation type)
 {
     types[type.Xid] = type;
 }
コード例 #14
0
 /// <summary>
 /// Add the given type to this set.
 /// </summary>
 internal void Add(TypeDocumentation type)
 {
     types[type.Xid] = type;
 }
コード例 #15
0
 /// <summary>
 /// Try to find a type documentation in this namespace that matches the given type.
 /// </summary>
 internal bool TryGetMatchingType(TypeDocumentation type, out TypeDocumentation result)
 {
     var xid = type.Xid;
     return types.TryGetValue(xid, out result);
 }
コード例 #16
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public PropertyDocumentation(PropertyDefinition prop, TypeDocumentation declaringType)
     : base(prop.Name, declaringType)
 {
     this.prop = prop;
     Parameters.AddRange(prop.Parameters.Select(x => new ParameterDocumentation(x, this)));
 }
コード例 #17
0
        /// <summary>
        /// Try to find a type documentation in this namespace that matches the given type.
        /// </summary>
        internal bool TryGetMatchingType(TypeDocumentation type, out TypeDocumentation result)
        {
            var xid = type.Xid;

            return(types.TryGetValue(xid, out result));
        }
コード例 #18
0
 /// <summary>
 /// Gets the value of the xid attribute for this member the generated API documentation.
 /// </summary>
 internal static string CreateXid(char prefix, TypeDocumentation declaringType, string postfix)
 {
     var declaringTypeName = declaringType.Xid.Substring(2);
     return string.Empty + prefix + '.' + declaringTypeName + '.' + postfix;
 }
コード例 #19
0
 /// <summary>
 /// Default ctor
 /// </summary>
 protected MemberDocumentation(string name, TypeDocumentation declaringType)
 {
     this.name = name;
     this.declaringType = declaringType;
 }
コード例 #20
0
        /// <summary>
        /// Gets the value of the xid attribute for this member the generated API documentation.
        /// </summary>
        internal static string CreateXid(char prefix, TypeDocumentation declaringType, string postfix)
        {
            var declaringTypeName = declaringType.Xid.Substring(2);

            return(string.Empty + prefix + '.' + declaringTypeName + '.' + postfix);
        }
コード例 #21
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public EventDocumentation(EventDefinition evt, TypeDocumentation declaringType)
     : base(evt.Name, declaringType)
 {
     this.evt = evt;
 }
コード例 #22
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public FieldDocumentation(FieldDefinition field, TypeDocumentation declaringType)
     : base(field.Name, declaringType)
 {
     this.field = field;
 }
コード例 #23
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public PropertyDocumentation(PropertyDefinition prop, TypeDocumentation declaringType)
     : base(prop.Name, declaringType)
 {
     this.prop = prop;
     Parameters.AddRange(prop.Parameters.Select(x => new ParameterDocumentation(x, this)));
 }
コード例 #24
0
        /// <summary>
        /// Does this set contain a matching type?
        /// </summary>
        public bool ContainsMatching(TypeDocumentation type)
        {
            TypeDocumentation mine;

            return(TryGetMatchingType(type, out mine));
        }
コード例 #25
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public FieldDocumentation(FieldDefinition field, TypeDocumentation declaringType)
     : base(field.Name, declaringType)
 {
     this.field = field;
 }
コード例 #26
0
 /// <summary>
 /// Default ctor
 /// </summary>
 protected MemberDocumentation(string name, TypeDocumentation declaringType)
 {
     this.name          = name;
     this.declaringType = declaringType;
 }