當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。