예제 #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
 /// <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
 /// <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
 /// <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;
 }