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


C# ControlType.ToString方法代码示例

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


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

示例1: ReadLocalizationConfig

        public static Dictionary<string, string> ReadLocalizationConfig(ControlType controlType)
        {
            string configPath = string.Format(configPathFormat, controlType.ToString(), RunTimeLocaliationTypeString);

            Dictionary<string, string> dicNameValue = new Dictionary<string, string>();

            if (File.Exists(configPath))
            {
                XmlDocument xd = new XmlDocument();
                xd.Load(configPath);

                XmlNodeList xnDataList = xd.SelectNodes("configuration/root/data");

                foreach (XmlNode xn in xnDataList)
                {
                    if (!dicNameValue.Keys.Contains(xn.Attributes["name"].Value))
                    {
                        dicNameValue.Add(xn.Attributes["name"].Value,xn.Attributes["value"].Value);
                    }
                }
            }

           
            return dicNameValue;
        }
开发者ID:zjk537,项目名称:CRM_4S,代码行数:25,代码来源:LocalizationConfigHandler.cs

示例2: ConvertToWControl

        internal static Wix.Control ConvertToWControl(this IWixControl srcControl, ControlType controlType)
        {
            var wControl = new Wix.Control { Type = controlType.ToString() };

            wControl.CopyCommonPropertiesFrom(srcControl);

            return wControl;
        }
开发者ID:denis-peshkov,项目名称:WixSharp,代码行数:8,代码来源:Extensions.cs

示例3: getControl

 UITestControl getControl(ControlType controlType, BrowserWindow browser, string buttonId)
 {
     UITestControl button = new UITestControl(browser);
        button.TechnologyName = "Web";
        var controlTypeString = controlType.ToString();
        button.SearchProperties.Add("ControlType", controlTypeString);
        button.SearchProperties.Add("Id", buttonId);
        var buttons = button.FindMatchingControls();
        button.Find();
        return button;
 }
开发者ID:Jassbrain,项目名称:jassplan,代码行数:11,代码来源:JpBigTest.cs

示例4: Add

        /// <summary>
        /// Add method for Trackbar control
        /// </summary>
        /// <param name="ct">Control type [TrackBar]</param>
        /// <param name="thumb">Thumb image</param>
        /// <param name="track">Track image</param>
        public void Add(ControlType ct, Bitmap thumb, Bitmap track)
        {
            if (thumb == null)
                throw new Exception("Required image is either missing or invalid.");
            if (track == null)
                throw new Exception("Required image is either missing or invalid.");

            List<IntPtr> list = GetChildWindows(_hParentWnd);
            StringBuilder nameBldr = new StringBuilder(100);
            string ctlname = ct.ToString().ToLower();
            if (ctlname == "trackbar")
            {
                if (_oTrackBarSkin == null)
                    _oTrackBarSkin = new Dictionary<IntPtr, cTrackBar>();

                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i] != IntPtr.Zero)
                    {
                        Control ctl = Control.FromHandle(list[i]);
                        if (ctl != null)
                        {
                            Type t = ctl.GetType();
                            string name = t.Name.ToLower();
                            if (name == ctlname)
                            {
                                _oTrackBarSkin.Add(ctl.Handle, new cTrackBar(ctl.Handle, thumb, track));
                                ctl.Refresh();
                            }
                        }
                    }
                }
            }
        }
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:40,代码来源:cRCM.cs

示例5: Remove

        /// <summary>
        /// Remove a control group from the skin engine
        /// </summary>
        /// <param name="ct">Control type</param>
        public void Remove(ControlType ct)
        {
            List<IntPtr> list = GetChildWindows(_hParentWnd);
            StringBuilder nameBldr = new StringBuilder(100);
            string ctlname = ct.ToString().ToLower();

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] != IntPtr.Zero)
                {
                    Control ctl = Control.FromHandle(list[i]);
                    if (ctl != null)
                    {
                        Type t = ctl.GetType();
                        string name = t.Name.ToLower();

                        if ((ctlname == "checkbox") || (ctlname == "radiobutton") || (ctlname == "button"))
                        {
                            if (name == ctlname)
                            {
                                _cButtonSkin.Remove(list[i]);
                                ctl.Refresh();
                            }
                        }
                        else if (ctlname == "combobox")
                        {
                            if (_oComboSkin.ContainsKey(list[i]))
                            {
                                _oComboSkin[list[i]].Dispose();
                                _oComboSkin.Remove(list[i]);
                                ctl.Refresh();
                            }
                        }
                        else if (ctlname == "listbox")
                        {
                            if (_oListboxSkin.ContainsKey(list[i]))
                            {
                                _oListboxSkin[list[i]].Dispose();
                                _oListboxSkin.Remove(list[i]);
                                ctl.Refresh();
                            }
                        }
                        else if (ctlname == "listview")
                        {
                            if (_oListviewSkin.ContainsKey(list[i]))
                            {
                                _oListviewSkin[list[i]].Dispose();
                                _oListviewSkin.Remove(list[i]);
                                ctl.Refresh();
                            }
                        }
                        else if (ctlname == "numericupdown")
                        {
                            if (_oNumericUpDownSkin.ContainsKey(list[i]))
                            {
                                _oNumericUpDownSkin[list[i]].Dispose();
                                _oNumericUpDownSkin.Remove(list[i]);
                                ctl.Refresh();
                            }
                        }
                        else if (ctlname == "progressbar")
                        {
                            if (_oProgressBarSkin.ContainsKey(list[i]))
                            {
                                _oProgressBarSkin[list[i]].Dispose();
                                _oProgressBarSkin.Remove(list[i]);
                                ctl.Refresh();
                            }
                        }
                        else if (ctlname == "tabcontrol")
                        {
                            if (_oTabControlSkin.ContainsKey(list[i]))
                            {
                                _oTabControlSkin[list[i]].Dispose();
                                _oTabControlSkin.Remove(list[i]);
                                ctl.Refresh();
                            }
                        }
                        else if (ctlname == "tracksbar")
                        {
                            if (_oTrackBarSkin.ContainsKey(list[i]))
                            {
                                _oTrackBarSkin[list[i]].Dispose();
                                _oTrackBarSkin.Remove(list[i]);
                                ctl.Refresh();
                            }
                        }
                        else if (ctlname == "treeview")
                        {
                            if (_oTreeviewSkin.ContainsKey(list[i]))
                            {
                                _oTreeviewSkin[list[i]].Dispose();
                                _oTreeviewSkin.Remove(list[i]);
                                ctl.Refresh();
                            }
                        }
//.........这里部分代码省略.........
开发者ID:ViniciusConsultor,项目名称:ecustomsgs1,代码行数:101,代码来源:cRCM.cs


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