//--------------------------------------------------------------------- public override DesignerActionItemCollection GetSortedActionItems() { var actionPropertiesHeader = new DesignerActionHeaderItem("Свойства", "Properties"); var items = new DesignerActionItemCollection { actionPropertiesHeader }; //----------------------------------------------------------------- items.AddActionPropertyItem( nameof(RadiusCorner), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.RadiusCorner)), actionPropertiesHeader.Category ); //----------------------------------------------------------------- var actionMethodsHeader = new DesignerActionHeaderItem("Методы", "Methods"); items.Add(actionMethodsHeader); //------------------------------------------------------------- items.Add(new DesignerActionMethodItem( this, nameof(AddNewTab), "Добавить новую страницу", actionMethodsHeader.Category )); return(items); }
public void AddHeaderItem(DesignerActionHeaderItem item) { foreach (DesignerActionHeaderItem header in this.Headers) { if (item.DisplayName == header.DisplayName) { return; } } this.Headers.Add(item); }
public void RemoveHeaderItem(DesignerActionHeaderItem item) { foreach (DesignerActionHeaderItem header in this.Headers) { if (item.DisplayName == header.DisplayName) { this.Headers.Remove(header); return; } } }
public override DesignerActionItemCollection GetSortedActionItems() { if (this.items == null) { items = new DesignerActionItemCollection(); DesignerActionHeaderItem TasksHead = new DesignerActionHeaderItem(Resources.VALIDATOR_ACTIONLIST_TASKS); items.Add(new DesignerActionMethodItem(this, "ClearValidationInfos", Resources.VALIDATOR_ACTIONLIST_TASKS_CLEARVALIDATIONINFOS, TasksHead.Category, true)); } return(this.items); }
//--------------------------------------------------------------------- public override DesignerActionItemCollection GetSortedActionItems() { var actionPropertiesHeader = new DesignerActionHeaderItem("Свойства", "Properties"); var items = new DesignerActionItemCollection { actionPropertiesHeader }; //----------------------------------------------------------------- items.AddActionPropertyItem( nameof(StartGradientColor), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.StartGradientColor)), actionPropertiesHeader.Category ); items.AddActionPropertyItem( nameof(StartGradientAlpha), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.StartGradientAlpha)), actionPropertiesHeader.Category ); //----------------------------------------------------------------- items.AddActionPropertyItem( nameof(EndGradientColor), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.EndGradientColor)), actionPropertiesHeader.Category ); items.AddActionPropertyItem( nameof(EndGradientAlpha), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.EndGradientAlpha)), actionPropertiesHeader.Category ); //----------------------------------------------------------------- items.AddActionPropertyItem( nameof(AngleGradient), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.AngleGradient)), actionPropertiesHeader.Category ); //----------------------------------------------------------------- if (StartGradientColor != EndGradientColor) { var actionMethodsHeader = new DesignerActionHeaderItem("Методы", "Methods"); items.Add(actionMethodsHeader); //------------------------------------------------------------- items.Add(new DesignerActionMethodItem( this, nameof(InvertGradientColor), "Инвертировать цвета градиента", actionMethodsHeader.Category, "Поменять местами начальный и конечный цвет градиента" )); //------------------------------------------------------------- } //----------------------------------------------------------------- return(items); }
public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection(); items.Add(new DesignerActionHeaderItem("Ruler Options", "Ruler")); DesignerActionItem propItem; propItem = new DesignerActionTextItem("Set the appearance of the ruler inside the editor's container.", "Ruler"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionPropertyItem("VRuler", "&Vertical Ruler", "Ruler"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionPropertyItem("HRuler", "&Horizontal Ruler", "Ruler"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionHeaderItem("UI Options", "UI"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionTextItem("Set the appearance of the toolbar and strip elements.", "UI"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionPropertyItem("ShowToolbar", "&Show Toolbar", "UI"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionPropertyItem("DockToolbar", "&Dock Toolbar", "UI"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionPropertyItem("ShowMenuStrip", "&Show MenuStrip", "UI"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionPropertyItem("ShowStatusStrip", "&Show StatusStrip", "UI"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionHeaderItem("Information and Layout", "Layout"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionTextItem("Informations about current layout and dock option.", "Layout"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionTextItem(String.Format(" Size: {0} x {1}", ((Control)editor).Size.Width, ((Control)editor).Size.Height), "Layout"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionTextItem(String.Format(" Location: x={0} y={1}", ((Control)editor).Location.X, ((Control)editor).Location.Y), "Layout"); propItem.AllowAssociate = true; items.Add(propItem); propItem = new DesignerActionPropertyItem("Dock", "&Dock Editor", "Layout"); propItem.AllowAssociate = true; items.Add(propItem); return(items); }
public void DesignerActionItem_Ctor_String(string displayName, string expectedDisplayName) { var item = new DesignerActionHeaderItem(displayName); Assert.Equal(expectedDisplayName, item.DisplayName); Assert.Equal(displayName, item.Category); Assert.Null(item.Description); Assert.False(item.AllowAssociate); Assert.Empty(item.Properties); Assert.Same(item.Properties, item.Properties); Assert.IsType <HybridDictionary>(item.Properties); Assert.True(item.ShowInSourceView); }
//--------------------------------------------------------------------- public override DesignerActionItemCollection GetSortedActionItems() { var actionPropertiesHeader = new DesignerActionHeaderItem("Свойства", "Properties"); var items = new DesignerActionItemCollection { actionPropertiesHeader }; //----------------------------------------------------------------- items.AddActionPropertyItem( nameof(Active), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.Active)), actionPropertiesHeader.Category ); //----------------------------------------------------------------- items.AddActionPropertyItem( nameof(OuterCircleRadius), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.OuterCircleRadius)), actionPropertiesHeader.Category ); items.AddActionPropertyItem( nameof(InnerCircleRadius), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.InnerCircleRadius)), actionPropertiesHeader.Category ); //----------------------------------------------------------------- items.AddActionPropertyItem( nameof(NumberSpoke), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.NumberSpoke)), actionPropertiesHeader.Category ); items.AddActionPropertyItem( nameof(SpokeThickness), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.SpokeThickness)), actionPropertiesHeader.Category ); items.AddActionPropertyItem( nameof(SpokeColor), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.SpokeColor)), actionPropertiesHeader.Category ); //----------------------------------------------------------------- items.AddActionPropertyItem( nameof(RotationSpeed), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.RotationSpeed)), actionPropertiesHeader.Category ); //----------------------------------------------------------------- return(items); }
//--------------------------------------------------------------------- public override DesignerActionItemCollection GetSortedActionItems() { var actionPropertiesHeder = new DesignerActionHeaderItem("Свойства", "Properties"); var items = new DesignerActionItemCollection { actionPropertiesHeder }; //----------------------------------------------------------------- items.AddActionPropertyItem( nameof(Orientation), _control.GetPropertyName(ExpressionExtensions.LastPartNameOf(() => _control.Orientation)), actionPropertiesHeder.Category ); //----------------------------------------------------------------- return(items); }
public override DesignerActionItemCollection GetSortedActionItems() { this.AddPropertyItem(new DesignerActionPropertyItem("Border", "Border", "500", "Add/Remove Border from TabPanel")); this.AddPropertyItem(new DesignerActionPropertyItem("Plain", "Plain", "500", "Render the TabPanel without a background image")); this.AddPropertyItem(new DesignerActionPropertyItem("AutoPostBack", "AutoPostBack", "500", "Automatically PostBack on Tab Changed")); this.AddPropertyItem(new DesignerActionPropertyItem("EnableTabScroll", "Enable Tab Scrolling", "500", "Enable scrolling to tabs that may be invisible")); this.AddPropertyItem(new DesignerActionPropertyItem("TabPosition", "Tab Position", "500", "The position where the Tabs should be rendered")); this.AddPropertyItem(new DesignerActionPropertyItem("Width", "Width", "500", "Change the Width of the TabPanel")); this.AddPropertyItem(new DesignerActionPropertyItem("Height", "Height", "500", "Change the Height of the TabPanel")); this.AddPropertyItem(new DesignerActionPropertyItem("ActiveTabIndex", "Active Tab", "500", "The numeric index of the Tab that should be initially activated")); DesignerActionHeaderItem activeTabHeader = new DesignerActionHeaderItem("Edit Tab Properties", "600"); DesignerActionPropertyItem tabs = new DesignerActionPropertyItem("Tabs", "Select Tab", "600"); DesignerActionPropertyItem tabID = new DesignerActionPropertyItem("TabID", "ID", "600"); DesignerActionPropertyItem title = new DesignerActionPropertyItem("Title", "Title", "600"); DesignerActionPropertyItem iconCls = new DesignerActionPropertyItem("Icon", "Icon", "600", "The Icon to use"); DesignerActionPropertyItem closable = new DesignerActionPropertyItem("Closable", "Closable", "600", "Check to disable Tab"); DesignerActionPropertyItem disabled = new DesignerActionPropertyItem("Disabled", "Disabled", "600", "Allow the user to close the Tab"); if (this.ActiveTabIndexIsValid) { this.AddHeaderItem(activeTabHeader); this.AddPropertyItem(tabID); this.AddPropertyItem(title); this.AddPropertyItem(iconCls); this.AddPropertyItem(closable); this.AddPropertyItem(disabled); } else { this.RemovePropertyItem(disabled); this.RemovePropertyItem(closable); this.RemovePropertyItem(iconCls); this.RemovePropertyItem(title); this.RemovePropertyItem(tabID); this.RemoveHeaderItem(activeTabHeader); } this.AddHeaderItem(new DesignerActionHeaderItem("Operations", "700")); this.AddMethodItem(new DesignerActionMethodItem(this, "AddTabAtBegin", "Insert Tab at Start", "700", "Insert Tab at Start")); this.AddMethodItem(new DesignerActionMethodItem(this, "AddTabAtEnd", "Insert Tab at End", "700", "Insert Tab at End")); this.AddMethodItem(new DesignerActionMethodItem(this, "AddTabAfterActive", "Insert Tab after Active Tab", "700", "Insert Tab after Active Tab")); this.AddMethodItem(new DesignerActionMethodItem(this, "RemoveActiveTab", "Remove Active Tab", "700", "Remove Active Tab")); return(base.GetSortedActionItems()); }
public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection actions = new DesignerActionItemCollection(); PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this._designer.Component); PropertyDescriptor actionableProperty; actionableProperty = properties["LeftItems"]; if (actionableProperty != null && actionableProperty.IsBrowsable) { DesignerActionMethodItem editLeftItemsAction = new DesignerActionMethodItem(this, "EditLeftItems", Resources.DualList_EditLeftItems, "LeftData", Resources.DualList_EditLeftItemsEffectDescription); actions.Add(editLeftItemsAction); } actionableProperty = properties["RightItems"]; if (actionableProperty != null && actionableProperty.IsBrowsable) { actions.Add(new DesignerActionMethodItem(this, "EditRightItems", Resources.DualList_EditRightItems, "RightData", Resources.DualList_EditRightItemsEffectDescription)); } DesignerActionHeaderItem behaviorHeader = new DesignerActionHeaderItem("Behavior", "Behavior"); actions.Add(behaviorHeader); actionableProperty = properties["EnableMoveAll"]; if ((actionableProperty != null) && actionableProperty.IsBrowsable) { actions.Add(new DesignerActionPropertyItem("EnableMoveAll", Resources.DualList_ToggleEnableMoveAll, "Behavior", Resources.DualList_ToggleEnableMoveAllDescription)); } actionableProperty = properties["EnableMoveUpDown"]; if ((actionableProperty != null) && actionableProperty.IsBrowsable) { actions.Add(new DesignerActionPropertyItem("EnableMoveUpDown", Resources.DualList_ToggleEnableMoveUpDown, "Behavior", Resources.DualList_ToggleEnableMoveUpDownDescription)); } return(actions); }