Beispiel #1
0
 public FrmAdd() {
     InitializeComponent();
     Text = @"Add new item :: " + InfoHelper.NameVersion;
     _cmPriorityOnSelectedValueChanged = ( sender, value ) => {
         if ( _model != null )
             _model.Priority = (ProcessPriorityClass) cmPriority.SelectedItem;
     };
     Model = new PasswordedDemonizedProcess();
 }
 private async void editToolStripMenuItem_Click( object sender, EventArgs e ) {
     if ( _api == null ) return;
     var o = GetMenuRow( sender );
     if ( o == null ) return;
     using ( var add = new FrmAdd() ) {
         var em = new PasswordedDemonizedProcess() {
             Id = o.Id,
             Arguments = o.Arguments,
             Name = o.Name,
             Key = "",
             Path = o.Path,
             Autorestart = o.Autorestart,
             HideOnStart = o.HideOnStart,
             Priority = o.Priority
         };
         add.Model = em;
         if ( add.ShowDialog() != DialogResult.OK ) return;
         await _api.Process.Edit( em ).ConfigureAwait( true );
     }
     await UpdateProcesses().ConfigureAwait(true);
 }