public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     items.Add(new DesignerActionHeaderItem("API Key"));
     items.Add(new DesignerActionTextItem("To use reCAPTCHA, you need an API key from http://admin.recaptcha.net/", string.Empty));
     return items;
 }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     items.Add(new DesignerActionMethodItem(this, "ChooseImage", System.Design.SR.GetString("ChooseImageDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ChooseImageDescription"), true));
     items.Add(new DesignerActionPropertyItem("SizeMode", System.Design.SR.GetString("SizeModeDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("SizeModeDescription")));
     return items;
 }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     items.Add(new DesignerActionMethodItem(this, "EditFields", System.Design.SR.GetString("DetailsView_EditFieldsVerb"), "Action", System.Design.SR.GetString("DetailsView_EditFieldsDesc")));
     items.Add(new DesignerActionMethodItem(this, "AddNewField", System.Design.SR.GetString("DetailsView_AddNewFieldVerb"), "Action", System.Design.SR.GetString("DetailsView_AddNewFieldDesc")));
     if (this.AllowMoveUp)
     {
         items.Add(new DesignerActionMethodItem(this, "MoveFieldUp", System.Design.SR.GetString("DetailsView_MoveFieldUpVerb"), "Action", System.Design.SR.GetString("DetailsView_MoveFieldUpDesc")));
     }
     if (this.AllowMoveDown)
     {
         items.Add(new DesignerActionMethodItem(this, "MoveFieldDown", System.Design.SR.GetString("DetailsView_MoveFieldDownVerb"), "Action", System.Design.SR.GetString("DetailsView_MoveFieldDownDesc")));
     }
     if (this.AllowRemoveField)
     {
         items.Add(new DesignerActionMethodItem(this, "RemoveField", System.Design.SR.GetString("DetailsView_RemoveFieldVerb"), "Action", System.Design.SR.GetString("DetailsView_RemoveFieldDesc")));
     }
     if (this.AllowPaging)
     {
         items.Add(new DesignerActionPropertyItem("EnablePaging", System.Design.SR.GetString("DetailsView_EnablePaging"), "Behavior", System.Design.SR.GetString("DetailsView_EnablePagingDesc")));
     }
     if (this.AllowInserting)
     {
         items.Add(new DesignerActionPropertyItem("EnableInserting", System.Design.SR.GetString("DetailsView_EnableInserting"), "Behavior", System.Design.SR.GetString("DetailsView_EnableInsertingDesc")));
     }
     if (this.AllowEditing)
     {
         items.Add(new DesignerActionPropertyItem("EnableEditing", System.Design.SR.GetString("DetailsView_EnableEditing"), "Behavior", System.Design.SR.GetString("DetailsView_EnableEditingDesc")));
     }
     if (this.AllowDeleting)
     {
         items.Add(new DesignerActionPropertyItem("EnableDeleting", System.Design.SR.GetString("DetailsView_EnableDeleting"), "Behavior", System.Design.SR.GetString("DetailsView_EnableDeletingDesc")));
     }
     return items;
 }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     items.Add(new DesignerActionMethodItem(this, "InvokeNodesDialog", System.Design.SR.GetString("InvokeNodesDialogDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("InvokeNodesDialogDescription"), true));
     items.Add(new DesignerActionPropertyItem("ImageList", System.Design.SR.GetString("ImageListDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ImageListDescription")));
     return items;
 }
Example #5
0
        //private bool SetDataSourceIDCallback(object context)
        //{
        //    Designer.DataSourceID = (string)context;

        //    return true;
        //}
        #endregion

        #region 重载
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            DesignerActionItemCollection items = new DesignerActionItemCollection();

            //PropertyDescriptor descriptor = TypeDescriptor.GetProperties(Designer.Component)["DataSourceID"];
            //if ((descriptor != null) && descriptor.IsBrowsable)
            //{
            //    DesignerActionPropertyItem dpitem = new DesignerActionPropertyItem("DataSourceID", SR.GetString("BaseDataBoundControl_ConfigureDataVerb"), SR.GetString("BaseDataBoundControl_DataActionGroup"), SR.GetString("BaseDataBoundControl_ConfigureDataVerbDesc"));
            //    items.Add(dpitem);

            //    ControlDesigner designer = Designer.DataSourceDesigner as ControlDesigner;
            //    if (designer != null)
            //    {
            //        ((DesignerActionPropertyItem)items[0]).RelatedComponent = designer.Component;
            //    }
            //}

            items.Add(new DesignerActionHeaderItem("方法栏"));
            items.Add(new DesignerActionMethodItem(this, "Test", "测试方法"));

            items.Add(new DesignerActionHeaderItem("属性栏"));
            //items.Add(new DesignerActionPropertyItem("DataSourceID", SR.GetString("BaseDataBoundControl_ConfigureDataVerb"), SR.GetString("BaseDataBoundControl_DataActionGroup"), SR.GetString("BaseDataBoundControl_ConfigureDataVerbDesc")));

            return items;
        }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this._listControlDesigner.Component);
     PropertyDescriptor descriptor = properties["DataSourceID"];
     if ((descriptor != null) && descriptor.IsBrowsable)
     {
         items.Add(new DesignerActionMethodItem(this, "ConnectToDataSource", System.Design.SR.GetString("ListControl_ConfigureDataVerb"), System.Design.SR.GetString("BaseDataBoundControl_DataActionGroup"), System.Design.SR.GetString("BaseDataBoundControl_ConfigureDataVerbDesc")));
     }
     ControlDesigner designer = this._dataSourceDesigner as ControlDesigner;
     if (designer != null)
     {
         ((DesignerActionMethodItem) items[0]).RelatedComponent = designer.Component;
     }
     descriptor = properties["Items"];
     if ((descriptor != null) && descriptor.IsBrowsable)
     {
         items.Add(new DesignerActionMethodItem(this, "EditItems", System.Design.SR.GetString("ListControl_EditItems"), "Actions", System.Design.SR.GetString("ListControl_EditItemsDesc")));
     }
     descriptor = properties["AutoPostBack"];
     if ((descriptor != null) && descriptor.IsBrowsable)
     {
         items.Add(new DesignerActionPropertyItem("AutoPostBack", System.Design.SR.GetString("ListControl_EnableAutoPostBack"), "Behavior", System.Design.SR.GetString("ListControl_EnableAutoPostBackDesc")));
     }
     return items;
 }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     if (!this.IsReadOnly)
     {
         items.Add(new DesignerActionMethodItem(this, "InvokeEmbedVerb", System.Design.SR.GetString("ToolStripDesignerEmbedVerb"), "", System.Design.SR.GetString("ToolStripDesignerEmbedVerbDesc"), true));
     }
     if (this.CanAddItems)
     {
         if (!(this._toolStrip is StatusStrip))
         {
             items.Add(new DesignerActionMethodItem(this, "InvokeInsertStandardItemsVerb", System.Design.SR.GetString("ToolStripDesignerStandardItemsVerb"), "", System.Design.SR.GetString("ToolStripDesignerStandardItemsVerbDesc"), true));
         }
         items.Add(new DesignerActionPropertyItem("RenderMode", System.Design.SR.GetString("ToolStripActionList_RenderMode"), System.Design.SR.GetString("ToolStripActionList_Layout"), System.Design.SR.GetString("ToolStripActionList_RenderModeDesc")));
     }
     if (!(this._toolStrip.Parent is ToolStripPanel))
     {
         items.Add(new DesignerActionPropertyItem("Dock", System.Design.SR.GetString("ToolStripActionList_Dock"), System.Design.SR.GetString("ToolStripActionList_Layout"), System.Design.SR.GetString("ToolStripActionList_DockDesc")));
     }
     if (!(this._toolStrip is StatusStrip))
     {
         items.Add(new DesignerActionPropertyItem("GripStyle", System.Design.SR.GetString("ToolStripActionList_GripStyle"), System.Design.SR.GetString("ToolStripActionList_Layout"), System.Design.SR.GetString("ToolStripActionList_GripStyleDesc")));
     }
     return items;
 }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     items.Add(new DesignerActionPropertyItem("ImageSize", System.Design.SR.GetString("ImageListActionListImageSizeDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ImageListActionListImageSizeDescription")));
     items.Add(new DesignerActionPropertyItem("ColorDepth", System.Design.SR.GetString("ImageListActionListColorDepthDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ImageListActionListColorDepthDescription")));
     items.Add(new DesignerActionMethodItem(this, "ChooseImages", System.Design.SR.GetString("ImageListActionListChooseImagesDisplayName"), System.Design.SR.GetString("LinksCategoryName"), System.Design.SR.GetString("ImageListActionListChooseImagesDescription"), true));
     return items;
 }
            // Create the ActionItem collection and add one command
            public override DesignerActionItemCollection GetSortedActionItems()
            {
                // fixme -- I can't get this to open up automatically (
                DesignerActionItemCollection items = new DesignerActionItemCollection();
                items.Add(new DesignerActionHeaderItem("API Key"));
                items.Add(new DesignerActionTextItem("To use reCAPTCHA, you need an API key from https://www.google.com/recaptcha/admin/create", string.Empty));

                return items;
            }
            // Create the ActionItem collection and add one command
            public override DesignerActionItemCollection GetSortedActionItems()
            {
                // fixme -- I can't get this to open up automatically (
                DesignerActionItemCollection items = new DesignerActionItemCollection();
                items.Add(new DesignerActionHeaderItem("API Key"));
                items.Add(new DesignerActionTextItem("To use Brandcaptcha, you need an API key", string.Empty));

                return items;
            }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     items.Add(new DesignerActionHeaderItem("Apariencia"));
     items.Add(new DesignerActionHeaderItem("Comportamiento"));
     items.Add(new DesignerActionPropertyItem("CajaTexto", "Caja de Texto", "Comportamiento", "Permite establecer una Caja de Texto al boton"));
     items.Add(new DesignerActionPropertyItem("CajaTextoConBoton", "Caja de Texto con Boton", "Comportamiento", "Permite establecer un ButtonEdit al boton"));
     items.Add(new DesignerActionPropertyItem("Imagen", "Imagen del boton", "Apariencia", "Permite colocar una imagen estandar al boton"));
     return items;
 }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection sortedActionItems = base.GetSortedActionItems();
     if (sortedActionItems == null)
     {
         sortedActionItems = new DesignerActionItemCollection();
     }
     sortedActionItems.Add(new DesignerActionMethodItem(this, "InvokePropertyBuilder", System.Design.SR.GetString("BDL_PropertyBuilderVerb"), System.Design.SR.GetString("BDL_BehaviorGroup"), System.Design.SR.GetString("BDL_PropertyBuilderDesc")));
     return sortedActionItems;
 }
Example #13
0
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     items.Add(new DesignerActionMethodItem(
         this,
         "InvokeItemDialog",
         "编辑项...",
         true));
     return items;
 }
		public override DesignerActionItemCollection GetSortedActionItems()
		{
			DesignerActionItemCollection actions = new DesignerActionItemCollection();
			actions.Add (new DesignerActionPropertyItem ("DrawBorder","DrawBorder","Appearance"));
			actions.Add (new DesignerActionPropertyItem ("Font","Font","Appearance"));
			actions.Add (new DesignerActionPropertyItem ("ContentAlignment","ContentAlignment","Appearance"));
			actions.Add (new DesignerActionPropertyItem ("StringTrimming","StringTrimming","Appearance"));
			actions.Add (new DesignerActionPropertyItem ("FormatString","FormatString","Appearance"));
			return actions;
		}
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     items.Add(new DesignerActionPropertyItem("RenderMode", System.Design.SR.GetString("ToolStripActionList_RenderMode"), System.Design.SR.GetString("ToolStripActionList_Layout"), System.Design.SR.GetString("ToolStripActionList_RenderModeDesc")));
     if (this._toolStripDropDown is ToolStripDropDownMenu)
     {
         items.Add(new DesignerActionPropertyItem("ShowImageMargin", System.Design.SR.GetString("ContextMenuStripActionList_ShowImageMargin"), System.Design.SR.GetString("ToolStripActionList_Layout"), System.Design.SR.GetString("ContextMenuStripActionList_ShowImageMarginDesc")));
         items.Add(new DesignerActionPropertyItem("ShowCheckMargin", System.Design.SR.GetString("ContextMenuStripActionList_ShowCheckMargin"), System.Design.SR.GetString("ToolStripActionList_Layout"), System.Design.SR.GetString("ContextMenuStripActionList_ShowCheckMarginDesc")));
     }
     return items;
 }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     items.Add(new DesignerActionMethodItem(this, "InvokeItemsDialog", System.Design.SR.GetString("ListViewActionListEditItemsDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ListViewActionListEditItemsDescription"), true));
     items.Add(new DesignerActionMethodItem(this, "InvokeColumnsDialog", System.Design.SR.GetString("ListViewActionListEditColumnsDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ListViewActionListEditColumnsDescription"), true));
     items.Add(new DesignerActionMethodItem(this, "InvokeGroupsDialog", System.Design.SR.GetString("ListViewActionListEditGroupsDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ListViewActionListEditGroupsDescription"), true));
     items.Add(new DesignerActionPropertyItem("View", System.Design.SR.GetString("ListViewActionListViewDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ListViewActionListViewDescription")));
     items.Add(new DesignerActionPropertyItem("SmallImageList", System.Design.SR.GetString("ListViewActionListSmallImagesDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ListViewActionListSmallImagesDescription")));
     items.Add(new DesignerActionPropertyItem("LargeImageList", System.Design.SR.GetString("ListViewActionListLargeImagesDisplayName"), System.Design.SR.GetString("PropertiesCategoryName"), System.Design.SR.GetString("ListViewActionListLargeImagesDescription")));
     return items;
 }
        /// <summary>
        /// Returns the collection of DesignerActionItem objects contained in the list.
        /// </summary>
        /// <returns>A DesignerActionItem array that contains the items in this list.</returns>
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            // Create a new collection for holding the single item we want to create
            DesignerActionItemCollection actions = new DesignerActionItemCollection();

            // This can be null when deleting a component instance at design time
            if (_command != null)
            {
            }

            return actions;
        }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     for (int i = 0; i < this._verbs.Length; i++)
     {
         if ((this._verbs[i].Visible && this._verbs[i].Enabled) && this._verbs[i].Supported)
         {
             items.Add(new DesignerActionVerbItem(this._verbs[i]));
         }
     }
     return items;
 }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     if (this.AllowDynamicData)
     {
         items.Add(new DesignerActionPropertyItem("EnableDynamicData", System.Design.SR.GetString("FormView_EnableDynamicData"), "Behavior", System.Design.SR.GetString("FormView_EnableDynamicDataDesc")));
     }
     if (this.AllowPaging)
     {
         items.Add(new DesignerActionPropertyItem("EnablePaging", System.Design.SR.GetString("FormView_EnablePaging"), "Behavior", System.Design.SR.GetString("FormView_EnablePagingDesc")));
     }
     return items;
 }
		/*
		 * GetSortedActionItems
		 */

		/// <summary>
		/// Returns the collection of <see cref="T:System.ComponentModel.Design.DesignerActionItem"></see> objects contained in the list.
		/// </summary>
		/// <returns>
		/// A <see cref="T:System.ComponentModel.Design.DesignerActionItem"></see> array that contains the items in this list.
		/// </returns>
		public override DesignerActionItemCollection GetSortedActionItems()
		{
			DesignerActionItemCollection actionItems = new DesignerActionItemCollection();

			actionItems.Add(new DesignerActionPropertyItem(
				"ColorScheme",
				Resources.ColorSchemeDisplayName,
				Resources.AppearanceCategory,
				Resources.ColorSchemeDescription)
				);

			return actionItems;
		}
		/*
		 * GetSortedActionItems
		 */

		/// <summary>
		/// Returns the collection of <see cref="T:System.ComponentModel.Design.DesignerActionItem"></see> objects contained in the list.
		/// </summary>
		/// <returns>
		/// A <see cref="T:System.ComponentModel.Design.DesignerActionItem"></see> array that contains the items in this list.
		/// </returns>
		public override DesignerActionItemCollection GetSortedActionItems()
		{
			DesignerActionItemCollection items = new DesignerActionItemCollection();

			items.Add(new DesignerActionPropertyItem(
				"Orientation",
				designProps.Resources.ActionList_Orientation,
				ctrlProps.Resources.Category_Appearance,
				ctrlProps.Resources.Description_Orientation)
			);

			return items;
		}
		/*
		 * GetSortedActionItems
		 */

		/// <summary>
		/// Returns the collection of <see cref="T:System.ComponentModel.Design.DesignerActionItem"></see> objects contained in the list.
		/// </summary>
		/// <returns>
		/// A <see cref="T:System.ComponentModel.Design.DesignerActionItem"></see> array that contains the items in this list.
		/// </returns>
		public override DesignerActionItemCollection GetSortedActionItems()
		{
			DesignerActionItemCollection items = new DesignerActionItemCollection();

			items.Add(new DesignerActionPropertyItem(
				"ControlToReflect",
				designProps.Resources.ActionList_ControlReflector_ControlToReflect,
				ctrlProps.Resources.Category_Appearance,
				ctrlProps.Resources.Description_ControlReflector_ControlToReflect)
			);

			return items;
		}
        /// <summary>
        /// Returns the collection of DesignerActionItem objects contained in the list.
        /// </summary>
        /// <returns>A DesignerActionItem array that contains the items in this list.</returns>
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            // Create a new collection for holding the single item we want to create
            DesignerActionItemCollection actions = new DesignerActionItemCollection();

            // This can be null when deleting a control instance at design time
            if (_set != null)
            {
                // Add the list of check set specific actions
            }

            return actions;
        }
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            DesignerActionItemCollection items = new DesignerActionItemCollection();
            items.Add(new DesignerActionHeaderItem("Menu Items"));
            items.Add(new DesignerActionHeaderItem("Menu Type"));
            items.Add(new DesignerActionHeaderItem("Appearance"));

            items.Add(new DesignerActionMethodItem(this, "EditItems", "Edit Items", "Menu Items", true));
            items.Add(new DesignerActionMethodItem(this, "RightSize", "Right Size Control", "Appearance", true));

            items.Add(new DesignerActionPropertyItem("MenuType", "Type of Radial Menu", "Menu Type", "Specifies the type of radial menu displayed."));
   
            return items;
        }
        /// <summary>
        /// Returns the collection of DesignerActionItem objects contained in the list.
        /// </summary>
        /// <returns>A DesignerActionItem array that contains the items in this list.</returns>
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            // Create a new collection for holding the single item we want to create
            DesignerActionItemCollection actions = new DesignerActionItemCollection();

            // This can be null when deleting a component instance at design time
            if (_manager != null)
            {
                // Add the list of panel specific actions
                actions.Add(new DesignerActionHeaderItem("Visuals"));
                actions.Add(new DesignerActionPropertyItem("GlobalPaletteMode", "Global Palette", "Visuals", "Global palette setting"));
            }

            return actions;
        }
        /// <summary>
        /// Returns the collection of DesignerActionItem objects contained in the list.
        /// </summary>
        /// <returns>A DesignerActionItem array that contains the items in this list.</returns>
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            // Create a new collection for holding the single item we want to create
            DesignerActionItemCollection actions = new DesignerActionItemCollection();

            // This can be null when deleting a control instance at design time
            if (_gallery != null)
            {
                // Add the list of button specific actions
                actions.Add(new DesignerActionHeaderItem("Visuals"));
                actions.Add(new DesignerActionPropertyItem("PaletteMode", "Palette", "Visuals", "Palette applied to drawing"));
            }

            return actions;
        }
 public override DesignerActionItemCollection GetSortedActionItems()
 {
     DesignerActionItemCollection items = new DesignerActionItemCollection();
     PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this._controlDesigner.Component)["DataSourceID"];
     if ((descriptor != null) && descriptor.IsBrowsable)
     {
         items.Add(new DesignerActionPropertyItem("DataSourceID", System.Design.SR.GetString("BaseDataBoundControl_ConfigureDataVerb"), System.Design.SR.GetString("BaseDataBoundControl_DataActionGroup"), System.Design.SR.GetString("BaseDataBoundControl_ConfigureDataVerbDesc")));
     }
     ControlDesigner designer = this._dataSourceDesigner as ControlDesigner;
     if (designer != null)
     {
         ((DesignerActionPropertyItem) items[0]).RelatedComponent = designer.Component;
     }
     return items;
 }
        //This function adds the smart tags and headers to the smart tag list
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            DesignerActionItemCollection items = new DesignerActionItemCollection();

            //Header
            items.Add(new DesignerActionHeaderItem("Appearance"));
            items.Add(new DesignerActionHeaderItem("Data"));

            //Items
            items.Add(new DesignerActionPropertyItem("ShowDeleteColumn", "Show delete column.", "Appearance", "Show delete column"));
            items.Add(new DesignerActionPropertyItem("ShowEditColumn", "Show Edit column.", "Appearance", "Show Edit column"));
            items.Add(new DesignerActionPropertyItem("ShowOrderColumn", "Show Order column.", "Appearance", "Show Order column"));
            items.Add(new DesignerActionPropertyItem("DataSourceID", "DataSourceID", "Data", "Link to the data control"));

            return items;
        }
Example #29
0
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            if (this._items == null)
            {
                this._items = new DesignerActionItemCollection();

                this._items.Add(new DesignerActionPropertyItem("Value", "Value", ""));
                this._items.Add(new DesignerActionPropertyItem("Resizable", "Resizable", ""));

                //this._items.Add(new DesignerActionMethodItem(this, "Value", "Value", true));
                //this._items.Add(new DesignerActionMethodItem(this, "Resizable", "Resizable", true));
                //_items.Add(new DesignerActionTextItem("TextItem", ""));
                // this._items.Add(new DesignerActionPropertyItem("Resizable", "Resizable1"));
                //this._items.Add(new DesignerActionTextItem("Value", "Value"));
            }
            return this._items;
        }
        public override DesignerActionItemCollection GetSortedActionItems()
        {
            DesignerActionItemCollection items = new DesignerActionItemCollection();
            items.Add(new DesignerActionHeaderItem("Nodes"));
            items.Add(new DesignerActionHeaderItem("Columns"));
            
            items.Add(new DesignerActionMethodItem(this, "EditColumns", "Edit Columns...", "Columns", "Edit Tree Control Columns", true));
            items.Add(new DesignerActionPropertyItem("ColumnsVisible", "Column header visible?", "Columns", "Indicates whether tree column header is visible"));
            items.Add(new DesignerActionPropertyItem("GridColumnLines", "Show grid column lines?", "Columns", "Indicates whether grid lines are visible"));
            items.Add(new DesignerActionPropertyItem("GridRowLines", "Show grid row lines?", "Nodes", "Indicates whether grid lines between nodes are visible"));
            items.Add(new DesignerActionPropertyItem("GridLinesColor", "Grid lines color:", "Columns", "Indicates custom color for grid lines"));

            items.Add(new DesignerActionPropertyItem("SelectionBoxStyle", "Selection style:", "Selection", "Indicates selection style"));
            items.Add(new DesignerActionPropertyItem("HotTracking", "Highlight mouse over node?", "Selection", "Indicates whether node that mouse is over is highlighted"));

            return items;
        }
Example #31
0
        public override System.ComponentModel.Design.DesignerActionItemCollection GetSortedActionItems()
        {
            System.ComponentModel.Design.DesignerActionItemCollection items = new System.ComponentModel.Design.DesignerActionItemCollection();

            //Define static section header entries.
            items.Add(new System.ComponentModel.Design.DesignerActionHeaderItem("Data Fields"));

            items.Add(new System.ComponentModel.Design.DesignerActionPropertyItem("CognomeTextBox",
                                                                                  "Cognome control", null,
                                                                                  "Get or Set Cognome field."));


            items.Add(new System.ComponentModel.Design.DesignerActionPropertyItem("NomeTextBox",
                                                                                  "Nome control", null,
                                                                                  "Get or Set Nome field."));


            items.Add(new System.ComponentModel.Design.DesignerActionPropertyItem("SessoDropDownList",
                                                                                  "Sesso control", null,
                                                                                  "Get or Set Sesso field."));


            items.Add(new System.ComponentModel.Design.DesignerActionPropertyItem("DataNascitaPicker",
                                                                                  "Data di Nascita control", null,
                                                                                  "Get or Set Data di Nascita field."));


            items.Add(new System.ComponentModel.Design.DesignerActionPropertyItem("RegioniDropDownList",
                                                                                  "Regione di Nascita control", null,
                                                                                  "Get or Set Regione di Nascita field."));

            items.Add(new System.ComponentModel.Design.DesignerActionPropertyItem("ProvinceDropDownList",
                                                                                  "Provincia di Nascita control", null,
                                                                                  "Get or Set Provincia di Nascita field."));


            items.Add(new System.ComponentModel.Design.DesignerActionPropertyItem("ComuniDropDownList",
                                                                                  "Comune di Nascita control", null,
                                                                                  "Get or Set Comune di Nascita field."));


            return(items);
        }
Example #32
0
        protected void EnsureVerbs()
        {
            bool flag = false;

            if ((this._currentVerbs == null) && (this._serviceProvider != null))
            {
                Hashtable hashtable = null;
                if (this._selectionService == null)
                {
                    this._selectionService = this.GetService(typeof(ISelectionService)) as ISelectionService;
                    if (this._selectionService != null)
                    {
                        this._selectionService.SelectionChanging += new EventHandler(this.OnSelectionChanging);
                    }
                }
                int capacity = 0;
                DesignerVerbCollection verbs  = null;
                DesignerVerbCollection verbs2 = new DesignerVerbCollection();
                IDesignerHost          host   = this.GetService(typeof(IDesignerHost)) as IDesignerHost;
                if (((this._selectionService != null) && (host != null)) && (this._selectionService.SelectionCount == 1))
                {
                    object primarySelection = this._selectionService.PrimarySelection;
                    if ((primarySelection is IComponent) && !TypeDescriptor.GetAttributes(primarySelection).Contains(InheritanceAttribute.InheritedReadOnly))
                    {
                        flag = primarySelection == host.RootComponent;
                        IDesigner designer = host.GetDesigner((IComponent)primarySelection);
                        if (designer != null)
                        {
                            verbs = designer.Verbs;
                            if (verbs != null)
                            {
                                capacity            += verbs.Count;
                                this._verbSourceType = primarySelection.GetType();
                            }
                            else
                            {
                                this._verbSourceType = null;
                            }
                        }
                        DesignerActionService service = this.GetService(typeof(DesignerActionService)) as DesignerActionService;
                        if (service != null)
                        {
                            DesignerActionListCollection componentActions = service.GetComponentActions(primarySelection as IComponent);
                            if (componentActions != null)
                            {
                                foreach (DesignerActionList list2 in componentActions)
                                {
                                    DesignerActionItemCollection sortedActionItems = list2.GetSortedActionItems();
                                    if (sortedActionItems != null)
                                    {
                                        for (int j = 0; j < sortedActionItems.Count; j++)
                                        {
                                            DesignerActionMethodItem item = sortedActionItems[j] as DesignerActionMethodItem;
                                            if ((item != null) && item.IncludeAsDesignerVerb)
                                            {
                                                EventHandler handler = new EventHandler(item.Invoke);
                                                DesignerVerb verb    = new DesignerVerb(item.DisplayName, handler);
                                                verbs2.Add(verb);
                                                capacity++;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (flag && (this._globalVerbs == null))
                {
                    flag = false;
                }
                if (flag)
                {
                    capacity += this._globalVerbs.Count;
                }
                hashtable = new Hashtable(capacity, StringComparer.OrdinalIgnoreCase);
                ArrayList list = new ArrayList(capacity);
                if (flag)
                {
                    for (int k = 0; k < this._globalVerbs.Count; k++)
                    {
                        string text = ((DesignerVerb)this._globalVerbs[k]).Text;
                        hashtable[text] = list.Add(this._globalVerbs[k]);
                    }
                }
                if (verbs2.Count > 0)
                {
                    for (int m = 0; m < verbs2.Count; m++)
                    {
                        string str2 = verbs2[m].Text;
                        hashtable[str2] = list.Add(verbs2[m]);
                    }
                }
                if ((verbs != null) && (verbs.Count > 0))
                {
                    for (int n = 0; n < verbs.Count; n++)
                    {
                        string str3 = verbs[n].Text;
                        hashtable[str3] = list.Add(verbs[n]);
                    }
                }
                DesignerVerb[] verbArray = new DesignerVerb[hashtable.Count];
                int            index     = 0;
                for (int i = 0; i < list.Count; i++)
                {
                    DesignerVerb verb2 = (DesignerVerb)list[i];
                    string       str4  = verb2.Text;
                    if (((int)hashtable[str4]) == i)
                    {
                        verbArray[index] = verb2;
                        index++;
                    }
                }
                this._currentVerbs = new DesignerVerbCollection(verbArray);
            }
        }
        /// <summary>
        ///  Ensures that the verb list has been created.
        /// </summary>
        protected void EnsureVerbs()
        {
            // We apply global verbs only if the base component is the
            // currently selected object.
            //
            bool useGlobalVerbs = false;

            if (_currentVerbs is null && _serviceProvider != null)
            {
                Hashtable buildVerbs = null;
                ArrayList verbsOrder;

                if (_selectionService is null)
                {
                    _selectionService = GetService(typeof(ISelectionService)) as ISelectionService;

                    if (_selectionService != null)
                    {
                        _selectionService.SelectionChanging += new EventHandler(OnSelectionChanging);
                    }
                }

                int verbCount = 0;
                DesignerVerbCollection localVerbs          = null;
                DesignerVerbCollection designerActionVerbs = new DesignerVerbCollection(); // we instanciate this one here...
                IDesignerHost          designerHost        = GetService(typeof(IDesignerHost)) as IDesignerHost;

                if (_selectionService != null && designerHost != null && _selectionService.SelectionCount == 1)
                {
                    object selectedComponent = _selectionService.PrimarySelection;
                    if (selectedComponent is IComponent &&
                        !TypeDescriptor.GetAttributes(selectedComponent).Contains(InheritanceAttribute.InheritedReadOnly))
                    {
                        useGlobalVerbs = (selectedComponent == designerHost.RootComponent);

                        // LOCAL VERBS
                        IDesigner designer = designerHost.GetDesigner((IComponent)selectedComponent);
                        if (designer != null)
                        {
                            localVerbs = designer.Verbs;
                            if (localVerbs != null)
                            {
                                verbCount      += localVerbs.Count;
                                _verbSourceType = selectedComponent.GetType();
                            }
                            else
                            {
                                _verbSourceType = null;
                            }
                        }

                        // DesignerAction Verbs
                        DesignerActionService daSvc = GetService(typeof(DesignerActionService)) as DesignerActionService;
                        if (daSvc != null)
                        {
                            DesignerActionListCollection actionLists = daSvc.GetComponentActions(selectedComponent as IComponent);
                            if (actionLists != null)
                            {
                                foreach (DesignerActionList list in actionLists)
                                {
                                    DesignerActionItemCollection dai = list.GetSortedActionItems();
                                    if (dai != null)
                                    {
                                        for (int i = 0; i < dai.Count; i++)
                                        {
                                            DesignerActionMethodItem dami = dai[i] as DesignerActionMethodItem;
                                            if (dami != null && dami.IncludeAsDesignerVerb)
                                            {
                                                EventHandler handler = new EventHandler(dami.Invoke);
                                                DesignerVerb verb    = new DesignerVerb(dami.DisplayName, handler);
                                                designerActionVerbs.Add(verb);
                                                verbCount++;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                // GLOBAL VERBS
                if (useGlobalVerbs && _globalVerbs is null)
                {
                    useGlobalVerbs = false;
                }

                if (useGlobalVerbs)
                {
                    verbCount += _globalVerbs.Count;
                }

                // merge all
                buildVerbs = new Hashtable(verbCount, StringComparer.OrdinalIgnoreCase);
                verbsOrder = new ArrayList(verbCount);

                // PRIORITY ORDER FROM HIGH TO LOW: LOCAL VERBS - DESIGNERACTION VERBS - GLOBAL VERBS
                if (useGlobalVerbs)
                {
                    for (int i = 0; i < _globalVerbs.Count; i++)
                    {
                        string key = ((DesignerVerb)_globalVerbs[i]).Text;
                        buildVerbs[key] = verbsOrder.Add(_globalVerbs[i]);
                    }
                }

                if (designerActionVerbs.Count > 0)
                {
                    for (int i = 0; i < designerActionVerbs.Count; i++)
                    {
                        string key = designerActionVerbs[i].Text;
                        buildVerbs[key] = verbsOrder.Add(designerActionVerbs[i]);
                    }
                }

                if (localVerbs != null && localVerbs.Count > 0)
                {
                    for (int i = 0; i < localVerbs.Count; i++)
                    {
                        string key = localVerbs[i].Text;
                        buildVerbs[key] = verbsOrder.Add(localVerbs[i]);
                    }
                }

                // look for duplicate, prepare the result table
                DesignerVerb[] result = new DesignerVerb[buildVerbs.Count];
                int            j      = 0;
                for (int i = 0; i < verbsOrder.Count; i++)
                {
                    DesignerVerb value = (DesignerVerb)verbsOrder[i];
                    string       key   = value.Text;
                    if ((int)buildVerbs[key] == i)
                    { // there's not been a duplicate for this entry
                        result[j] = value;
                        j++;
                    }
                }

                _currentVerbs = new DesignerVerbCollection(result);
            }
        }
Example #34
0
        protected virtual void GetComponentDesignerActions(IComponent component, DesignerActionListCollection actionLists)
        {
            if (component == null)
            {
                throw new ArgumentNullException("component");
            }
            if (actionLists == null)
            {
                throw new ArgumentNullException("actionLists");
            }
            IServiceContainer site = component.Site as IServiceContainer;

            if (site != null)
            {
                DesignerCommandSet service = (DesignerCommandSet)site.GetService(typeof(DesignerCommandSet));
                if (service != null)
                {
                    DesignerActionListCollection lists = service.ActionLists;
                    if (lists != null)
                    {
                        actionLists.AddRange(lists);
                    }
                    if (actionLists.Count == 0)
                    {
                        DesignerVerbCollection verbs = service.Verbs;
                        if ((verbs != null) && (verbs.Count != 0))
                        {
                            ArrayList list = new ArrayList();
                            bool      flag = this.componentToVerbsEventHookedUp[component] == null;
                            if (flag)
                            {
                                this.componentToVerbsEventHookedUp[component] = true;
                            }
                            foreach (DesignerVerb verb in verbs)
                            {
                                if (flag)
                                {
                                    verb.CommandChanged += new EventHandler(this.OnVerbStatusChanged);
                                }
                                if (verb.Enabled && verb.Visible)
                                {
                                    list.Add(verb);
                                }
                            }
                            if (list.Count != 0)
                            {
                                DesignerActionVerbList list2 = new DesignerActionVerbList((DesignerVerb[])list.ToArray(typeof(DesignerVerb)));
                                actionLists.Add(list2);
                            }
                        }
                    }
                    if (lists != null)
                    {
                        foreach (DesignerActionList list3 in lists)
                        {
                            DesignerActionItemCollection sortedActionItems = list3.GetSortedActionItems();
                            if ((sortedActionItems == null) || (sortedActionItems.Count == 0))
                            {
                                actionLists.Remove(list3);
                            }
                        }
                    }
                }
            }
        }
        protected virtual void GetComponentDesignerActions(IComponent component, DesignerActionListCollection actionLists)
        {
            if (component == null)
            {
                throw new ArgumentNullException(nameof(component));
            }

            if (actionLists == null)
            {
                throw new ArgumentNullException(nameof(actionLists));
            }

            if (component.Site is IServiceContainer sc)
            {
                DesignerCommandSet dcs = (DesignerCommandSet)sc.GetService(typeof(DesignerCommandSet));
                if (dcs != null)
                {
                    DesignerActionListCollection pullCollection = dcs.ActionLists;
                    if (pullCollection != null)
                    {
                        actionLists.AddRange(pullCollection);
                    }

                    // if we don't find any, add the verbs for this component there...
                    if (actionLists.Count == 0)
                    {
                        DesignerVerbCollection verbs = dcs.Verbs;
                        if (verbs != null && verbs.Count != 0)
                        {
                            ArrayList verbsArray   = new ArrayList();
                            bool      hookupEvents = _componentToVerbsEventHookedUp[component] == null;
                            if (hookupEvents)
                            {
                                _componentToVerbsEventHookedUp[component] = true;
                            }
                            foreach (DesignerVerb verb in verbs)
                            {
                                if (hookupEvents)
                                {
                                    //Debug.WriteLine("hooking up change event for verb " + verb.Text);
                                    verb.CommandChanged += new EventHandler(OnVerbStatusChanged);
                                }
                                if (verb.Enabled && verb.Visible)
                                {
                                    //Debug.WriteLine("adding verb to collection for panel... " + verb.Text);
                                    verbsArray.Add(verb);
                                }
                            }
                            if (verbsArray.Count != 0)
                            {
                                DesignerActionVerbList davl = new DesignerActionVerbList((DesignerVerb[])verbsArray.ToArray(typeof(DesignerVerb)));
                                actionLists.Add(davl);
                            }
                        }
                    }

                    // remove all the ones that are empty... ie GetSortedActionList returns nothing we might waste some time doing this twice but don't have much of a choice here... the panel is not yet displayed and we want to know if a non empty panel is present...
                    // NOTE: We do this AFTER the verb check that way to disable auto verb upgrading you can just return an empty actionlist collection
                    if (pullCollection != null)
                    {
                        foreach (DesignerActionList actionList in pullCollection)
                        {
                            DesignerActionItemCollection collection = actionList.GetSortedActionItems();
                            if (collection == null || collection.Count == 0)
                            {
                                actionLists.Remove(actionList);
                            }
                        }
                    }
                }
            }
        }
 public DesignerActionList(IComponent component)
 {
     this.component = component;
     action_items   = new DesignerActionItemCollection();
 }