Skip to content

LicenseReportBuilder

ClassAssetInventoryAssetInventory.Editor
public static class LicenseReportBuilder

Builds a shared selection-based data model for Reporting and license exports.

public static AssetInfo CreateReportProjection(LicenseResolution selection)

Returns detached display/export values without treating an unavailable project choice as a global fallback.

Parameters

Name Type
selection AssetInventory.LicenseResolution

Returns

AssetInventory.AssetInfo

public static List<AssetInfo> GetExportRows(LicenseReport report)

Gets the same detached selected-value projection used by report rows for an explicit scoped export.

Parameters

Name Type
report AssetInventory.LicenseReport

Returns

System.Collections.Generic.List{AssetInventory.AssetInfo}

BuildForUsage(IEnumerable, IEnumerable, ProjectLicenseSettings, string, int)

Section titled “BuildForUsage(IEnumerable, IEnumerable, ProjectLicenseSettings, string, int)”
public static LicenseReport BuildForUsage(IEnumerable<AssetInfo> packages, IEnumerable<int> actualUsedPackageIds, ProjectLicenseSettings project = null, string scope = "Packages used by this project", int unidentifiedFileCount = 0)

Limits a report to actual usage identities, excluding rows present only to complete the hierarchy.

Parameters

Name Type
packages System.Collections.Generic.IEnumerable{AssetInventory.AssetInfo}
actualUsedPackageIds System.Collections.Generic.IEnumerable{System.Int32}
project AssetInventory.ProjectLicenseSettings
scope System.String
unidentifiedFileCount System.Int32

Returns

AssetInventory.LicenseReport

Build(IEnumerable, ProjectLicenseSettings, string, int)

Section titled “Build(IEnumerable, ProjectLicenseSettings, string, int)”
public static LicenseReport Build(IEnumerable<AssetInfo> packages, ProjectLicenseSettings project = null, string scope = "Selected packages", int unidentifiedFileCount = 0)

Resolves distinct identified packages in a scope and groups their selected agreements while retaining unresolved package rows.

Parameters

Name Type
packages System.Collections.Generic.IEnumerable{AssetInventory.AssetInfo}
project AssetInventory.ProjectLicenseSettings
scope System.String
unidentifiedFileCount System.Int32

Returns

AssetInventory.LicenseReport

public static Dictionary<string, LicenseDocument> LoadDocuments(LicenseReport report)

Loads only the selected document revisions needed by an explicitly requested export.

Parameters

Name Type
report AssetInventory.LicenseReport

Returns

System.Collections.Generic.Dictionary{System.String,AssetInventory.LicenseDocument}

BuildMarkdown(LicenseReport, bool, IReadOnlyDictionary<string, LicenseDocument>)

Section titled “BuildMarkdown(LicenseReport, bool, IReadOnlyDictionary<string, LicenseDocument>)”
public static string BuildMarkdown(LicenseReport report, bool includeAgreementTexts = false, IReadOnlyDictionary<string, LicenseDocument> documents = null)

Formats package selections, unresolved states, conditions, and optionally the supplied saved agreement texts as Markdown.

Parameters

Name Type
report AssetInventory.LicenseReport
includeAgreementTexts System.Boolean
documents System.Collections.Generic.IReadOnlyDictionary{System.String,AssetInventory.LicenseDocument}

Returns

System.String

public static IEnumerable<string> GetConditionLines(LicenseConditions conditions)

Enumerates readable notes, limits, references, dates, and review requirements recorded in the supplied conditions.

Parameters

Name Type
conditions AssetInventory.LicenseConditions

Returns

System.Collections.Generic.IEnumerable{System.String}