Skip to content

ProjectLicenseSettings

ClassAssetInventoryAssetInventory.Editor
public sealed class ProjectLicenseSettings

A project's explicit license choices, independent of globally shared catalog selections.

public const int CurrentVersion = 1

Returns

System.Int32

public static ProjectLicenseSettings Load(string path = null)

Loads project license choices from the supplied or default path, returning an error state for unreadable or unsupported data without rewriting the file.

Parameters

Name Type
path System.String

Returns

AssetInventory.ProjectLicenseSettings

TryGetSelection(AssetInfo, out ProjectLicenseSelection)

Section titled “TryGetSelection(AssetInfo, out ProjectLicenseSelection)”
public bool TryGetSelection(AssetInfo package, out ProjectLicenseSelection selection)

Looks up a recorded choice for the package in the current catalog; use ProjectLicenseSettings.GetSelectionError(AssetInfo) to check whether that choice can be applied.

Parameters

Name Type
package AssetInventory.AssetInfo
selection AssetInventory.ProjectLicenseSelection

Returns

System.Boolean

public string GetSelectionError(AssetInfo package)

Returns a settings, identity, source, or catalog-context error that prevents applying the package's project choice, or null when none is detected.

Parameters

Name Type
package AssetInventory.AssetInfo

Returns

System.String

SetSelection(AssetInfo, PackageLicense, out string)

Section titled “SetSelection(AssetInfo, PackageLicense, out string)”
public bool SetSelection(AssetInfo package, PackageLicense selected, out string error)

Validates and saves a project-specific package choice, restoring previous project choices if saving fails.

Parameters

Name Type
package AssetInventory.AssetInfo
selected AssetInventory.PackageLicense
error System.String

Returns

System.Boolean

UsePackageSelection(AssetInfo, out string)

Section titled “UsePackageSelection(AssetInfo, out string)”
public bool UsePackageSelection(AssetInfo package, out string error)

Removes the package's project override and saves the change, restoring previous choices if saving fails.

Parameters

Name Type
package AssetInventory.AssetInfo
error System.String

Returns

System.Boolean

public bool Save(out string error)

Atomically saves validated project choices and retains their referenced documents, refusing to overwrite settings changed elsewhere.

Parameters

Name Type
error System.String

Returns

System.Boolean

public ProjectLicenseSettings()

public int Version { get; set; }

Returns

System.Int32

public string ProjectId { get; set; }

Returns

System.String

public List<ProjectLicenseSelection> Selections { get; set; }

Returns

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

public string Error { get; }

Returns

System.String

public string FilePath { get; }

Returns

System.String

public static string DefaultPath { get; }

Returns

System.String