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


C# ToolStripItem.GetType方法代码示例

本文整理汇总了C#中System.Windows.Forms.ToolStripItem.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStripItem.GetType方法的具体用法?C# ToolStripItem.GetType怎么用?C# ToolStripItem.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ToolStripItem的用法示例。


在下文中一共展示了ToolStripItem.GetType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitializeItem

        protected override void InitializeItem(ToolStripItem item)
        {
            base.InitializeItem(item);

            if (item.GetType() == typeof(ToolStripSeparator))
            {
                var castItem = (ToolStripSeparator)item;
                if (!castItem.IsOnDropDown)
                    item.Margin = new Padding(0, 0, 2, 0);
            }

            if (item.GetType() == typeof(ToolStripButton))
            {
                item.AutoSize = false;
                item.Size = new Size(24, 24);
            }
        }
开发者ID:ZANEKEVIN,项目名称:DarkUI,代码行数:17,代码来源:DarkToolStripRenderer.cs

示例2: InitializeItem

        protected override void InitializeItem(ToolStripItem item)
        {
            base.InitializeItem(item);

            item.ForeColor = Colors.LightText;

            if (item.GetType() == typeof(ToolStripSeparator))
            {
                item.Margin = new Padding(0, 0, 0, 1);
            }
        }
开发者ID:ZANEKEVIN,项目名称:DarkUI,代码行数:11,代码来源:DarkMenuRenderer.cs

示例3: GetNewItemDropDown

 public static NewItemsContextMenuStrip GetNewItemDropDown(IComponent component, ToolStripItem currentItem, EventHandler onClick, bool convertTo, IServiceProvider serviceProvider, bool populateCustom)
 {
     NewItemsContextMenuStrip contextMenu = new NewItemsContextMenuStrip(component, currentItem, onClick, convertTo, serviceProvider);
     contextMenu.GroupOrdering.Add("StandardList");
     contextMenu.GroupOrdering.Add("CustomList");
     foreach (ToolStripItem item in GetStandardItemMenuItems(component, onClick, convertTo))
     {
         contextMenu.Groups["StandardList"].Items.Add(item);
         if (convertTo)
         {
             ItemTypeToolStripMenuItem item2 = item as ItemTypeToolStripMenuItem;
             if (((item2 != null) && (currentItem != null)) && (item2.ItemType == currentItem.GetType()))
             {
                 item2.Enabled = false;
             }
         }
     }
     if (populateCustom)
     {
         GetCustomNewItemDropDown(contextMenu, component, currentItem, onClick, convertTo, serviceProvider);
     }
     IUIService service = serviceProvider.GetService(typeof(IUIService)) as IUIService;
     if (service != null)
     {
         contextMenu.Renderer = (ToolStripProfessionalRenderer) service.Styles["VsRenderer"];
         contextMenu.Font = (Font) service.Styles["DialogFont"];
         if (service.Styles["VsColorPanelText"] is System.Drawing.Color)
         {
             contextMenu.ForeColor = (System.Drawing.Color) service.Styles["VsColorPanelText"];
         }
     }
     contextMenu.Populate();
     return contextMenu;
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:34,代码来源:ToolStripDesignerUtils.cs

示例4: GetCustomNewItemDropDown

 public static void GetCustomNewItemDropDown(NewItemsContextMenuStrip contextMenu, IComponent component, ToolStripItem currentItem, EventHandler onClick, bool convertTo, IServiceProvider serviceProvider)
 {
     foreach (ToolStripItem item in GetCustomItemMenuItems(component, onClick, convertTo, serviceProvider))
     {
         contextMenu.Groups["CustomList"].Items.Add(item);
         if (convertTo)
         {
             ItemTypeToolStripMenuItem item2 = item as ItemTypeToolStripMenuItem;
             if (((item2 != null) && (currentItem != null)) && (item2.ItemType == currentItem.GetType()))
             {
                 item2.Enabled = false;
             }
         }
     }
     contextMenu.Populate();
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:16,代码来源:ToolStripDesignerUtils.cs

示例5: GetNewItemDropDown

 public static ToolStripDropDown GetNewItemDropDown(IComponent component, ToolStripItem currentItem, EventHandler onClick, bool convertTo, IServiceProvider serviceProvider)
 {
     NewItemsContextMenuStrip strip = new NewItemsContextMenuStrip(component, currentItem, onClick, convertTo, serviceProvider);
     strip.GroupOrdering.Add("StandardList");
     strip.GroupOrdering.Add("CustomList");
     foreach (ToolStripItem item in GetStandardItemMenuItems(component, onClick, convertTo))
     {
         strip.Groups["StandardList"].Items.Add(item);
         if (convertTo)
         {
             ItemTypeToolStripMenuItem item2 = item as ItemTypeToolStripMenuItem;
             if (((item2 != null) && (currentItem != null)) && (item2.ItemType == currentItem.GetType()))
             {
                 item2.Enabled = false;
             }
         }
     }
     foreach (ToolStripItem item3 in GetCustomItemMenuItems(component, onClick, convertTo, serviceProvider))
     {
         strip.Groups["CustomList"].Items.Add(item3);
         if (convertTo)
         {
             ItemTypeToolStripMenuItem item4 = item3 as ItemTypeToolStripMenuItem;
             if (((item4 != null) && (currentItem != null)) && (item4.ItemType == currentItem.GetType()))
             {
                 item4.Enabled = false;
             }
         }
     }
     IUIService service = serviceProvider.GetService(typeof(IUIService)) as IUIService;
     if (service != null)
     {
         strip.Renderer = (ToolStripProfessionalRenderer) service.Styles["VsRenderer"];
         strip.Font = (Font) service.Styles["DialogFont"];
     }
     strip.Populate();
     return strip;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:38,代码来源:ToolStripDesignerUtils.cs

示例6: OnMouseDown

 protected override void OnMouseDown(MouseEventArgs e) {
     if(fReorderEnabled) {
         mouseButtons = e.Button;
         draggingItem = GetItemAt(e.Location);
         if((draggingItem != null) && string.Equals(draggingItem.GetType().ToString(), "System.Windows.Forms.ToolStripScrollButton")) {
             draggingItem = null;
         }
     }
     base.OnMouseDown(e);
 }
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:10,代码来源:DropDownMenuReorderable.cs

示例7: updateMenuEvents

        public static Hashtable updateMenuEvents(ToolStripItem control, string elementName, string uniqueId)
        {
            Hashtable controlProperties = new Hashtable();
            string eibCOntrolInterfaceName = (typeof(IEIBControl)).Name;
            if (control.GetType().GetInterface(eibCOntrolInterfaceName) != null)
            {

                IEIBControl eibControl = (IEIBControl)control;
                if (eibControl.OnClickValue != null && !eibControl.OnClickValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeOnClickElt, eibControl.OnClickValue);
                }
                if (eibControl.OnDoubleClick != null && !eibControl.OnDoubleClick.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeOnDoubleClickElt, eibControl.OnDoubleClick);
                }
                if (eibControl.EnteringValue != null && !eibControl.EnteringValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeEnteringElt, eibControl.EnteringValue);
                }
                if (eibControl.ExitingValue != null && !eibControl.ExitingValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeExitingElt, eibControl.ExitingValue);
                }
                if (eibControl.DefaultValue != null && !eibControl.DefaultValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeDefaultValueElt, eibControl.DefaultValue);
                }
            }
            //EIBControl Settings
            return controlProperties;
        }
开发者ID:harpreetoxyent,项目名称:pnl,代码行数:32,代码来源:WorkflowXMLServices.cs

示例8: RecursiveGetToolStripItems

        private static IEnumerable<Control> RecursiveGetToolStripItems(ToolStripItem item, Control x)
        {
            if (item is ToolStripDropDownItem)
            {
                foreach (ToolStripItem t in ((ToolStripDropDownItem) item).DropDownItems)
                {
                    if (item.GetType().FullName.IndexOf("MvvmFx.", StringComparison.InvariantCulture) != 0)
                    {
#if WINFORMS
                        yield return new ToolStripItemProxy(t, x.Parent, true);
#else
                        yield return new ToolStripItemProxy(t, x, true);
#endif
                    }
                    foreach (var toolStripItems in RecursiveGetToolStripItems(t, x))
                        yield return toolStripItems;
                }
            }
        }
开发者ID:tfreitasleal,项目名称:MvvmFx,代码行数:19,代码来源:WinFormExtensionMethods.cs

示例9: updateMenuEvents

        public static Hashtable updateMenuEvents(ToolStripItem control, string elementName, string uniqueId)
        {
            Hashtable controlProperties = new Hashtable();
            string eibCOntrolInterfaceName = (typeof(IEIBControl)).Name;
            if (control.GetType().GetInterface(eibCOntrolInterfaceName) != null)
            {

                IEIBControl eibControl = (IEIBControl)control;
                if (eibControl.OnClickValue != null && !eibControl.OnClickValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeOnClickElt, eibControl.OnClickValue);
                }
                if (eibControl.OnDoubleClick != null && !eibControl.OnDoubleClick.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeOnDoubleClickElt, eibControl.OnDoubleClick);
                }
                if (eibControl.EnteringValue != null && !eibControl.EnteringValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeEnteringElt, eibControl.EnteringValue);
                }
                if (eibControl.ExitingValue != null && !eibControl.ExitingValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeExitingElt, eibControl.ExitingValue);
                }
                if (eibControl.DefaultValue != null && !eibControl.DefaultValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeDefaultValueElt, eibControl.DefaultValue);
                }
                if (eibControl is EIBPanel)
                {
                    if (((EIBPanel)eibControl).GlobalScripts != null && !((EIBPanel)eibControl).GlobalScripts.Trim().Equals(""))
                    {
                        controlProperties.Add(XMLServicesConstants.XmlNodeGlobalScriptsElt, ((EIBPanel)eibControl).GlobalScripts);
                    }
                }
                if (eibControl is EIBTreeNode)
                {
                    if (((EIBTreeNode)eibControl).OnOpen != null && !((EIBTreeNode)eibControl).OnOpen.Trim().Equals(""))
                    {
                        controlProperties.Add(XMLServicesConstants.XmlNodeOnOpenElt, ((EIBTreeNode)eibControl).OnOpen);
                    }
                }
                if (eibControl is EIBTreeView)
                {
                    if (((EIBTreeView)eibControl).OnSelect != null && !((EIBTreeView)eibControl).OnSelect.Trim().Equals(""))
                    {
                        controlProperties.Add(XMLServicesConstants.XmlNodeOnSelectElt, ((EIBTreeView)eibControl).OnSelect);
                    }
                }
            }
            //EIBControl Settings
            return controlProperties;
        }
开发者ID:harpreetoxyent,项目名称:pnl,代码行数:53,代码来源:XMLServices.cs


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