Class StorageService
Storage service that replaces direct manipulations with Config.Root xml storage.
Namespace: FastReport.Utils
Assembly: FastReport.Base.dll
Syntax
public class StorageService
Constructors
StorageService(String)
Initializes a new instance of a storage.
Declaration
public StorageService(string commaSeparatedPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | commaSeparatedPath | The comma-separated path. |
Properties
HasProperties
Determines if the storage is not empty.
Declaration
public bool HasProperties { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
GetBool(String, Boolean)
Gets a bool value.
Declaration
public bool GetBool(string key, bool defaultValue = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Boolean | defaultValue | Default value. |
Returns
Type | Description |
---|---|
System.Boolean | The value associated with a key, or default value. |
GetEnum<T>(String, T)
Gets an enum value.
Declaration
public T GetEnum<T>(string key, T defaultValue = default(T))
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
T | defaultValue | Default value. |
Returns
Type | Description |
---|---|
T | The value associated with a key, or default value. |
Type Parameters
Name | Description |
---|---|
T |
GetFloat(String, Single)
Gets a float value.
Declaration
public float GetFloat(string key, float defaultValue = 0F)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Single | defaultValue | Default value. |
Returns
Type | Description |
---|---|
System.Single | The value associated with a key, or default value. |
GetInt(String, Int32)
Gets an int value.
Declaration
public int GetInt(string key, int defaultValue = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Int32 | defaultValue | Default value. |
Returns
Type | Description |
---|---|
System.Int32 | The value associated with a key, or default value. |
GetStr(String, String)
Gets a string value.
Declaration
public string GetStr(string key, string defaultValue = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.String | defaultValue | Default value. |
Returns
Type | Description |
---|---|
System.String | The value associated with a key, or default value. |
Has(String)
Determines if the key has a value.
Declaration
public bool Has(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the key has a non-empty value. |
Read(IFRSerializable)
Reads a serializable object.
Declaration
public void Read(IFRSerializable obj)
Parameters
Type | Name | Description |
---|---|---|
IFRSerializable | obj | The object to read. |
SetBool(String, Boolean)
Sets a bool value as a 0/1.
Declaration
public void SetBool(string key, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Boolean | value | Value associated with a key. |
SetBoolStr(String, Boolean)
Sets a bool value as a False/True.
Declaration
public void SetBoolStr(string key, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Boolean | value | Value associated with a key. |
SetEnum<T>(String, T)
Sets an enum value.
Declaration
public void SetEnum<T>(string key, T value)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
T | value | Value associated with a key. |
Type Parameters
Name | Description |
---|---|
T |
SetFloat(String, Single)
Sets a float value.
Declaration
public void SetFloat(string key, float value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Single | value | Value associated with a key. |
SetInt(String, Int32)
Sets an int value.
Declaration
public void SetInt(string key, int value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Int32 | value | Value associated with a key. |
SetStr(String, String)
Sets a string value.
Declaration
public void SetStr(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.String | value | Value associated with a key. |
Write(IFRSerializable)
Writes a serializable object.
Declaration
public void Write(IFRSerializable obj)
Parameters
Type | Name | Description |
---|---|---|
IFRSerializable | obj | The object to write. |