예제 #1
0
 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);
 }
예제 #2
0
 private async void smenuAddNewItem_Click( object sender, EventArgs e ) {
     if ( _api == null ) return;
     using ( var add = new FrmAdd() ) {
         if ( add.ShowDialog() != DialogResult.OK ) return;
         await _api.Process.Create( add.Model ).ConfigureAwait( true );
     }
     await UpdateProcesses().ConfigureAwait( false );
 }