PackageSourceInfo
Namespace: AnyPackage.Provider
The PackageSourceInfo
class. Contains information regarding a package source.
public sealed class PackageSourceInfo
Inheritance Object → PackageSourceInfo
Properties
Name
Gets the source name.
public string Name { get; }
Property Value
Location
Gets the source location.
public string Location { get; }
Property Value
Provider
Gets the package provider information.
public PackageProviderInfo Provider { get; }
Property Value
Metadata
Gets source metadata.
public IReadOnlyDictionary<string, object> Metadata { get; }
Property Value
IReadOnlyDictionary<String, Object>
Trusted
Gets if the source is trusted.
public bool Trusted { get; }
Property Value
Constructors
PackageSourceInfo(String, String, PackageProviderInfo)
Instantiates a PackageSourceInfo
class.
public PackageSourceInfo(string name, string location, PackageProviderInfo provider)
Parameters
name
String
Source name.
location
String
Source location.
provider
PackageProviderInfo
Package provider.
Exceptions
ArgumentNullException
If name, location, or provider is null.
ArgumentException
If name or location is empty or whitespace.
PackageSourceInfo(String, String, Boolean, PackageProviderInfo)
Instantiates a PackageSourceInfo
class.
public PackageSourceInfo(string name, string location, bool trusted, PackageProviderInfo provider)
Parameters
name
String
Source name.
location
String
Source location.
trusted
Boolean
If source is trusted.
provider
PackageProviderInfo
Package provider.
Exceptions
ArgumentNullException
If name, location, or provider is null.
ArgumentException
If name or location is empty or whitespace.
PackageSourceInfo(String, String, Boolean, IDictionary<String, Object>, PackageProviderInfo)
Instantiates a PackageSourceInfo
class.
public PackageSourceInfo(string name, string location, bool trusted, IDictionary<string, object> metadata, PackageProviderInfo provider)
Parameters
name
String
Source name.
location
String
Source location.
trusted
Boolean
If source is trusted.
metadata
IDictionary<String, Object>
Additional metadata about source.
provider
PackageProviderInfo
Package provider.
Exceptions
ArgumentNullException
If name, location, provider, or metadata is null.
ArgumentException
If name or location is empty or whitespace.
PackageSourceInfo(String, String, Boolean, Hashtable, PackageProviderInfo)
Instantiates a PackageSourceInfo
class.
public PackageSourceInfo(string name, string location, bool trusted, Hashtable metadata, PackageProviderInfo provider)
Parameters
name
String
Source name.
location
String
Source location.
trusted
Boolean
If source is trusted.
metadata
Hashtable
Additional metadata about source.
provider
PackageProviderInfo
Package provider.
Exceptions
ArgumentNullException
If name, location, provider, or metadata is null.
ArgumentException
If name or location is empty or whitespace.
Remarks:
Metadata hashtable keys will be converted to strings.
Methods
ToString()
Returns a string of the source name.
public string ToString()
Returns
The source name.