Пример #1
0
        private void AddServer_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new NewServerDialog(async(info) =>
            {
                await Servers.AddServerAsync(info);
            });

            dialog.Show();
        }
Пример #2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (var dialog = new NewServerDialog())
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             var setting = new Setting
             {
                 Name = dialog.ServerName,
                 Path = dialog.Path,
                 Port = dialog.Port
             };
             _settingStorage.Add(setting);
             AddServer(setting);
         }
     }
 }
Пример #3
0
 private void Item_OnUpdate(WebListItem sender)
 {
     using (var dialog = new NewServerDialog(sender.Setting))
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             var setting = new Setting
             {
                 Name = dialog.ServerName,
                 Path = dialog.Path,
                 Port = dialog.Port
             };
             if (_settingStorage.Update(setting))
             {
                 sender.UpdateSetting(setting);
             }
         }
     }
 }