コード例 #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);
                }
            }
        }
コード例 #2
0
        private void EditSelectedRecords()
        {
            var  dockParent = FindDockContent(this);
            var  dockPanel  = dockParent != null ? dockParent.DockHandler.DockPanel : null;
            bool first      = true;

            foreach (var r in this.listSearchView.SelectedObjects.OfType <Record>())
            {
                var form = new FullRecordEditor(r);
                if (dockParent != null)
                {
                    var sz = form.Size;
                    if (first)
                    {
                        form.StartPosition = FormStartPosition.CenterScreen;
                        form.Show(dockPanel, DockState.Float);
                        form.Pane.FloatWindow.Size = sz;
                        first = false;
                    }
                    else
                    {
                        form.Show(dockPanel);
                    }
                }
                else
                {
                    form.Show(this);
                }
            }
        }