public DialogSetting GetDialogSetting(IdentKey key) { _logger.Debug("GetDialogSetting."); ViewData viewData = GetViewByKey(key); return(viewData.Form.DialogSetting); }
void OnDocumentClosing(object sender, DocumentCancelEventArgs e) { BaseDocument doc = e.Document; IdentKey key = doc.Tag as IdentKey; IView view = null; if (key == null || !_views.TryGetValue(key, out view)) { return; } if (!view.CanClose || !view.OnClosing(null)) { e.Cancel = true; } else if (_documentManager.View.FloatDocuments.IndexOf(doc) == -1) { TabbedView tabbedView = _documentManager.View as TabbedView; //tabbedView.ReleaseDeferredLoadControl(e.Document); e.Cancel = true; doc.Form.Hide(); doc.Form.MdiParent = null; tabbedView.Controller.RemoveDocument(doc); view.OnAfterClose(); _views.Remove(key); } _logger.Debug("OnDocumentClosing event. " + view.ToString()); }
void OnActivePanelChanged(object sender, ActivePanelChangedEventArgs e) { IdentKey key = null; IView view = null; DockPanel panel = e.Panel; if (panel != null) { key = panel.Tag as IdentKey; if (key == null || !_views.TryGetValue(key, out view)) { return; } _logger.Debug("OnActivePanelChanged event. Activate. " + view.ToString()); } panel = e.OldPanel; if (panel != null) { key = panel.Tag as IdentKey; if (key == null || !_views.TryGetValue(key, out view)) { return; } _logger.Debug("OnActivePanelChanged event. Deacivate" + view.ToString()); } }
public IdentKey AddCommand(ICommand view) { IdentKey ident = _barCommandRegion.AddCommand(view, _subMenu.Name); _identKeyCash.Add(ident); return(ident); }
public override IdentKey AddView(IView view, ViewDockingState state, ViewDockingStateFlagExt allowStates) { IdentKey key = base.AddView(view); Control control = view.UserControl as Control; BaseDocument doc = null; try { control.Name = view.Name; //<<>> doc = CreateDocument(control); doc.Image = view.Image; doc.ControlName = view.Name; doc.Caption = view.Caption; doc.Image = view.Image; doc.Tag = key; doc.Properties.AllowFloat = (allowStates & ViewDockingStateFlagExt.Float) == ViewDockingStateFlagExt.Float ? DevExpress.Utils.DefaultBoolean.True : DevExpress.Utils.DefaultBoolean.False; doc.Properties.AllowDock = (allowStates & ViewDockingStateFlagExt.Dock) == ViewDockingStateFlagExt.Dock ? DevExpress.Utils.DefaultBoolean.True : DevExpress.Utils.DefaultBoolean.False; doc.Properties.AllowClose = (allowStates & ViewDockingStateFlagExt.Close) == ViewDockingStateFlagExt.Close ? DevExpress.Utils.DefaultBoolean.True : DevExpress.Utils.DefaultBoolean.False; doc.Properties.AllowActivate = (allowStates & ViewDockingStateFlagExt.Activate) == ViewDockingStateFlagExt.Activate ? DevExpress.Utils.DefaultBoolean.True : DevExpress.Utils.DefaultBoolean.False; _views.Add(key, view); return(key); } catch (Exception ex) { ClearDocumentResource(key, view); throw ex; } }
public IdentKey AddCommand(ICommand view) { IdentKey ident = _barCommandRegion.AddCommand(view); AddToCash(view, ident); return(ident); }
private void ShowNoModalItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { IView view = CreateView(); _key = _dialogMgr.ShowNoModal(view, DialogFormOption.ShowMinimizeButton); _dict.Add(_key, view); }
public bool IsActiveNoModal(IdentKey key) { _logger.Debug("IsActiveNoModal."); ViewData viewData = GetViewByKey(key); return(viewData.IsActive); }
void OnFormClosing(object sender, FormClosingEventArgs e) { _logger.Debug("OnFormClosing"); if (e.CloseReason != CloseReason.UserClosing && e.CloseReason != CloseReason.None) { return; } ViewData viewData = null; try { IdentKey key = GetKeyOfFormBase(sender); viewData = GetViewByKey(key); viewData.DialogResult = viewData.Form.DialogResult; if ((viewData.DialogResult != DialogResult.Cancel && viewData.DialogResult != DialogResult.None && !viewData.View.CanClose) || !viewData.View.OnClosing(ConvertDialogResultToNBool(viewData.DialogResult))) { viewData.Form.DialogResult = DialogResult.None; e.Cancel = true; } } catch (Exception ex) { _logger.Error(ex); viewData.Form.DialogResult = DialogResult.None; e.Cancel = true; } }
private void AddToCash(ICommand view, IdentKey key) { if (view.CommandType == CommandType.Group) { _parentItemNameCash.Add(view.Name); } _identKeyCash.Add(key); }
public IdentKey AddCommand(ICommand view, string parentItem) { IsBelongToMainMenu(parentItem); IdentKey ident = _barCommandRegion.AddCommand(view, parentItem); AddToCash(view, ident); return(ident); }
public EntityBase(string name) { _key = new IdentKey(); _cloneKey = _key; _id = _defaultId; _iPersisit = false; _internalName = string.Format("{0}_{1}", name, _key.ToString()); }
public void RemoveButton(IdentKey key) { BarButtonItem button = GetButtonByKey(key); button.ItemClick -= new ItemClickEventHandler(button_ItemClick); _barManager.Items.Remove(button); _ButtonItems.Remove(key); }
public override void ActivateView(IdentKey key) { base.ActivateView(key); BaseDocument document = null; document = GetDocumentByIdentKey(key); _documentManager.View.ActivateDocument(document.Control); }
void OnLocationChanged(object sender, EventArgs e) { FormBase form = sender as FormBase; IdentKey key = form.Tag as IdentKey; ViewData viewData = GetViewByKey(key); viewData.View.DialogSetting = form.DialogSetting; }
void OnStatusBarButtonClick(IdentKey key, bool isActivate) { ViewData viewData = GetViewByKey(key); viewData.IsActive = isActivate; ChangeFormState(viewData, isActivate); viewData.View.OnActivate(isActivate); }
public IdentKey AddCommand(ICommand view, string parentItem) { IsBelongToSubItem(parentItem); IdentKey ident = _barCommandRegion.AddCommand(view, parentItem); _identKeyCash.Add(ident); return(ident); }
private void simpleButton2_Click_1(object sender, EventArgs e) { ICommand command = new Command("testcommand2", () => { }, IsEnable, "NewMenu", null, null, "1", null, Core.SDK.Composite.UI.CommandType.Group); _key2 = _regionMgr.GetCommandRegion(Core.SDK.Composite.UI.CommonRegionName.MainMenu).AddCommand(command); command = new Command("testcommand2_1", () => { MessageBox.Show("test2_1"); }, IsEnable, "NewMenuItem", null, null, "1_1", null, Core.SDK.Composite.UI.CommandType.CheckButton); _key3 = _regionMgr.GetCommandRegion(Core.SDK.Composite.UI.CommonRegionName.MainMenu).AddCommand(command, "NewMenu"); }
private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (_key2 == null) { return; } _regionMgr.GetViewRegion("DockingRegion").RemoveView(_key2); _key2 = null; }
public override void ActivateView(IdentKey key) { base.ActivateView(key); DockPanel panel = GetPanelByIdentKey(key); if (panel == null) { throw new InvalidOperationException("View's panel with such key is not find."); } _dockManager.ActivePanel = panel; }
public IdentKey ShowNoModal(IView view, DialogFormOption options, DialogSetting settings) { _logger.Debug("ShowNoModal."); IdentKey key = CreateViewForm(view, options, settings); ViewData viewData = GetViewByKey(key); viewData.IsModal = false; viewData.Form.Show(_parentForm); viewData.Form.Focus(); return(key); }
public void RefreshCommand(IdentKey key) { if (_identKeyCash.IndexOf(key) != -1) { _barCommandRegion.RefreshCommand(key); } else { throw new InvalidOperationException("Command with such key is not found."); } }
public void CloseNoModal(IdentKey key) { _logger.Debug("CloseNoModal."); ViewData viewData = GetViewByKey(key); if (viewData.IsClose == true) { throw new InvalidOperationException("View already close."); } viewData.Form.Close(); }
void OnSizeChanged(object sender, EventArgs e) { IdentKey key = GetKeyOfFormBase(sender); ViewData viewData = GetViewByKey(key); FormBase form = sender as FormBase; if ((viewData.Form.DialogFormOption & DialogFormOption.ShowInOSTaskBar) == 0 && viewData.Form.WindowState == FormWindowState.Minimized && !viewData.IsModal) { viewData.Form.Hide(); } viewData.View.DialogSetting = form.DialogSetting; }
private void OnChangeState(IdentKey key, bool isActivate) { ViewData viewData = GetViewByKey(key); viewData.IsActive = isActivate; if (viewData.Form.WindowState != FormWindowState.Minimized) { viewData.FormWindowState = viewData.Form.WindowState; } _statusBarButtonController.ChangeButtonState(key, isActivate); viewData.View.OnActivate(isActivate); }
private DockPanel GetPanelByIdentKey(IdentKey key) { foreach (DockPanel panel in _dockManager.Panels) { IdentKey panelKey = panel.Tag as IdentKey; if (key != null && panelKey == key) { return(panel); } } return(null); }
void OnEndDocking(object sender, EndDockingEventArgs e) { DockPanel panel = e.Panel; IdentKey key = panel.Tag as IdentKey; IView view = null; if (key == null || !_views.TryGetValue(key, out view)) { return; } _logger.Debug("OnEndDocking event. " + view.ToString()); }
void OnEndDocking(object sender, DocumentEventArgs e) { BaseDocument doc = e.Document; IdentKey key = doc.Tag as IdentKey; IView view = null; if (key == null || !_views.TryGetValue(key, out view)) { return; } _logger.Debug("OnEndDocking event. " + view.ToString()); }
public DialogResult ShowModal(IView view, DialogFormOption options, DialogSetting settings) { _logger.Debug("ShowModal."); IdentKey key = null; ViewData viewData = null; key = CreateViewForm(view, options, settings); viewData = GetViewByKey(key); viewData.Form.ShowInTaskbar = false; // Hack: ShowDialog и ShowInTaskbar = true не работают вместе viewData.IsModal = true; viewData.Form.ShowDialog(_parentForm); return(viewData.DialogResult); }
void OnDocumentDeactivated(object sender, DocumentEventArgs e) { BaseDocument activeDoc = e.Document; IView view = null; IdentKey key = activeDoc.Tag as IdentKey; if (key != null && _views.TryGetValue(key, out view)) { view.OnActivate(false); _logger.Debug("OnDocumentDeactivated event. " + view.ToString()); } }