Esempio n. 1
0
        public void CommonItemActivation(object sender, EventArgs eventArgs)
        {
            var o = Tree.SelectedObject;

            if (o == null)
            {
                return;
            }

            if (UserSettings.DoubleClickToExpand)
            {
                if (Tree.CanExpand(o) && !Tree.IsExpanded(o))
                {
                    Tree.Expand(o);
                    return;
                }
                if (Tree.IsExpanded(o))
                {
                    Tree.Collapse(o);
                    return;
                }
            }

            var cmd = new ExecuteCommandActivate(_activator, o);

            if (!cmd.IsImpossible)
            {
                cmd.Execute();
            }
        }
Esempio n. 2
0
        public void SetupEditAnything(object sender, IMapsDirectlyToDatabaseTable o)
        {
            _windowManager.CloseAllToolboxes();
            _windowManager.CloseAllWindows();

            if (o is LoadMetadata lmd)
            {
                SetupEditLoadMetadata(sender, lmd);
            }
            else
            {
                _activator.RequestItemEmphasis(this, new EmphasiseRequest(o, int.MaxValue));

                var activate = new ExecuteCommandActivate(_activator, o);

                //activate it if possible
                if (!activate.IsImpossible)
                {
                    activate.Execute();
                }
                else
                {
                    _activator.RequestItemEmphasis(this, new EmphasiseRequest(o, 1)); //otherwise just show it
                }
            }
        }
Esempio n. 3
0
        public override void Activate(DatabaseEntity o)
        {
            var cmd = new ExecuteCommandActivate(this, o);

            if (!cmd.IsImpossible)
            {
                cmd.Execute();
            }
        }
Esempio n. 4
0
        private void olvAvailable_ItemActivate(object sender, EventArgs e)
        {
            var cmd = new ExecuteCommandActivate(Activator, olvAvailable.SelectedObject);

            if (!cmd.IsImpossible)
            {
                cmd.Execute();
            }
        }
Esempio n. 5
0
        private void tlvAllObjects_ItemActivate(object sender, EventArgs e)
        {
            var node = olvAllObjects.SelectedObject as FindAndReplaceNode;

            if (node != null)
            {
                var cmd = new ExecuteCommandActivate(Activator, node.Instance);
                if (!cmd.IsImpossible)
                {
                    cmd.Execute();
                }
            }
        }
Esempio n. 6
0
        private void AddNewDashboard()
        {
            var dialog = new TypeTextOrCancelDialog("Dashboard Name", "Name", 100, null, false);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var dash = new DashboardLayout(_manager.RepositoryLocator.CatalogueRepository, dialog.ResultText);

                var cmd = new ExecuteCommandActivate(_manager.ActivateItems, dash);
                cmd.Execute();

                ReCreateDropDowns();
            }
        }
Esempio n. 7
0
        public void SetupEditAnything(object sender, IMapsDirectlyToDatabaseTable o)
        {
            _activator.RequestItemEmphasis(this, new EmphasiseRequest(o, int.MaxValue));

            var activate = new ExecuteCommandActivate(_activator, o);

            //activate it if possible
            if (!activate.IsImpossible)
            {
                activate.Execute();
            }
            else
            {
                _activator.RequestItemEmphasis(this, new EmphasiseRequest(o, 1)); //otherwise just show it
            }
        }
Esempio n. 8
0
        private void AddNewLayout()
        {
            string xml = _manager.MainForm.GetCurrentLayoutXml();

            var dialog = new TypeTextOrCancelDialog("Layout Name", "Name", 100, null, false);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var layout = new WindowLayout(_manager.RepositoryLocator.CatalogueRepository, dialog.ResultText, xml);

                var cmd = new ExecuteCommandActivate(_manager.ActivateItems, layout);
                cmd.Execute();

                ReCreateDropDowns();
            }
        }
Esempio n. 9
0
        public void CommonItemActivation(object sender, EventArgs eventArgs)
        {
            var o = Tree.SelectedObject;

            if (o == null)
            {
                return;
            }

            var cmd = new ExecuteCommandActivate(_activator, o);

            if (!cmd.IsImpossible)
            {
                cmd.Execute();
            }
        }
Esempio n. 10
0
        private void cbx_DropDownClosed(object sender, EventArgs e)
        {
            var cbx    = (ToolStripComboBox)sender;
            var toOpen = cbx.SelectedItem as INamed;

            if (ReferenceEquals(cbx.SelectedItem, CreateNewLayout))
            {
                AddNewLayout();
            }

            if (toOpen != null)
            {
                var cmd = new ExecuteCommandActivate(_manager.ActivateItems, toOpen);
                cmd.Execute();
            }

            UpdateButtonEnabledness();
        }
Esempio n. 11
0
        private void Open(IMapsDirectlyToDatabaseTable o)
        {
            if (!((DatabaseEntity)o).Exists())
            {
                if (_activator.YesNo($"'{o}' no longer exists, remove from Recent list?", "No longer exists"))
                {
                    _activator.HistoryProvider.Remove(o);
                    RefreshHistory();
                }

                return;
            }

            var cmd = new ExecuteCommandActivate(_activator, o)
            {
                AlsoShow = true
            };

            cmd.Execute();
        }
Esempio n. 12
0
        protected void Activate(DatabaseEntity o)
        {
            var cmd = new ExecuteCommandActivate(_activator, o);

            cmd.Execute();
        }