Example #1
0
 private void kryptonButtonSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (UiHelper.AskUser("To save?") == false)
         {
             return;
         }
         manager.UserConfigs.Clear();
         foreach (var item in bingding)
         {
             manager.UserConfigs.Add(new UserConfig()
             {
                 Id       = Tool.Encrypt(item.Id),
                 Password = Tool.Encrypt(item.Password),
                 Type     = Tool.Encrypt(item.Type.ToString()),
             });
         }
         Configuration.SaveConfig(nameof(UserConfig), manager.UserConfigs);
         manager.LoadConfig();
     }
     catch (Exception ex)
     {
         UiHelper.ShowException(ex);
     }
 }
Example #2
0
 private void kryptonButtonSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (UiHelper.AskUser("To save?") == false)
         {
             return;
         }
         manager.hardwares = new List <CommunicationBase>(bingding);
         Configuration.SaveConfig(nameof(manager.hardwares), manager.hardwares);
         manager.LoadConfig();
     }
     catch (Exception ex)
     {
         UiHelper.ShowException(ex);
     }
 }