예제 #1
0
        public PanelManagerDesigner()
        {
            DesignerVerb verb1 = new DesignerVerb("Add MangedPanel", OnAddPanel);
            DesignerVerb verb2 = new DesignerVerb("Remove ManagedPanel", OnRemovePanel);

            m_verbs.AddRange(new[] { verb1, verb2 });
        }
        private void UpdateVerbStatus()
        {
            // Create verbs first time around
            if (_verbs == null)
            {
                _verbs             = new DesignerVerbCollection();
                _toggleHelpersVerb = new DesignerVerb("Toggle Helpers", new EventHandler(OnToggleHelpers));
                _moveFirstVerb     = new DesignerVerb("Move TextBox First", new EventHandler(OnMoveFirst));
                _movePrevVerb      = new DesignerVerb("Move TextBox Previous", new EventHandler(OnMovePrevious));
                _moveNextVerb      = new DesignerVerb("Move TextBox Next", new EventHandler(OnMoveNext));
                _moveLastVerb      = new DesignerVerb("Move TextBox Last", new EventHandler(OnMoveLast));
                _deleteTextBoxVerb = new DesignerVerb("Delete TextBox", new EventHandler(OnDeleteTextBox));
                _verbs.AddRange(new DesignerVerb[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb,
                                                     _moveNextVerb, _moveLastVerb, _deleteTextBoxVerb });
            }

            bool moveFirst = false;
            bool movePrev  = false;
            bool moveNext  = false;
            bool moveLast  = false;

            if ((_ribbonMaskedTextBox != null) && (_ribbonMaskedTextBox.Ribbon != null))
            {
                TypedRestrictCollection <KryptonRibbonGroupItem> items = ParentItems;
                moveFirst = (items.IndexOf(_ribbonMaskedTextBox) > 0);
                movePrev  = (items.IndexOf(_ribbonMaskedTextBox) > 0);
                moveNext  = (items.IndexOf(_ribbonMaskedTextBox) < (items.Count - 1));
                moveLast  = (items.IndexOf(_ribbonMaskedTextBox) < (items.Count - 1));
            }

            _moveFirstVerb.Enabled = moveFirst;
            _movePrevVerb.Enabled  = movePrev;
            _moveNextVerb.Enabled  = moveNext;
            _moveLastVerb.Enabled  = moveLast;
        }
예제 #3
0
        private void UpdateVerbStatus()
        {
            // Create verbs first time around
            if (_verbs == null)
            {
                _verbs             = new DesignerVerbCollection();
                _toggleHelpersVerb = new DesignerVerb("Toggle Helpers", OnToggleHelpers);
                _moveFirstVerb     = new DesignerVerb("Move Button First", OnMoveFirst);
                _movePrevVerb      = new DesignerVerb("Move Button Previous", OnMovePrevious);
                _moveNextVerb      = new DesignerVerb("Move Button Next", OnMoveNext);
                _moveLastVerb      = new DesignerVerb("Move Button Last", OnMoveLast);
                _deleteButtonVerb  = new DesignerVerb("Delete Button", OnDeleteButton);
                _verbs.AddRange(new DesignerVerb[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb,
                                                     _moveNextVerb, _moveLastVerb, _deleteButtonVerb });
            }

            bool moveFirst = false;
            bool movePrev  = false;
            bool moveNext  = false;
            bool moveLast  = false;

            if (_ribbonButton?.Ribbon != null)
            {
                TypedRestrictCollection <KryptonRibbonGroupItem> items = ParentItems;
                moveFirst = (items.IndexOf(_ribbonButton) > 0);
                movePrev  = (items.IndexOf(_ribbonButton) > 0);
                moveNext  = (items.IndexOf(_ribbonButton) < (items.Count - 1));
                moveLast  = (items.IndexOf(_ribbonButton) < (items.Count - 1));
            }

            _moveFirstVerb.Enabled = moveFirst;
            _movePrevVerb.Enabled  = movePrev;
            _moveNextVerb.Enabled  = moveNext;
            _moveLastVerb.Enabled  = moveLast;
        }
예제 #4
0
        public override void Initialize(IComponent theComponent)
        {
            base.Initialize(theComponent); // IMPORTANT! This must be the very first line

            // ISelectionService events
            var aSrv_Sel = (ISelectionService)GetService(typeof(ISelectionService));

            if (aSrv_Sel != null)
            {
                aSrv_Sel.SelectionChanged += Handler_SelectionChanged;
            }

            // IComponentChangeService events
            var aSrv_CH = (IComponentChangeService)GetService(typeof(IComponentChangeService));

            if (aSrv_CH != null)
            {
                aSrv_CH.ComponentRemoving += Handler_ComponentRemoving;
                aSrv_CH.ComponentChanged  += Handler_ComponentChanged;
            }

            // MultiPaneControl events
            DesignedControl.SelectedPageChanged += Handler_SelectedPageChanged;

            // Prepare the verbs
            myAddVerb    = new DesignerVerb("Add page", Handler_AddPage);
            myRemoveVerb = new DesignerVerb("Remove page", Handler_RemovePage);
            mySwitchVerb = new DesignerVerb("Switch pages...", Handler_SwitchPage);

            myVerbs = new DesignerVerbCollection();
            myVerbs.AddRange(new[] { myAddVerb, myRemoveVerb, mySwitchVerb });
        }
        public TankDesigner()
        {
            var verb1 = new DesignerVerb("property", OpenProperty);

            designerVerbs.AddRange(new[] { verb1 });
            this.designerActionUISvc = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;
        }
예제 #6
0
        public PanelManagerDesigner() : base()
        {
            DesignerVerb verb1 = new DesignerVerb("ページの추가", new EventHandler(OnAddPanel));
            DesignerVerb verb2 = new DesignerVerb("ページの삭제", new EventHandler(OnRemovePanel));

            m_verbs.AddRange(new DesignerVerb[] { verb1, verb2 });
        }
예제 #7
0
        private void UpdateVerbStatus()
        {
            // Create verbs first time around
            if (_verbs == null)
            {
                _verbs                 = new DesignerVerbCollection();
                _toggleHelpersVerb     = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
                _moveFirstVerb         = new DesignerVerb(@"Move RadioButton First", OnMoveFirst);
                _movePrevVerb          = new DesignerVerb(@"Move RadioButton Previous", OnMovePrevious);
                _moveNextVerb          = new DesignerVerb(@"Move RadioButton Next", OnMoveNext);
                _moveLastVerb          = new DesignerVerb(@"Move RadioButton Last", OnMoveLast);
                _deleteRadioButtonVerb = new DesignerVerb(@"Delete RadioButton", OnDeleteRadioButton);
                _verbs.AddRange(new[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb,
                                        _moveNextVerb, _moveLastVerb, _deleteRadioButtonVerb });
            }

            var moveFirst = false;
            var movePrev  = false;
            var moveNext  = false;
            var moveLast  = false;

            if (_ribbonRadioButton?.Ribbon != null)
            {
                var items = ParentItems;
                moveFirst = items.IndexOf(_ribbonRadioButton) > 0;
                movePrev  = items.IndexOf(_ribbonRadioButton) > 0;
                moveNext  = items.IndexOf(_ribbonRadioButton) < (items.Count - 1);
                moveLast  = items.IndexOf(_ribbonRadioButton) < (items.Count - 1);
            }

            _moveFirstVerb.Enabled = moveFirst;
            _movePrevVerb.Enabled  = movePrev;
            _moveNextVerb.Enabled  = moveNext;
            _moveLastVerb.Enabled  = moveLast;
        }
예제 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PastezDesigner" /> class.
        /// </summary>
        public PastezDesigner() : base()
        {
            DesignerVerb verb1 = new DesignerVerb("Add Tab", new EventHandler(OnAddPage));
            DesignerVerb verb2 = new DesignerVerb("Remove Tab", new EventHandler(OnRemovePage));

            m_verbs.AddRange(new DesignerVerb[] { verb1, verb2 });
        }
예제 #9
0
        public MTabControlDesigner()
        {
            var verb1 = new DesignerVerb("添加选项卡", OnAddPage);
            var verb2 = new DesignerVerb("移除选项卡", OnRemovePage);

            _verbs.AddRange(new[] { verb1, verb2 });
        }
예제 #10
0
        public MetroTabControlDesigner()
        {
            var verb1 = new DesignerVerb("Add Tab", OnAddPage);
            var verb2 = new DesignerVerb("Remove Tab", OnRemovePage);

            designerVerbs.AddRange(new[] { verb1, verb2 });
        }
예제 #11
0
        /// <summary>
        /// The default constructor.
        /// </summary>
        public VerticalTabControlDesigner()
            : base()
        {
            DesignerVerb dvbAddPage    = new DesignerVerb("Add Tab Page", new EventHandler(AddTabPage));
            DesignerVerb dvbRemovePage = new DesignerVerb("Remove Tab Page", new EventHandler(RemoveTabPage));

            m_dvcVerbs.AddRange(new DesignerVerb[] { dvbAddPage, dvbRemovePage });
        }
        public EbTabControlDesigner() : base()
        {
            DesignerVerb verb1 = new DesignerVerb("Add Tab", new EventHandler(OnAddPage));
            DesignerVerb verb2 = new DesignerVerb("Insert Tab", new EventHandler(OnInsertPage));
            DesignerVerb verb3 = new DesignerVerb("Remove Tab", new EventHandler(OnRemovePage));

            m_verbs.AddRange(new DesignerVerb[] { verb1, verb2, verb3 });
        }
        public VisualTabControlDesigner()
        {
            DesignerVerb verb1 = new DesignerVerb("Add Tab", OnAddPage);
            DesignerVerb verb2 = new DesignerVerb("Insert Tab", OnInsertPage);
            DesignerVerb verb3 = new DesignerVerb("Remove Tab", OnRemovePage);

            _designerVerbCollection = new DesignerVerbCollection();
            _designerVerbCollection.AddRange(new[] { verb1, verb2, verb3 });
        }
예제 #14
0
        /// <summary>
        ///   The default constructor.
        /// </summary>
        public VerticalTabControlDesigner()
        {
            var dvbAddPage    = new DesignerVerb("Add Tab Page", AddTabPage);
            var dvbRemovePage = new DesignerVerb("Remove Tab Page", RemoveTabPage);

            m_dvcVerbs.AddRange(new[]
            {
                dvbAddPage, dvbRemovePage
            });
        }
        public void AddRange_DesignerVerbCollection_Success()
        {
            var value      = new DesignerVerb[] { new DesignerVerb("Text", null), new DesignerVerb("Text", null) };
            var collection = new DesignerVerbCollection();

            collection.AddRange(new DesignerVerbCollection(value));

            Assert.Equal(2, collection.Count);
            Assert.Equal(value, collection.Cast <DesignerVerb>());
        }
        public void AddRange_ThisDesignerVerbCollection_Success()
        {
            var value      = new DesignerVerb[] { new DesignerVerb("Text", null), new DesignerVerb("Text", null) };
            var collection = new DesignerVerbCollection(value);

            collection.AddRange(collection);

            Assert.Equal(4, collection.Count);
            Assert.Equal(value.Concat(value), collection.Cast <DesignerVerb>());
        }
예제 #17
0
            /// <summary>
            /// Creates the designer verbs.
            /// </summary>
            private void CreateVerbs()
            {
                navigateBackVerb = new DesignerVerb("Previous page", new EventHandler(NavigateBackHandler));
                navigateNextVerb = new DesignerVerb("Next page", new EventHandler(NavigateNextHandler));
                addPageVerb      = new DesignerVerb("Add page", new EventHandler(AddPageHandler));
                removePageVerb   = new DesignerVerb("Remove page", new EventHandler(RemovePageHandler));

                verbs = new DesignerVerbCollection();
                verbs.AddRange(new DesignerVerb[] {
                    navigateBackVerb, navigateNextVerb, addPageVerb, removePageVerb
                });
            }
예제 #18
0
        public PoisonTabControlDesigner()
        {
            DesignerVerb verb1 = new DesignerVerb("Add Tab", OnAddPage);
            DesignerVerb verb2 = new DesignerVerb("Remove Tab", OnRemovePage);

            designerVerbs.AddRange
            (
                new[]
            {
                verb1,
                verb2
            }
            );
        }
예제 #19
0
        private void UpdateVerbStatus()
        {
            // Create verbs first time around
            if (_verbs == null)
            {
                _verbs             = new DesignerVerbCollection();
                _toggleHelpersVerb = new DesignerVerb("Toggle Helpers", new EventHandler(OnToggleHelpers));
                _moveFirstVerb     = new DesignerVerb("Move Group First", new EventHandler(OnMoveFirst));
                _movePrevVerb      = new DesignerVerb("Move Group Previous", new EventHandler(OnMovePrevious));
                _moveNextVerb      = new DesignerVerb("Move Group Next", new EventHandler(OnMoveNext));
                _moveLastVerb      = new DesignerVerb("Move Group Last", new EventHandler(OnMoveLast));
                _addTripleVerb     = new DesignerVerb("Add Triple", new EventHandler(OnAddTriple));
                _addLinesVerb      = new DesignerVerb("Add Lines", new EventHandler(OnAddLines));
                _addSepVerb        = new DesignerVerb("Add Separator", new EventHandler(OnAddSep));
                _addGalleryVerb    = new DesignerVerb("Add Gallery", new EventHandler(OnAddGallery));
                _clearItemsVerb    = new DesignerVerb("Clear Items", new EventHandler(OnClearItems));
                _deleteGroupVerb   = new DesignerVerb("Delete Group", new EventHandler(OnDeleteGroup));
                _verbs.AddRange(new DesignerVerb[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb, _moveNextVerb, _moveLastVerb,
                                                     _addTripleVerb, _addLinesVerb, _addSepVerb, _addGalleryVerb, _clearItemsVerb, _deleteGroupVerb });
            }

            bool moveFirst  = false;
            bool movePrev   = false;
            bool moveNext   = false;
            bool moveLast   = false;
            bool clearItems = false;

            if ((_ribbonGroup != null) &&
                (_ribbonGroup.Ribbon != null) &&
                _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup))
            {
                moveFirst  = (_ribbonGroup.RibbonTab.Groups.IndexOf(_ribbonGroup) > 0);
                movePrev   = (_ribbonGroup.RibbonTab.Groups.IndexOf(_ribbonGroup) > 0);
                moveNext   = (_ribbonGroup.RibbonTab.Groups.IndexOf(_ribbonGroup) < (_ribbonGroup.RibbonTab.Groups.Count - 1));
                moveLast   = (_ribbonGroup.RibbonTab.Groups.IndexOf(_ribbonGroup) < (_ribbonGroup.RibbonTab.Groups.Count - 1));
                clearItems = (_ribbonGroup.Items.Count > 0);
            }

            _moveFirstVerb.Enabled  = moveFirst;
            _movePrevVerb.Enabled   = movePrev;
            _moveNextVerb.Enabled   = moveNext;
            _moveLastVerb.Enabled   = moveLast;
            _clearItemsVerb.Enabled = clearItems;
        }
예제 #20
0
        private void UpdateVerbStatus()
        {
            // Create verbs first time around
            if (_verbs == null)
            {
                _verbs              = new DesignerVerbCollection();
                _toggleHelpersVerb  = new DesignerVerb("Toggle Helpers", OnToggleHelpers);
                _moveFirstVerb      = new DesignerVerb("Move Cluster First", OnMoveFirst);
                _movePrevVerb       = new DesignerVerb("Move Cluster Previous", OnMovePrevious);
                _moveNextVerb       = new DesignerVerb("Move Cluster Next", OnMoveNext);
                _moveLastVerb       = new DesignerVerb("Move Cluster Last", OnMoveLast);
                _addButtonVerb      = new DesignerVerb("Add Button", OnAddButton);
                _addColorButtonVerb = new DesignerVerb("Add Color Button", OnAddColorButton);
                _clearItemsVerb     = new DesignerVerb("Clear Items", OnClearItems);
                _deleteClusterVerb  = new DesignerVerb("Delete Cluster", OnDeleteCluster);
                _verbs.AddRange(new DesignerVerb[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb, _moveNextVerb, _moveLastVerb,
                                                     _addButtonVerb, _addColorButtonVerb, _clearItemsVerb, _deleteClusterVerb });
            }

            bool moveFirst  = false;
            bool movePrev   = false;
            bool moveNext   = false;
            bool moveLast   = false;
            bool clearItems = false;

            if (_ribbonCluster?.Ribbon != null)
            {
                // Cast container to the correct type
                KryptonRibbonGroupLines lines = (KryptonRibbonGroupLines)_ribbonCluster.RibbonContainer;

                moveFirst  = (lines.Items.IndexOf(_ribbonCluster) > 0);
                movePrev   = (lines.Items.IndexOf(_ribbonCluster) > 0);
                moveNext   = (lines.Items.IndexOf(_ribbonCluster) < (lines.Items.Count - 1));
                moveLast   = (lines.Items.IndexOf(_ribbonCluster) < (lines.Items.Count - 1));
                clearItems = (_ribbonCluster.Items.Count > 0);
            }

            _moveFirstVerb.Enabled  = moveFirst;
            _movePrevVerb.Enabled   = movePrev;
            _moveNextVerb.Enabled   = moveNext;
            _moveLastVerb.Enabled   = moveLast;
            _clearItemsVerb.Enabled = clearItems;
        }
예제 #21
0
        private void UpdateVerbStatus()
        {
            // Create verbs first time around
            if (_verbs == null)
            {
                _verbs             = new DesignerVerbCollection();
                _toggleHelpersVerb = new DesignerVerb("Toggle Helpers", new EventHandler(OnToggleHelpers));
                _moveFirstVerb     = new DesignerVerb("Move First", new EventHandler(OnMoveFirst));
                _movePrevVerb      = new DesignerVerb("Move Previous", new EventHandler(OnMovePrevious));
                _moveNextVerb      = new DesignerVerb("Move Next", new EventHandler(OnMoveNext));
                _moveLastVerb      = new DesignerVerb("Move Last", new EventHandler(OnMoveLast));
                _addGroupVerb      = new DesignerVerb("Add Group", new EventHandler(OnAddGroup));
                _clearGroupsVerb   = new DesignerVerb("Clear Groups", new EventHandler(OnClearGroups));
                _deleteTabVerb     = new DesignerVerb("Delete Tab", new EventHandler(OnDeleteTab));
                _verbs.AddRange(new DesignerVerb[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb, _moveNextVerb, _moveLastVerb, _addGroupVerb, _clearGroupsVerb, _deleteTabVerb });
            }

            bool moveFirst   = false;
            bool movePrev    = false;
            bool moveNext    = false;
            bool moveLast    = false;
            bool clearGroups = false;

            if ((_ribbonTab != null) &&
                (_ribbonTab.Ribbon != null) &&
                _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
            {
                moveFirst   = (_ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) > 0);
                movePrev    = (_ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) > 0);
                moveNext    = (_ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) < (_ribbonTab.Ribbon.RibbonTabs.Count - 1));
                moveLast    = (_ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) < (_ribbonTab.Ribbon.RibbonTabs.Count - 1));
                clearGroups = (_ribbonTab.Groups.Count > 0);
            }

            _moveFirstVerb.Enabled   = moveFirst;
            _movePrevVerb.Enabled    = movePrev;
            _moveNextVerb.Enabled    = moveNext;
            _moveLastVerb.Enabled    = moveLast;
            _clearGroupsVerb.Enabled = clearGroups;
        }
예제 #22
0
        private void UpdateVerbStatus()
        {
            // Create verbs first time around
            if (_verbs == null)
            {
                _verbs               = new DesignerVerbCollection();
                _toggleHelpersVerb   = new DesignerVerb("Toggle Helpers", new EventHandler(OnToggleHelpers));
                _moveFirstVerb       = new DesignerVerb("Move Separator First", new EventHandler(OnMoveFirst));
                _movePrevVerb        = new DesignerVerb("Move Separator Previous", new EventHandler(OnMovePrevious));
                _moveNextVerb        = new DesignerVerb("Move Separator Next", new EventHandler(OnMoveNext));
                _moveLastVerb        = new DesignerVerb("Move Separator Last", new EventHandler(OnMoveLast));
                _deleteSeparatorVerb = new DesignerVerb("Delete Separator", new EventHandler(OnDeleteSeparator));
                _verbs.AddRange(new DesignerVerb[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb,
                                                     _moveNextVerb, _moveLastVerb, _deleteSeparatorVerb });
            }

            if (_verbs != null)
            {
                bool moveFirst = false;
                bool movePrev  = false;
                bool moveNext  = false;
                bool moveLast  = false;

                if ((_ribbonSeparator != null) &&
                    (_ribbonSeparator.Ribbon != null) &&
                    _ribbonSeparator.RibbonGroup.Items.Contains(_ribbonSeparator))
                {
                    moveFirst = (_ribbonSeparator.RibbonGroup.Items.IndexOf(_ribbonSeparator) > 0);
                    movePrev  = (_ribbonSeparator.RibbonGroup.Items.IndexOf(_ribbonSeparator) > 0);
                    moveNext  = (_ribbonSeparator.RibbonGroup.Items.IndexOf(_ribbonSeparator) < (_ribbonSeparator.RibbonGroup.Items.Count - 1));
                    moveLast  = (_ribbonSeparator.RibbonGroup.Items.IndexOf(_ribbonSeparator) < (_ribbonSeparator.RibbonGroup.Items.Count - 1));
                }

                _moveFirstVerb.Enabled = moveFirst;
                _movePrevVerb.Enabled  = movePrev;
                _moveNextVerb.Enabled  = moveNext;
                _moveLastVerb.Enabled  = moveLast;
            }
        }
        private void UpdateVerbStatus()
        {
            // Create verbs first time around
            if (_verbs == null)
            {
                _verbs             = new DesignerVerbCollection();
                _toggleHelpersVerb = new DesignerVerb(@"Toggle Helpers", OnToggleHelpers);
                _moveFirstVerb     = new DesignerVerb(@"Move First", OnMoveFirst);
                _movePrevVerb      = new DesignerVerb(@"Move Previous", OnMovePrevious);
                _moveNextVerb      = new DesignerVerb(@"Move Next", OnMoveNext);
                _moveLastVerb      = new DesignerVerb(@"Move Last", OnMoveLast);
                _addGroupVerb      = new DesignerVerb(@"Add Group", OnAddGroup);
                _clearGroupsVerb   = new DesignerVerb(@"Clear Groups", OnClearGroups);
                _deleteTabVerb     = new DesignerVerb(@"Delete Tab", OnDeleteTab);
                _verbs.AddRange(new[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb, _moveNextVerb, _moveLastVerb, _addGroupVerb, _clearGroupsVerb, _deleteTabVerb });
            }

            var moveFirst   = false;
            var movePrev    = false;
            var moveNext    = false;
            var moveLast    = false;
            var clearGroups = false;

            if ((_ribbonTab?.Ribbon != null) && _ribbonTab.Ribbon.RibbonTabs.Contains(_ribbonTab))
            {
                moveFirst   = _ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) > 0;
                movePrev    = _ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) > 0;
                moveNext    = _ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) < (_ribbonTab.Ribbon.RibbonTabs.Count - 1);
                moveLast    = _ribbonTab.Ribbon.RibbonTabs.IndexOf(_ribbonTab) < (_ribbonTab.Ribbon.RibbonTabs.Count - 1);
                clearGroups = _ribbonTab.Groups.Count > 0;
            }

            _moveFirstVerb.Enabled   = moveFirst;
            _movePrevVerb.Enabled    = movePrev;
            _moveNextVerb.Enabled    = moveNext;
            _moveLastVerb.Enabled    = moveLast;
            _clearGroupsVerb.Enabled = clearGroups;
        }
예제 #24
0
        public override void Initialize(IComponent theComponent)
        {
            base.Initialize(theComponent);
            ISelectionService aSrv_Sel = (ISelectionService)GetService(typeof(ISelectionService));

            if (aSrv_Sel != null)
            {
                aSrv_Sel.SelectionChanged += new EventHandler(Handler_SelectionChanged);
            }
            IComponentChangeService aSrv_CH = (IComponentChangeService)GetService(typeof(IComponentChangeService));

            if (aSrv_CH != null)
            {
                aSrv_CH.ComponentRemoving += new ComponentEventHandler(Handler_ComponentRemoving);
                aSrv_CH.ComponentChanged  += new ComponentChangedEventHandler(Handler_ComponentChanged);
            }
            DesignedControl.SelectedPageChanged += new EventHandler(Handler_SelectedPageChanged);
            addVerb    = new DesignerVerb("ÇÝÒæÏä ÕÝÍå", new EventHandler(Handler_AddPage));
            removeVerb = new DesignerVerb("ÍÐÝ ÕÝÍå", new EventHandler(Handler_RemovePage));
            switchVerb = new DesignerVerb("ÇäÊÎÇÈ ÕÝÍå...", new EventHandler(Handler_SwitchPage));
            verbs      = new DesignerVerbCollection();
            verbs.AddRange(new DesignerVerb[] { addVerb, removeVerb, switchVerb });
        }
        private void UpdateVerbStatus()
        {
            // Create verbs first time around
            if (_verbs == null)
            {
                _verbs             = new DesignerVerbCollection();
                _toggleHelpersVerb = new DesignerVerb("Toggle Helpers", OnToggleHelpers);
                _moveFirstVerb     = new DesignerVerb("Move Cluster Button First", OnMoveFirst);
                _movePrevVerb      = new DesignerVerb("Move Cluster Button Previous", OnMovePrevious);
                _moveNextVerb      = new DesignerVerb("Move Cluster Button Next", OnMoveNext);
                _moveLastVerb      = new DesignerVerb("Move Cluster Button Last", OnMoveLast);
                _deleteButtonVerb  = new DesignerVerb("Delete Cluster Button", OnDeleteButton);
                _verbs.AddRange(new DesignerVerb[] { _toggleHelpersVerb, _moveFirstVerb, _movePrevVerb,
                                                     _moveNextVerb, _moveLastVerb, _deleteButtonVerb });
            }

            bool moveFirst = false;
            bool movePrev  = false;
            bool moveNext  = false;
            bool moveLast  = false;

            if (_ribbonButton?.Ribbon != null)
            {
                // Cast container to the correct type
                KryptonRibbonGroupCluster cluster = (KryptonRibbonGroupCluster)_ribbonButton.RibbonContainer;

                moveFirst = (cluster.Items.IndexOf(_ribbonButton) > 0);
                movePrev  = (cluster.Items.IndexOf(_ribbonButton) > 0);
                moveNext  = (cluster.Items.IndexOf(_ribbonButton) < (cluster.Items.Count - 1));
                moveLast  = (cluster.Items.IndexOf(_ribbonButton) < (cluster.Items.Count - 1));
            }

            _moveFirstVerb.Enabled = moveFirst;
            _movePrevVerb.Enabled  = movePrev;
            _moveNextVerb.Enabled  = moveNext;
            _moveLastVerb.Enabled  = moveLast;
        }
예제 #26
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="host"></param>
        /// <param name="selectedItems"></param>
        /// <param name="allowDesignerActions"></param>
        /// <returns></returns>
        public static DesignerVerbCollection GetVerbsForControl(IDesignerHost host, IList selectedItems, AllowDesignerActionsDelegate allowDesignerActions)
        {
            DesignerVerbCollection verbs = new DesignerVerbCollection();


            //if we have a selected item, get its verbs
            if (selectedItems.Count == 1)
            {
                IComponent selectedItem = selectedItems[0] as IComponent;
                if (selectedItem != null && allowDesignerActions(selectedItem))
                {
                    IDesigner designer = host.GetDesigner(selectedItem);

                    if (designer != null)
                    {
                        DesignerVerbCollection orgVerbs = designer.Verbs;
                        const int MaxOptionsToShow      = 25;

                        if (orgVerbs.Count > MaxOptionsToShow)
                        {
                            //The designer actions in the property grid are shown on a single WinForms.LinkLabel.
                            //And, WinForms.LinkLabel can show 31 links at max.
                            for (int i = 0; i < MaxOptionsToShow; i++)
                            {
                                verbs.Add(orgVerbs[i]);
                            }
                        }
                        else
                        {
                            verbs.AddRange(orgVerbs);
                        }
                    }
                }
            }
            return(verbs);
        }
예제 #27
0
        public MSideBarDesigner()
        {
            var verb1 = new DesignerVerb("添加卡项", OnAddPage);

            _verbs.AddRange(new[] { verb1 });
        }
예제 #28
0
        // DesignerVerbCollection
        public void DesignerVerbCollectionExample()
        {
            //<Snippet1>
            //<Snippet2>
            // Creates an empty DesignerVerbCollection.
            DesignerVerbCollection collection = new DesignerVerbCollection();

            //</Snippet2>

            //<Snippet3>
            // Adds a DesignerVerb to the collection.
            collection.Add(new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)));
            //</Snippet3>

            //<Snippet4>
            // Adds an array of DesignerVerb objects to the collection.
            DesignerVerb[] verbs = { new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)), new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) };
            collection.AddRange(verbs);

            // Adds a collection of DesignerVerb objects to the collection.
            DesignerVerbCollection verbsCollection = new DesignerVerbCollection();

            verbsCollection.Add(new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)));
            verbsCollection.Add(new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)));
            collection.AddRange(verbsCollection);
            //</Snippet4>

            //<Snippet5>
            // Tests for the presence of a DesignerVerb in the collection,
            // and retrieves its index if it is found.
            DesignerVerb testVerb  = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
            int          itemIndex = -1;

            if (collection.Contains(testVerb))
            {
                itemIndex = collection.IndexOf(testVerb);
            }
            //</Snippet5>

            //<Snippet6>
            // Copies the contents of the collection, beginning at index 0,
            // to the specified DesignerVerb array.
            // 'verbs' is a DesignerVerb array.
            collection.CopyTo(verbs, 0);
            //</Snippet6>

            //<Snippet7>
            // Retrieves the count of the items in the collection.
            int collectionCount = collection.Count;

            //</Snippet7>

            //<Snippet8>
            // Inserts a DesignerVerb at index 0 of the collection.
            collection.Insert(0, new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)));
            //</Snippet8>

            //<Snippet9>
            // Removes the specified DesignerVerb from the collection.
            DesignerVerb verb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));

            collection.Remove(verb);
            //</Snippet9>

            //<Snippet10>
            // Removes the DesignerVerb at index 0.
            collection.RemoveAt(0);
            //</Snippet10>
            //</Snippet1>
        }
예제 #29
0
        public JwNavbarDesigner()
        {
            var verb1 = new DesignerVerb("编辑节点", OnEditNodes);

            designerVerbs.AddRange(new[] { verb1 });
        }
예제 #30
0
        public JwButtonDesigner()
        {
            var verb1 = new DesignerVerb("选择图标", OnSelected);

            designerVerbs.AddRange(new[] { verb1 });
        }