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