You've already forked linux-packaging-mono
Imported Upstream version 5.2.0.179
Former-commit-id: a536d4f20e27294d8bbc2184d75f3a22364f7ba1
This commit is contained in:
parent
966bba02bb
commit
fad71374d0
50
external/api-doc-tools/mdoc/Mono.Documentation/Frameworks/FrameworkEntry.cs
vendored
Normal file
50
external/api-doc-tools/mdoc/Mono.Documentation/Frameworks/FrameworkEntry.cs
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Mono.Cecil;
|
||||
using Mono.Cecil.Rocks;
|
||||
|
||||
namespace Mono.Documentation
|
||||
{
|
||||
class FrameworkEntry
|
||||
{
|
||||
SortedSet<FrameworkTypeEntry> types = new SortedSet<FrameworkTypeEntry> ();
|
||||
|
||||
List<FrameworkEntry> allframeworks;
|
||||
|
||||
public FrameworkEntry (List<FrameworkEntry> frameworks)
|
||||
{
|
||||
allframeworks = frameworks;
|
||||
if (allframeworks == null)
|
||||
allframeworks = new List<FrameworkEntry> (0);
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public ISet<FrameworkTypeEntry> Types { get { return this.types; } }
|
||||
|
||||
public IEnumerable<FrameworkEntry> Frameworks { get { return this.allframeworks; } }
|
||||
|
||||
public static readonly FrameworkEntry Empty = new EmptyFrameworkEntry () { Name = "Empty" };
|
||||
|
||||
public virtual FrameworkTypeEntry ProcessType (TypeDefinition type)
|
||||
{
|
||||
|
||||
var entry = types.FirstOrDefault (t => t.Name.Equals (type.FullName));
|
||||
if (entry == null) {
|
||||
var docid = DocCommentId.GetDocCommentId (type);
|
||||
entry = new FrameworkTypeEntry (this) { Id = docid, Name = type.FullName, Namespace = type.Namespace };
|
||||
types.Add (entry);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
public override string ToString () => this.Name;
|
||||
|
||||
class EmptyFrameworkEntry : FrameworkEntry
|
||||
{
|
||||
public EmptyFrameworkEntry () : base (null) { }
|
||||
public override FrameworkTypeEntry ProcessType (TypeDefinition type) { return FrameworkTypeEntry.Empty; }
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user