Ejemplo n.º 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)));
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public EventDocumentation(EventDefinition evt, TypeDocumentation declaringType)
     : base(evt.Name, declaringType)
 {
     this.evt = evt;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Does this set contain a matching type?
 /// </summary>
 public bool ContainsMatching(TypeDocumentation type)
 {
     TypeDocumentation mine;
     return TryGetMatchingType(type, out mine);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Add the given type to this set.
 /// </summary>
 internal void Add(TypeDocumentation type)
 {
     types[type.Xid] = type;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Add the given type to this set.
 /// </summary>
 internal void Add(TypeDocumentation type)
 {
     types[type.Xid] = type;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Default ctor
 /// </summary>
 protected MemberDocumentation(string name, TypeDocumentation declaringType)
 {
     this.name = name;
     this.declaringType = declaringType;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 21
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public EventDocumentation(EventDefinition evt, TypeDocumentation declaringType)
     : base(evt.Name, declaringType)
 {
     this.evt = evt;
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public FieldDocumentation(FieldDefinition field, TypeDocumentation declaringType)
     : base(field.Name, declaringType)
 {
     this.field = field;
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 24
0
        /// <summary>
        /// Does this set contain a matching type?
        /// </summary>
        public bool ContainsMatching(TypeDocumentation type)
        {
            TypeDocumentation mine;

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