private void InitCloudElevatorItemsUI()
 {
     f_UCloudElevatorItems = new Dictionary <int, CloudElevatorItemUserControl>();
     for (int i = 1; i <= AppConst.LINKAGE_CTRL_CLOUD_ELEVATOR_MAX_COUNT; i++)
     {
         CloudElevatorItemUserControl uc = UtilityTool.ShowUserControl <CloudElevatorItemUserControl>(this.sclCtrlItems, DockStyle.Top);
         uc.ItemId = i;
         f_UCloudElevatorItems.Add(i, uc);
     }
 }
Beispiel #2
0
        /// <summary>
        /// 动态加载窗体到pnlReportContainer
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="ucName"></param>
        private void ShowUserControl <T>(string ucName) where T : GeneralDeviceUserControl
        {
            foreach (GeneralDeviceUserControl userControl in f_UserControls.Values)
            {
                userControl.Visible = false;
            }
            if (f_UserControls.ContainsKey(ucName))
            {
                GeneralUserControl uc = f_UserControls[ucName];
                uc.Visible = true;
                uc.BringToFront();
                return;
            }
            HintProvider.StartWaiting(null, "正在加载", "", Application.ProductName, showDelay: 0, showCloseButtonDelay: int.MaxValue);
            T t = UtilityTool.ShowUserControl <T>(this.pnlReportContainer);

            //绑定udp监听器到pnlReportContainer
            t.UdpListener = f_UdpListener;
            //绑定接收数据的函数
            t.UdpListener.RecvCallback += t.RecvCallBack;
            f_UserControls.Add(ucName, t);
        }