Class IOManager
Static Class used to access serialization and deserialization of objects.
Inheritance
Inherited Members
Namespace: RuriLib
Assembly: RuriLib.dll
Syntax
public static class IOManager
Methods
| Improve this Doc View SourceCloneBlock(BlockBase)
Clones a BlockBase object by serializing and deserializing it.
Declaration
public static BlockBase CloneBlock(BlockBase block)
Parameters
Type | Name | Description |
---|---|---|
BlockBase | block | The object to clone |
Returns
Type | Description |
---|---|
BlockBase | The cloned BlockBase object |
CloneConfig(Config)
Clones a Config object by serializing and deserializing it.
Declaration
public static Config CloneConfig(Config config)
Parameters
Type | Name | Description |
---|---|---|
Config | config | The object to clone |
Returns
Type | Description |
---|---|
Config | The cloned Config object |
CloneProxies(List<CProxy>)
Clones a list of proxies by serializing and deserializing it.
Declaration
public static List<CProxy> CloneProxies(List<CProxy> proxies)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<CProxy> | proxies | The list of proxies to clone |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<CProxy> | The cloned list of proxies |
DeserializeBlock(String)
Deserializes a Block from a JSON string.
Declaration
public static BlockBase DeserializeBlock(string block)
Parameters
Type | Name | Description |
---|---|---|
System.String | block | The JSON-encoded string with TypeNameHandling on |
Returns
Type | Description |
---|---|
BlockBase | An instance of BlockBase |
DeserializeBlocks(String)
Deserializes a list of blocks from a JSON string.
Declaration
public static List<BlockBase> DeserializeBlocks(string blocks)
Parameters
Type | Name | Description |
---|---|---|
System.String | blocks | The JSON-encoded string with TypeNameHandling on |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<BlockBase> | A list of instances of BlockBase |
DeserializeConfig(String)
Deserializes a Config object from a loli-formatted string.
Declaration
public static Config DeserializeConfig(string config)
Parameters
Type | Name | Description |
---|---|---|
System.String | config | The loli-formatted string |
Returns
Type | Description |
---|---|
Config | An instance of the Config object |
DeserializeProxies(String)
Deserializes a list of proxies from a JSON string.
Declaration
public static List<CProxy> DeserializeProxies(string proxies)
Parameters
Type | Name | Description |
---|---|---|
System.String | proxies | The JSON-encoded list of proxies with TypeNameHandling on |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<CProxy> | A list of CProxy objects |
LoadConfig(String)
Loads a Config object from a .loli file.
Declaration
public static Config LoadConfig(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The config file |
Returns
Type | Description |
---|---|
Config | A Config object |
LoadSettings(String)
Loads the RuriLib settings from a file.
Declaration
public static RLSettingsViewModel LoadSettings(string settingsFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | settingsFile | The file you want to load from |
Returns
Type | Description |
---|---|
RLSettingsViewModel | An instance of RLSettingsViewModel |
ParseEnvironmentSettings(String)
Parses the EnvironmentSettings from a file.
Declaration
public static EnvironmentSettings ParseEnvironmentSettings(string envFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | envFile | The .ini file of the settings |
Returns
Type | Description |
---|---|
EnvironmentSettings | The loaded EnvironmentSettings object |
SaveConfig(Config, String)
Saves a Config object to a .loli file.
Declaration
public static bool SaveConfig(Config config, string fileName)
Parameters
Type | Name | Description |
---|---|---|
Config | config | The viewmodel of the config to save |
System.String | fileName | The path of the file where the Config will be saved |
Returns
Type | Description |
---|---|
System.Boolean | Whether the file has been saved successfully |
SaveSettings(String, RLSettingsViewModel)
Saves the RuriLib settings to a file.
Declaration
public static void SaveSettings(string settingsFile, RLSettingsViewModel settings)
Parameters
Type | Name | Description |
---|---|---|
System.String | settingsFile | The file you want to save to |
RLSettingsViewModel | settings | The RuriLib settings object |
SerializeBlock(BlockBase)
Serializes a block to a JSON string.
Declaration
public static string SerializeBlock(BlockBase block)
Parameters
Type | Name | Description |
---|---|---|
BlockBase | block | The block to serialize |
Returns
Type | Description |
---|---|
System.String | The JSON-encoded BlockBase object with TypeNameHandling on |
SerializeBlocks(List<BlockBase>)
Serializes a list of blocks to a JSON string.
Declaration
public static string SerializeBlocks(List<BlockBase> blocks)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<BlockBase> | blocks | The list of blocks to serialize |
Returns
Type | Description |
---|---|
System.String | The JSON-encoded List of BlockBase objects with TypeNameHandling on |
SerializeConfig(Config)
Serializes a Config object to the loli-formatted string.
Declaration
public static string SerializeConfig(Config config)
Parameters
Type | Name | Description |
---|---|---|
Config | config | The Config to serialize |
Returns
Type | Description |
---|---|
System.String | The loli-formatted string |
SerializeProxies(List<CProxy>)
Serializes a list of proxies to a JSON string.
Declaration
public static string SerializeProxies(List<CProxy> proxies)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<CProxy> | proxies | The list of proxies to serialize |
Returns
Type | Description |
---|---|
System.String | The JSON-encoded list of CProxy objects with TypeNameHandling on |