Пример #1
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));
    }
Пример #2
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));
    }
Пример #3
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;
 }
Пример #4
0
    private static void AddObsoletion(XContainer parent, ObsoletionEntry obsoletion, string apiFingerprint)
    {
        var obsoletionElement = new XElement("obsolete",
                                             new XAttribute("id", apiFingerprint),
                                             new XAttribute("isError", obsoletion.IsError));

        if (obsoletion.Message is not null)
        {
            obsoletionElement.Add(new XAttribute("message", obsoletion.Message));
        }

        if (obsoletion.DiagnosticId is not null)
        {
            obsoletionElement.Add(new XAttribute("diagnosticId", obsoletion.DiagnosticId));
        }

        if (obsoletion.UrlFormat is not null)
        {
            obsoletionElement.Add(new XAttribute("urlFormat", obsoletion.UrlFormat));
        }

        parent.Add(obsoletionElement);
    }