Example #1
0
 /// <summary>
 /// Saves the Configuration information to file.
 /// </summary>
 /// <param name="configurationFileName">Client provided configuration file name.</param>
 public static void Save(string configurationFileName = "")
 {
     ConfigurationFileSerializer.Serialize(
         DefaultWalletFileName,
         DefaultNetwork.ToString(),
         DefaultConnectionType.ToString(),
         CanSpendUnconfirmed.ToString(),
         configurationFileName);
 }
Example #2
0
        /// <summary>
        /// Loads the Configuration information from file.
        /// </summary>
        /// <param name="filePath">Path to file.</param>
        public static void Load(string filePath = "")
        {
            try
            {
                var configurationFileContents = ConfigurationFileSerializer.Deserialize(filePath);

                DefaultWalletFileName = configurationFileContents.WalletFileName;
                DefaultNetwork        = DefaultNetwork.GetNetworkFromString(configurationFileContents.Network);
                DefaultConnectionType =
                    DefaultConnectionType.GetConnectionTypeFromString(configurationFileContents.ConnectionType);
                CanSpendUnconfirmed = bool.Parse(configurationFileContents.CanSpendUnconfirmed);
            }
            catch (FileNotFoundException)
            {
                // ToDo: Log
            }
        }