Click or drag to resize

Save and load settings

Save and Load methods, respectively, are used to save and load Connector settings.

To save and load settings from an external file, you can use the serialization and deserialization, respectively, implemented in S#.

C#
...
private readonly Connector _connector = new Connector();
private const string _connectorFile = "ConnectorFile";
...

public void Load()
{
    if (File.Exists(_connectorFile))
    {
        //Download connector settings from an existing configuration file
        _connector.Load(new XmlSerializer<SettingsStorage>().Deserialize(_connectorFile));
    }
}
...

public void Save()
{
    //Save the connector settings to the configuration file
    new XmlSerializer<SettingsStorage>().Serialize(_connector.Save(), _connectorFile);
}
...
See Also

Other Resources