Beispiel #1
0
        private void GetHotButtonItem()
        {
            if (this.Controls.Count == 0)
            {
                return;
            }

            for (int i = 0; i < this._lstButton.Count; i++)
            {
                HotButtonItemInfo item = new HotButtonItemInfo();
                item.Name = string.Empty;

                if (_lstButton[i] != null)
                {
                    object btnCtrl = (_lstButton[i] as PanelControl).Controls[0];
                    if (btnCtrl.GetType() == typeof(LargeButtonControl))
                    {
                        LargeButtonControl btn = btnCtrl as LargeButtonControl;
                        item = GetLargeButtonItemContent(btn);
                    }
                    else
                    {
                        SmallButtonControl btn = btnCtrl as SmallButtonControl;
                        item = GetSmallButtonItemContent(btn);
                    }
                }

                _hotButtonItems.Add(item);
            }
        }
Beispiel #2
0
        private HotButtonItemInfo GetSmallButtonItemContent(SmallButtonControl btn)
        {
            HotButtonItemInfo item = new HotButtonItemInfo();

            item.CreateTime      = DateTime.Now;
            item.Id              = Guid.NewGuid().ToString();
            item.Name            = btn.ButtonName;
            item.Sign            = btn.Sign;
            item.SubHotKey       = btn.SubHotKey;
            item.MainHotKey      = btn.MainHotKey;
            item.ButtonBackColor = btn.ButtonColor;
            item.IsLarge         = false;
            item.ButtonName      = btn.ButtonName;
            return(item);
        }