Beispiel #1
0
        public void EditSelectedRecord()
        {
            var selRecord = PluginTree.SelectedRecord;

            if (selRecord is GroupRecord)
            {
                var gr = selRecord as GroupRecord;
                if (DialogResult.OK == GroupEditor.Display(gr))
                {
                    GetPluginFromNode(PluginTree.SelectedRecord).InvalidateCache();
                    FireSelectionUpdated();
                }
            }
            else if (selRecord is Record)
            {
                var r    = selRecord as Record;
                var form = new FullRecordEditor(r);
                form.StartPosition = FormStartPosition.CenterScreen;

                var dockParent = FindDockContent(this);
                if (dockParent != null)
                {
                    var sz = form.Size;
                    form.Show(dockParent.DockHandler.DockPanel, DockState.Float);
                    form.Pane.FloatWindow.Size = sz;
                }
                else
                {
                    form.Show(this);
                }
            }
        }
Beispiel #2
0
 public void EditSelectedHeader()
 {
     if (PluginTree.SelectedRecord == null)
     {
         return;
     }
     if (PluginTree.SelectedRecord is Record)
     {
         var r = (Record)PluginTree.SelectedRecord;
         if (DialogResult.OK == HeaderEditor.Display(r))
         {
             GetPluginFromNode(PluginTree.SelectedRecord).InvalidateCache();
             FireSelectionUpdated();
         }
     }
     else if (PluginTree.SelectedRecord is GroupRecord)
     {
         var gr = (GroupRecord)PluginTree.SelectedRecord;
         if (DialogResult.OK == GroupEditor.Display(gr))
         {
             GetPluginFromNode(PluginTree.SelectedRecord).InvalidateCache();
             FireSelectionUpdated();
         }
     }
 }