Class LicenseFile
Summary description for LicenseFile.
Inheritance
Inherited Members
Namespace: ImageVault.Core.License.Meriworks
Assembly: ImageVault.Core.dll
Syntax
public class LicenseFile
Constructors
LicenseFile()
Declaration
public LicenseFile()
Properties
Count
Gets the Count of the number of Licenses in the file.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[String]
Gets the licenseData for the specific licenseName
Declaration
public LicenseData this[string licenseName] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | licenseName |
Property Value
Type | Description |
---|---|
LicenseData |
XMLLicenses
The list of licenses contained in the LicenseFile
Declaration
public List<LicenseData> XMLLicenses { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<LicenseData> |
Methods
GetFromXmlFile(String)
Creates an instance of the LicenseFile class from the specified file.
Declaration
public static LicenseFile GetFromXmlFile(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to the file containing the xml data for the instance |
Returns
Type | Description |
---|---|
LicenseFile | The loaded LicenseFile instance |
Load(Stream, Encoding)
Creates an instance of the LicenseFile class from the specified input stream.
Declaration
public static LicenseFile Load(Stream stream, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to load from |
System.Text.Encoding | encoding | The System.Text.Encoding to use when loading the file |
Returns
Type | Description |
---|---|
LicenseFile | The loaded LicenseFile instance |
LoadFromXml(String)
Loads a LicenseFile from Xml
Declaration
public static LicenseFile LoadFromXml(string xml)
Parameters
Type | Name | Description |
---|---|---|
System.String | xml | The Xml to load |
Returns
Type | Description |
---|---|
LicenseFile | The loaded LicenseFile |
SaveToXmlFile(String)
Saves the state of the object to the specified xml file
Declaration
public void SaveToXmlFile(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to the xml file to save |
SaveToXmlString()
Serializes the LicenseFile to an XML string
Declaration
public string SaveToXmlString()
Returns
Type | Description |
---|---|
System.String |
SetLicense(LicenseData)
Sets the licence of the file. Will replace any existing license of the same name
Declaration
public void SetLicense(LicenseData license)
Parameters
Type | Name | Description |
---|---|---|
LicenseData | license | The license to set |