• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Design.ToolboxItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SideTabDesigner

		///<summary>Load an assembly's controls</summary>
		public SideTabDesigner(SideBarControl sideBar, Category category, IToolboxService toolboxService) : this(sideBar, category.Name, toolboxService)
		{
			foreach (ToolComponent component in category.ToolComponents) {
				if (component.IsEnabled) {
					ToolboxItem toolboxItem = new ToolboxItem();
					toolboxItem.TypeName    = component.FullName;
					toolboxItem.Bitmap      = ToolboxProvider.ComponentLibraryLoader.GetIcon(component);
					toolboxItem.DisplayName = component.Name;
					Assembly asm = component.LoadAssembly();
					toolboxItem.AssemblyName = asm.GetName();
					
					this.Items.Add(new SideTabItemDesigner(toolboxItem));
				}
			}
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:16,代码来源:SideTabDesigner.cs


示例17: LookupToolboxItem

        /// <summary>
        /// Find the activity, if any, associated with ToolboxItem
        /// </summary>
        private static ActivityItem LookupToolboxItem(ToolboxItem itemToFind, IEnumerable<ActivityAssemblyItem> activityAssemblyItems)
        {
            if (itemToFind == null)
            {
                return null;
            }

            ActivityAssemblyItem hostActivityAssemblyItem =
                activityAssemblyItems.FirstOrDefault(
                    aai => aai.Matches(itemToFind.AssemblyName));

            if (hostActivityAssemblyItem != null)
            {
                return hostActivityAssemblyItem.ActivityItems.FirstOrDefault(ai => ai.FullName == itemToFind.TypeName);
            }
            return null;
        }
开发者ID:barbarossia,项目名称:CWF,代码行数:20,代码来源:MainWindow.xaml.cs


示例18: ToolboxItemToolboxNode

		public ToolboxItemToolboxNode (ToolboxItem item)
			: base (item.TypeName, item.AssemblyName.FullName)
		{
			base.Name = item.DisplayName;
			if (item.Bitmap != null)
				base.Icon = ImageToPixbuf (item.Bitmap);
			
			foreach (ToolboxItemFilterAttribute tbfa in item.Filter)
				base.ItemFilters.Add (tbfa);
			
			//we only need to serialise the ToolboxItem if it is non-standard, because we can reliably recreate the two built-in types
			if (item.GetType () == typeof (ToolboxItem))
				toolboxItemType = null; //no-op, but this has consequences 	
			else if (item.GetType () == typeof (System.Web.UI.Design.WebControlToolboxItem))
				toolboxItemType = new TypeReference (typeof (System.Web.UI.Design.WebControlToolboxItem));
			else {
				serializedToolboxItem = SerializeToolboxItem (item);
				toolboxItemType = new TypeReference (item.GetType ());
			} 
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:20,代码来源:ToolboxItemToolboxNode.cs


示例19: ToolboxItemContainer

 public ToolboxItemContainer(ToolboxItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     this._toolboxItem = item;
     this.UpdateFilter(item);
     this._hashCode = item.DisplayName.GetHashCode();
     if (item.AssemblyName != null)
     {
         this._hashCode ^= item.AssemblyName.GetHashCode();
     }
     if (item.TypeName != null)
     {
         this._hashCode ^= item.TypeName.GetHashCode();
     }
     if (this._hashCode == 0)
     {
         this._hashCode = item.DisplayName.GetHashCode();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:ToolboxItemContainer.cs


示例20: WebFormsToolboxNode

		public WebFormsToolboxNode (ToolboxItem item) : base (item)
		{
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:3,代码来源:WebFormsToolboxNode.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Drawing2D.Blend类代码示例发布时间:2022-05-26
下一篇:
C# Design.PaintValueEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap