當前位置: 首頁>>代碼示例>>C#>>正文


C# ToolboxItem.GetType方法代碼示例

本文整理匯總了C#中System.Drawing.Design.ToolboxItem.GetType方法的典型用法代碼示例。如果您正苦於以下問題:C# ToolboxItem.GetType方法的具體用法?C# ToolboxItem.GetType怎麽用?C# ToolboxItem.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Drawing.Design.ToolboxItem的用法示例。


在下文中一共展示了ToolboxItem.GetType方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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

示例2: 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

示例3: GetType_Null

		public void GetType_Null ()
		{
			ToolboxItem item = new ToolboxItem ();
			Assert.IsNull (item.GetType (null), "GetType(null)");
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:5,代碼來源:TestToolboxItem.cs

示例4: 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(StatusStrip).IsAssignableFrom(c))
         {
             ParentControlDesigner.InvokeCreateTool(this.GetDesigner(this.bottomToolStripPanel), tool);
         }
         else if (typeof(ToolStrip).IsAssignableFrom(c))
         {
             ParentControlDesigner.InvokeCreateTool(this.GetDesigner(this.topToolStripPanel), tool);
         }
         else
         {
             ParentControlDesigner.InvokeCreateTool(this.GetDesigner(this.contentToolStripPanel), tool);
         }
     }
     return null;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:20,代碼來源:ToolStripContainerDesigner.cs


注:本文中的System.Drawing.Design.ToolboxItem.GetType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。