当前位置: 首页>>代码示例>>C#>>正文


C# Design.ToolboxItem类代码示例

本文整理汇总了C#中System.Drawing.Design.ToolboxItem的典型用法代码示例。如果您正苦于以下问题:C# ToolboxItem类的具体用法?C# ToolboxItem怎么用?C# ToolboxItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ToolboxItem类属于System.Drawing.Design命名空间,在下文中一共展示了ToolboxItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SideTabItemDesigner

 ///<summary>create a tabitem from a toolboxitem. It init Icon from the tag</summary>
 public SideTabItemDesigner(string name, ToolboxItem tag)
     : base(name, tag)
 {
     CanBeRenamed = false;
     this.Icon = tag.Bitmap;
     ReloadToolBox();
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:8,代码来源:SideTabItemDesigner.cs

示例2: CreateToolCore

 protected override IComponent[] CreateToolCore(ToolboxItem tool, int x, int y, int width, int height, bool hasLocation, bool hasSize)
 {
     if (tool != null)
     {
         System.Type c = tool.GetType(this.designerHost);
         if (!typeof(ToolStrip).IsAssignableFrom(c))
         {
             ToolStripContainer parent = this.panel.Parent as ToolStripContainer;
             if (parent != null)
             {
                 ToolStripContentPanel contentPanel = parent.ContentPanel;
                 if (contentPanel != null)
                 {
                     PanelDesigner toInvoke = this.designerHost.GetDesigner(contentPanel) as PanelDesigner;
                     if (toInvoke != null)
                     {
                         ParentControlDesigner.InvokeCreateTool(toInvoke, tool);
                     }
                 }
             }
         }
         else
         {
             base.CreateToolCore(tool, x, y, width, height, hasLocation, hasSize);
         }
     }
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:ToolStripPanelDesigner.cs

示例3: GetCachedToolboxItem

 private static ToolboxItem GetCachedToolboxItem(System.Type itemType)
 {
     ToolboxItem toolboxItem = null;
     if (CachedToolboxItems == null)
     {
         CachedToolboxItems = new Dictionary<System.Type, ToolboxItem>();
     }
     else if (CachedToolboxItems.ContainsKey(itemType))
     {
         return CachedToolboxItems[itemType];
     }
     if (toolboxItem == null)
     {
         toolboxItem = ToolboxService.GetToolboxItem(itemType);
         if (toolboxItem == null)
         {
             toolboxItem = new ToolboxItem(itemType);
         }
     }
     CachedToolboxItems[itemType] = toolboxItem;
     if ((CustomToolStripItemCount > 0) && ((CustomToolStripItemCount * 2) < CachedToolboxItems.Count))
     {
         CachedToolboxItems.Clear();
     }
     return toolboxItem;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:26,代码来源:ToolStripDesignerUtils.cs

示例4: GetToolboxItemList

        public List<ToolboxItem> GetToolboxItemList()
        {
            List<dynamic> itemMetadataList = new List<dynamic>
            {
                new { DisplayName = "Place", Bitmap = Resources.Place, CommandName = "Place" },
                new { DisplayName = "Transition", Bitmap = Resources.Transition, CommandName = "Transition" },
                new { DisplayName = "AND-split", Bitmap = Resources.AndSplit, CommandName = "AndSplit" },
                new { DisplayName = "OR-split", Bitmap = Resources.OrSplit, CommandName = "OrSplit" },
                new { DisplayName = "AND-join", Bitmap = Resources.AndJoin, CommandName = "AndJoin" },
                new { DisplayName = "OR-join", Bitmap = Resources.OrJoin, CommandName = "OrJoin" },
                new { DisplayName = "Subprocess", Bitmap = Resources.Subprocess, CommandName = "Subprocess" },
            };

            List<ToolboxItem> result = new List<ToolboxItem>();
            foreach (dynamic metadata in itemMetadataList)
            {
                ToolboxItem toolboxItem = new ToolboxItem();
                toolboxItem.Properties.Add(
                    ItemCommandNameProperty,
                    new PetriNetEditorToolboxItemData
                    {
                        CommandName = metadata.CommandName
                    });

                toolboxItem.DisplayName = metadata.DisplayName;
                toolboxItem.Bitmap = metadata.Bitmap;

                result.Add(toolboxItem);
            }

            return result;
        }
开发者ID:YuriyGuts,项目名称:petrifier,代码行数:32,代码来源:PetriNetEditorToolboxProvider.cs

示例5: CreateReportingSidetab

		private static SideTab CreateReportingSidetab ()
		{
			SideTab sideTab = new SideTab("ReportDesigner");
			sideTab.CanSaved = false;
			AddPointerToSideTab(sideTab);
			
			// TextItem
			ToolboxItem tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseTextItem));
			tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.TextBox");
			tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16.16.SharpReport.Textbox").ToBitmap();
			sideTab.Items.Add(new SideTabItemDesigner(tb));	
			
			// Row
			tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseRowItem));
			tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table");
			tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataRow");
			sideTab.Items.Add(new SideTabItemDesigner(tb));
			
			
			//BaseTable
			tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table");
			tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseTableItem));
			tb.DisplayName ="Table";
			sideTab.Items.Add(new SideTabItemDesigner(tb));	
			
			
			
			tb.Bitmap = WinFormsResourceService.GetBitmap("Icons.16x16.SharpQuery.Table");
			//BaseDataItem
			tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseDataItem));
			tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.DataField");
			sideTab.Items.Add(new SideTabItemDesigner(tb));	
			
			//Grahics
			// Line
			tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseLineItem));
			tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Line");
			tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16.16.SharpReport.Line").ToBitmap();
			sideTab.Items.Add(new SideTabItemDesigner(tb));
			
			// Rectangle
			tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseRectangleItem));
			tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Rectangle");
			tb.Bitmap = GlobalValues.RectangleBitmap();
			sideTab.Items.Add(new SideTabItemDesigner(tb));
			
			// Circle
			tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseCircleItem));
			tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Circle");
			tb.Bitmap = GlobalValues.CircleBitmap();
			sideTab.Items.Add(new SideTabItemDesigner(tb));
			
		
			// Image
			tb = new ToolboxItem(typeof(ICSharpCode.Reports.Addin.BaseImageItem));
			tb.DisplayName = ResourceService.GetString("SharpReport.Toolbar.Image");
			tb.Bitmap = WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.bmp").ToBitmap();
			sideTab.Items.Add(new SideTabItemDesigner(tb));
			return sideTab;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:60,代码来源:ToolboxProvider.cs

示例6: CreateToolCore

	protected virtual IComponent[] CreateToolCore(ToolboxItem tool, 
					int x, int y, int width, int height,
					bool hasLocation, bool hasSize)
			{
				// TODO
				return null;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:ParentControlDesigner.cs

示例7: AddToolboxItem

		public void AddToolboxItem (ToolboxItem toolboxItem, string category)
		{
			if (!categories.ContainsKey (category))
				categories[category] = new ArrayList ();
			
			System.Diagnostics.Trace.WriteLine ("Adding ToolboxItem: " + toolboxItem.DisplayName + ", " + category);
			((ArrayList) categories[category]).Add (toolboxItem);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:ToolboxService.cs

示例8: SetSelectedToolboxItem

        public override void SetSelectedToolboxItem(ToolboxItem toolboxItem)
        {
            if (toolboxItem == null)
                base.SetSelectedToolboxItem(FindToolBoxItem(x => x.DisplayName == "Pointer"));
            else
                base.SetSelectedToolboxItem(toolboxItem);

        }
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:8,代码来源:FormsToolBoxService.cs

示例9: ToolboxPane

 public ToolboxPane()
 {
     this.InitializeComponent();
     this.pointer = new ToolboxItem();
     this.pointer.DisplayName = "<Zeiger>";
     this.pointer.Bitmap = new Bitmap(0x10, 0x10);
     this.FillToolbox();
     ListBox list = this.listWindowsForms;
 }
开发者ID:MuffPotter,项目名称:XamarinDesigner,代码行数:9,代码来源:ToolboxPane.cs

示例10: SideTabItemDesigner

		///<summary>create a tabitem from a toolboxitem. It init Icon and name from the tag</summary>
		public SideTabItemDesigner(ToolboxItem tag) : base(tag.DisplayName, tag)
		{
			if (tag == null) {
				throw new ArgumentNullException("tag");
			}
			CanBeRenamed = false;
			this.Icon = tag.Bitmap;
			ReloadToolBox();
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:10,代码来源:SideTabItemDesigner.cs

示例11: CreateToolCore

 protected override IComponent[] CreateToolCore(ToolboxItem tool, int x, int y, int width, int height, bool hasLocation, bool hasSize)
 {
     if (this.Selected == null)
     {
         this.Selected = this.splitterPanel1;
     }
     SplitterPanelDesigner toInvoke = (SplitterPanelDesigner) this.designerHost.GetDesigner(this.Selected);
     ParentControlDesigner.InvokeCreateTool(toInvoke, tool);
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:SplitContainerDesigner.cs

示例12: ToolCursor

 /// <summary>
 /// Initializes a new instance of the <see cref="ToolCursor"/> class.
 /// </summary>
 /// <param name="item">A <see cref="ToolboxItem"/> object.</param>
 public ToolCursor(ToolboxItem item)
 {
     this._item = item;
     if (item.Bitmap != null) {
         using (Bitmap bitmap = this.CreateCursor(item.Bitmap)) {
             this._hIcon = bitmap.GetHicon();
             this._cursor = new Cursor(this._hIcon);
         }
     }
 }
开发者ID:hksonngan,项目名称:sharptracing,代码行数:14,代码来源:ToolCursor.cs

示例13: ToolboxItemToolboxNode

        public ToolboxItemToolboxNode(ToolboxItem item)
        {
            this.item = item;
            base.Name = item.DisplayName;
            if (item.Bitmap != null)
                base.Icon = base.ImageToPixbuf (item.Bitmap);

            if (item.AssemblyName != null)
                foreach (System.ComponentModel.CategoryAttribute ca in
                    System.Reflection.Assembly.Load (item.AssemblyName)
                    .GetType (item.TypeName)
                    .GetCustomAttributes (typeof (System.ComponentModel.CategoryAttribute), true))
                    this.Category = ca.Category;
        }
开发者ID:mono,项目名称:aspeditor,代码行数:14,代码来源:ToolboxItemToolboxNode.cs

示例14: CreateToolCore

 protected override IComponent[] CreateToolCore(ToolboxItem tool, int x, int y, int width, int height, bool hasLocation, bool hasSize)
 {
     TabControl control = (TabControl) this.Control;
     if (control.SelectedTab == null)
     {
         throw new ArgumentException(System.Design.SR.GetString("TabControlInvalidTabPageType", new object[] { tool.DisplayName }));
     }
     IDesignerHost service = (IDesignerHost) this.GetService(typeof(IDesignerHost));
     if (service != null)
     {
         TabPageDesigner toInvoke = (TabPageDesigner) service.GetDesigner(control.SelectedTab);
         ParentControlDesigner.InvokeCreateTool(toInvoke, tool);
     }
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:TabControlDesigner.cs

示例15: ToolBoxListItem

        public ToolBoxListItem(ToolboxItem toolBoxItem)
        {
            Size = new Size (150, 20);

            SetStyle (ControlStyles.ResizeRedraw, true);

            Text = toolBoxItem.DisplayName;

            if (toolBoxItem.Bitmap != null)
                image = toolBoxItem.Bitmap;
            else
                image = SystemIcons.Exclamation.ToBitmap ();

            tool_box_item = toolBoxItem;
        }
开发者ID:himdel,项目名称:mwf-designer,代码行数:15,代码来源:ToolBoxListItem.cs


注:本文中的System.Drawing.Design.ToolboxItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。