Ejemplo n.º 1
0
        private void DockVisibilityChanging(object sender, DockVisibilityChangingEventArgs arg)
        {
            if (!_dict.ContainsKey(arg.Control))
            {
                throw new ApplicationException("Invalid docking panel control");
            }

            var panel = GetDockPanel(arg.Control);
            var info  = _dict[arg.Control];
            var args  = new DockPanelCancelEventArgs(panel, info.Key);

            if (panel.Visible)
            {
                _broadcaster.BroadcastEvent(p => p.DockPanelClosing_, panel, args, info.Identity);
            }
            else
            {
                _broadcaster.BroadcastEvent(p => p.DockPanelOpening_, panel, args, info.Identity);
            }

            if (args.Cancel)
            {
                arg.Cancel = true;
            }
        }
Ejemplo n.º 2
0
 private void dockManager_Expanding(object sender, DockPanelCancelEventArgs e)
 {
     if (e.Panel == mdfyDockPanel && !jrnGridView.IsDataRow(jrnGridView.FocusedRowHandle))
     {
         e.Cancel = true;
     }
 }
Ejemplo n.º 3
0
 public void _pnew_ClosingPanel(object sender, DockPanelCancelEventArgs e)
 {
     if (this.OnClosingPanel != null)
     {
         this._dp.ClosingPanel -= new DockPanelCancelEventHandler(this._pnew_ClosingPanel);
         this.OnClosingPanel();
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 关闭面板时,根据IsCloseDockPanel确定隐藏面板还是销毁面板
 /// </summary>
 private void dockFormPanel_ClosingPanel(object sender, DockPanelCancelEventArgs e)
 {
     if (!IsCloseDockPanel)
     {
         e.Cancel      = true; //默认情况下,点击面板的关闭按钮面板隐藏但未被销毁,设置此值以重写它的默认行为
         FloatLocation = e.Panel.FloatLocation;
         //e.Panel.Dispose();
     }
 }
        //private void GenerateLayoutDocumentContainer(FanLayoutDock body)
        //{
        //    DevExpress.XtraBars.Docking2010.DocumentManager documentManager = new DevExpress.XtraBars.Docking2010.DocumentManager(Container.GetComponents());
        //    DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView tabbedView = new DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(Container.GetComponents());
        //    DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup documentGroup = new DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup(Container.GetComponents());
        //    DevExpress.XtraBars.Docking2010.Views.Tabbed.Document document = new DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(Container.GetComponents());
        //    DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer dockingContainer = new DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer();

        //    ((System.ComponentModel.ISupportInitialize)(documentManager)).BeginInit();
        //    ((System.ComponentModel.ISupportInitialize)(tabbedView)).BeginInit();
        //    ((System.ComponentModel.ISupportInitialize)(documentGroup)).BeginInit();
        //    ((System.ComponentModel.ISupportInitialize)(document)).BeginInit();
        //    this.Container.SuspendLayout();

        //    //TabbedView tabbedView = Container.GetTabbedView();
        //    documentManager.ContainerControl = Container;
        //    documentManager.View = tabbedView;
        //    documentManager.ViewCollection.AddRange(new DevExpress.XtraBars.Docking2010.Views.BaseView[] {tabbedView});

        //    document.Caption = body.DocumentContainer.Title;
        //    document.ControlName = body.DocumentContainer.Name;
        //    document.FloatLocation = new System.Drawing.Point(0, 0);
        //    document.FloatSize = new System.Drawing.Size(200, 200);
        //    document.Properties.AllowClose = DevExpress.Utils.DefaultBoolean.True;
        //    document.Properties.AllowFloat = DevExpress.Utils.DefaultBoolean.True;
        //    document.Properties.AllowFloatOnDoubleClick = DevExpress.Utils.DefaultBoolean.True;

        //    documentGroup.Items.Add(document);



        //    tabbedView.DocumentGrouSF.Add(documentGroup);
        //    tabbedView.Documents.Add(document);
        //    //tabbedView.Orientation = System.Windows.Forms.Orientation.Vertical;
        //    tabbedView.RootContainer.Element = null;
        //    dockingContainer.Element = documentGroup;
        //    tabbedView.RootContainer.Nodes.Add(dockingContainer);
        //    //tabbedView.RootContainer.Orientation = System.Windows.Forms.Orientation.Vertical;

        //    ((System.ComponentModel.ISupportInitialize)(documentManager)).EndInit();
        //    ((System.ComponentModel.ISupportInitialize)(tabbedView)).EndInit();
        //    ((System.ComponentModel.ISupportInitialize)(documentGroup)).EndInit();
        //    ((System.ComponentModel.ISupportInitialize)(document)).EndInit();
        //    this.Container.ResumeLayout();
        //}

        #endregion
        #endregion

        void dockPanel_ClosingPanel(object sender, DockPanelCancelEventArgs e)
        {
            DialogResult dr = FanMessageBox.Question("是否要关闭该面板?如果要恢复该面板,请App.conf中layout_enable_save配置项改成false", "系统提示", MessageBoxButtons.YesNo);

            if (dr == DialogResult.Yes)
            {
            }
            else
            {
                e.Cancel = true;
            }
        }
Ejemplo n.º 6
0
 private void dockManager_Expanding(object sender, DockPanelCancelEventArgs e)
 {/*
   * if (e.Panel == uskDockPanel)
   *     e.Cancel = !Program.MF.EntryCheck("Users.uskDP", true);
   * else if (e.Panel == usiDockPanel)
   *     e.Cancel = !Program.MF.EntryCheck("Users.usiDP", true);
   * else if (e.Panel == usmDockPanel)
   *     e.Cancel = !Program.MF.EntryCheck("Users.usmDP", true);
   * else if (e.Panel == usaDockPanel)
   *     e.Cancel = !Program.MF.EntryCheck("Users.usaDP", true);
   * else if (e.Panel == uspDockPanel)
   *     e.Cancel = !Program.MF.EntryCheck("Users.uspDP", true);*/
 }
 private void DockPanel_ClosingPanel(object sender, DockPanelCancelEventArgs e)
 {
     if (sender != null && sender is DockPanel)
     {
         foreach (KeyValuePair <Control, DockPanel> kvp in DockPanels)
         {
             if (kvp.Value == sender)
             {
                 WorkspaceCancelEventArgs canc = RaiseSmartPartClosing(kvp.Key);
                 e.Cancel = canc.Cancel;
                 break;
             }
         }
     }
     RaiseSmartPartClosing(e);
 }
Ejemplo n.º 8
0
        void OnClosingPanel(object sender, DockPanelCancelEventArgs e)
        {
            DockPanel panel = e.Panel;
            IdentKey  key   = panel.Tag as IdentKey;
            IView     view  = null;

            if (key == null || !_views.TryGetValue(key, out view))
            {
                return;
            }

            if (!view.CanClose || !view.OnClosing(null))
            {
                e.Cancel = true;
            }
            _logger.Debug("OnClosingPanel event. " + view.ToString());
        }
Ejemplo n.º 9
0
 void dockManager_StartDocking(object sender, DockPanelCancelEventArgs e)
 {
     e.Cancel = true;
 }
Ejemplo n.º 10
0
 private void dockManager1_StartDocking(object sender, DockPanelCancelEventArgs e)
 {
     if (e.Panel == this.panelServerList)
     e.Cancel = true;
 }
Ejemplo n.º 11
0
        private void DockManager_ClosingPanel(object sender, DockPanelCancelEventArgs e)
        {
            string id = (e.Panel != null) ? e.Panel.Name : "null";

            LogDockManagerEvent("DockManager_ClosingPanel " + id);
        }
Ejemplo n.º 12
0
 void m_SearchResultPanel_ClosingPanel(object sender, DockPanelCancelEventArgs e)
 {
     m_SearchResultPanel.Visible = false;
     e.Cancel = true;
 }
Ejemplo n.º 13
0
 private void hesapHareketDockManager_ClosingPanel(object sender, DockPanelCancelEventArgs e)
 {
     e.Panel.Dispose();
 }
Ejemplo n.º 14
0
 void dockManager_StartDocking(object sender, DockPanelCancelEventArgs e) {
     e.Cancel = true;
 }