Пример #1
0
 public AddESightDialog(ESightApplianceRepo repo)
 {
     InitializeComponent();
     this.ESightApplianceRepo = repo;
     this.ShowInTaskbar       = false;
     this.DataContext         = this;
 }
Пример #2
0
        private async void OnSaveBtnClicked(object sender, RoutedEventArgs e)
        {
            this.ActionResult = Result.Done();
            ESightAppliance appliance = new ESightAppliance
            {
                Host             = txtHost.Text,
                Port             = txtPort.Text,
                SystemId         = txtSystemId.Text,
                AliasName        = txtAlias.Text,
                LoginAccount     = txtAccount.Text,
                LoginPassword    = txtPassword.Password,
                UpdateCredential = true,
            };

            LogHelper.Info($"Add eSight:{txtHost.Text}、{txtPort.Text}、{txtSystemId.Text}、{txtAlias.Text}、{txtAccount.Text})");

            this.ActionResult = await ESightApplianceRepo.Add(appliance);

            this.btnSave.IsEnabled = true;
            this.btnSave.Content   = "Save";
            if (this.ActionResult.Success)
            {
                LogHelper.Info($"Add eSight ({appliance.Host}) Success.");
                this.Close();
            }
            else
            {
                LogHelper.Error(this.ActionResult.Cause, $"Add eSight ({appliance.Host}) Faild:" + this.ActionResult.Message);
            }
        }
 public ESightConfigDashboard()
 {
     InitializeComponent();
     this.ESightApplianceRepo = this.Resources["ESightApplianceRepo"] as ESightApplianceRepo;
     this.Loaded += ESightConfigDashboard_Loaded;
     this.dispatcherTimer_Tick(null, null);//首先触发一次
 }