public void Execute(object parameter)
 {
     _editor.EditObject <TestObject>(new PropertyEditableObject <TestObject>(
                                         new TestObject()
     {
         Field1 = "Value1", Field2 = "Value2"
     }));
 }
        private void treeView1_MouseClick(object sender, MouseEventArgs e)
        {
            TreeNode tn = this.treeView1.GetNodeAt(e.Location);

            if (tn != null)
            {
                var task = tn.Tag as TasklistViewItem;
                if (task != null)
                {
                    if (_editor != null)
                    {
                        var obj = new PropertyEditableObject <BatchJob>(task.Batchjob);
                        _editor.EditObject <BatchJob>(obj);
                    }
                }
            }

            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                if (tn != null)
                {
                    var task = tn.Tag as TasklistViewItem;
                    if (task != null)
                    {
                        if (task.Batchjob.IsBusy)
                        {
                            ctxTasklist.Items[0].Enabled = false;
                            ctxTasklist.Items[1].Enabled = true && task.Batchjob.CanCancel;
                            ctxTasklist.Items[2].Enabled = _scheduleJob != null;
                        }
                        else
                        {
                            ctxTasklist.Items[0].Enabled = true;
                            ctxTasklist.Items[1].Enabled = false;
                            ctxTasklist.Items[2].Enabled = false;
                        }
                        ctxTasklist.Show(this, e.Location);
                    }
                }
            }
        }