Пример #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);
     }
 }
Пример #2
0
 private void ButtonSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (UiHelper.AskUser("To save?") == false)
         {
             return;
         }
         Configuration.SaveConfig("Setting", Settings.Config);
     }
     catch (Exception ex)
     {
         UiHelper.ShowException(ex);
     }
 }
Пример #3
0
 private void kryptonButtonSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (UiHelper.AskUser("To save?") == false)
         {
             return;
         }
         manager.flags = new List <FlagModule>(binding);
         Configuration.SaveConfig(nameof(manager.flags), manager.flags);
     }
     catch (Exception ex)
     {
         UiHelper.ShowException(ex);
     }
 }
Пример #4
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);
     }
 }
Пример #5
0
        private void kryptonButtonRemove_Click(object sender, EventArgs e)
        {
            try
            {
                int currentIndex = dgv.CurrentRow.Index;
                var toRemove     = binding.ElementAt(currentIndex);

                if (UiHelper.AskUser("To Remove " + toRemove.Id + " ?") == false)
                {
                    return;
                }

                binding.RemoveAt(currentIndex);
            }
            catch (Exception ex)
            {
                UiHelper.ShowException(ex);
            }
        }
Пример #6
0
        public override Result Run()
        {
            bool isSucess = UiHelper.AskUser("isSucess?");

            return(new Result(isSucess));
        }