예제 #1
0
    public static AssemblyEntry Create(IAssemblySymbol assembly)
    {
        var identity                = assembly.Identity;
        var platformSupportEntry    = PlatformSupportEntry.Create(assembly.Modules.First()) ?? PlatformSupportEntry.Create(assembly);
        var previewRequirementEntry = PreviewRequirementEntry.Create(assembly.Modules.First()) ?? PreviewRequirementEntry.Create(assembly);
        var apis = GetApis(assembly);

        return(new AssemblyEntry(identity, platformSupportEntry, previewRequirementEntry, apis));
    }
예제 #2
0
 private AssemblyEntry(AssemblyIdentity identity,
                       PlatformSupportEntry platformSupportEntry,
                       PreviewRequirementEntry previewRequirementEntry,
                       List <ApiEntry> apis)
 {
     Fingerprint             = ComputeFingerprint(identity, apis);
     Identity                = identity;
     PlatformSupportEntry    = platformSupportEntry;
     PreviewRequirementEntry = previewRequirementEntry;
     Apis = apis;
 }
예제 #3
0
    public static ApiEntry Create(ISymbol symbol, ApiEntry parent = null)
    {
        var guid                    = symbol.GetCatalogGuid();
        var kind                    = symbol.GetApiKind();
        var name                    = symbol.GetCatalogName();
        var syntax                  = symbol.GetCatalogSyntaxMarkup();
        var obsoletionEntry         = ObsoletionEntry.Create(symbol);
        var platformSupportEntry    = PlatformSupportEntry.Create(symbol);
        var previewRequirementEntry = PreviewRequirementEntry.Create(symbol);

        return(new ApiEntry(guid, kind, parent, name, syntax, obsoletionEntry, platformSupportEntry, previewRequirementEntry));
    }
예제 #4
0
    public static ApiEntry Create(ISymbol symbol, ApiEntry?parent = null)
    {
        ArgumentNullException.ThrowIfNull(symbol);

        var guid                    = symbol.GetCatalogGuid();
        var kind                    = symbol.GetApiKind();
        var name                    = symbol.GetCatalogName();
        var obsoletionEntry         = ObsoletionEntry.Create(symbol);
        var platformSupportEntry    = PlatformSupportEntry.Create(symbol);
        var previewRequirementEntry = PreviewRequirementEntry.Create(symbol);

        return(new ApiEntry(guid, kind, parent, name, null, obsoletionEntry, platformSupportEntry, previewRequirementEntry));
    }
예제 #5
0
    private static void AddPlatformSupport(XContainer parent, PlatformSupportEntry platformSupport, string?apiFingerprint = null)
    {
        foreach (var supported in platformSupport.SupportedPlatforms)
        {
            var supportedElement = new XElement("supportedPlatform",
                                                apiFingerprint is null ? null : new XAttribute("id", apiFingerprint),
                                                new XAttribute("name", supported));
            parent.Add(supportedElement);
        }

        foreach (var unsupported in platformSupport.UnsupportedPlatforms)
        {
            var unsupportedElement = new XElement("unsupportedPlatform",
                                                  apiFingerprint is null ? null : new XAttribute("id", apiFingerprint),
                                                  new XAttribute("name", unsupported));
            parent.Add(unsupportedElement);
        }
    }
예제 #6
0
 private ApiEntry(Guid guid,
                  ApiKind kind,
                  ApiEntry parent,
                  string name,
                  string syntax,
                  ObsoletionEntry obsoletionEntry,
                  PlatformSupportEntry platformSupportEntry,
                  PreviewRequirementEntry previewRequirementEntry)
 {
     Fingerprint             = guid;
     Kind                    = kind;
     Parent                  = parent;
     Name                    = name;
     Syntax                  = syntax;
     ObsoletionEntry         = obsoletionEntry;
     PlatformSupportEntry    = platformSupportEntry;
     PreviewRequirementEntry = previewRequirementEntry;
 }