Exemplo n.º 1
0
 private void btnEditConfig_Click(object sender, EventArgs e)
 {
     using (ObjectEditorForm frm = new ObjectEditorForm(_document.Config))
     {
         frm.ShowDialog(this);
         comboBoxClassName.Text = _document.Config.ClassName;
         textBoxPath.Text       = _document.Config.SelectionPath;
     }
 }
Exemplo n.º 2
0
 public bool HandleCommand(string command, ref Exception error)
 {
     if (command == "edit event")
     {
         provider.Load(timers);
         using (ObjectEditorForm form = new ObjectEditorForm(provider, callback))
         {
             if (form.ShowDialog() == DialogResult.OK)
             {
                 provider.Save(timers);
                 callback.SaveSettings();
                 InvokeTimersChanged();
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
 public bool HandleCommand(string command, ref Exception error)
 {
     if (command == "edit command")
     {
         provider.Load(commands);
         using (ObjectEditorForm form = new ObjectEditorForm(provider, callback))
         {
             if (form.ShowDialog() == DialogResult.OK)
             {
                 provider.Save(commands);
                 callback.SaveSettings();
                 InvokeSuggestedCommandChanged();
             }
         }
         return(true);
     }
     else
     {
         ScriptingCommand scriptingCommand = commands.Where(c => c.Name == command).FirstOrDefault();
         if (scriptingCommand != null)
         {
             try
             {
                 scriptingCommand.ExecuteCommand(callback);
             }
             catch (Exception ex)
             {
                 error = ex;
             }
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }