Exemple #1
0
        static SettingsManager()
        {
            BotBitsPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BotBits\\LoginForm";
            if (!Directory.Exists(BotBitsPath))
            {
                Directory.CreateDirectory(BotBitsPath);
            }

            try
            {
                _loginDatasPath = BotBitsPath + "\\Accounts.xml";
                LoginDatas      = !File.Exists(_loginDatasPath)
                    ? new LoginDatas(true)
                    : XmlSerialize.Deserialize <LoginDatas>(_loginDatasPath);
            }
            catch (Exception)
            {
                LoginDatas = new LoginDatas(true);
                MessageBox.Show(null, "Error", "Failed to load settings.");
            }
        }
Exemple #2
0
 public static void Save()
 {
     XmlSerialize.Serialize(LoginDatas, _loginDatasPath);
 }