示例#1
0
文件: frmMain.cs 项目: leadscloud/lx
        /// <summary>
        ///
        /// </summary>
        /// <param name="ditchDevice"></param>
        private void ShowDitchDevice(DitchDevice ditchDevice)
        {
            UCDitchDevice uc = GetUDDitchDevice();

            OnlyVisible(uc);
            uc.DitchDevice = ditchDevice;
        }
示例#2
0
文件: frmMain.cs 项目: leadscloud/lx
        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private Control GetUC(Type type)
        {
            foreach (Control c in this.panel1.Controls)
            {
                if (c.GetType() == type)
                {
                    return(c);
                }
            }

            Control nc = null;

            if (type == typeof(UCDitchDevice))
            {
                nc = new UCDitchDevice();
            }
            else if (type == typeof(UCXD202Device))
            {
                nc = new UCXD202Device();
            }
            else if (type == typeof(UCLXRainDevice))
            {
                nc = new UCLXRainDevice();
            }
            else
            {
                string s = string.Format("", type);
                throw new NotImplementedException(s);
            }

            this.panel1.Controls.Add(nc);
            return(nc);
        }
示例#3
0
文件: frmMain.cs 项目: hkiaipc/lx
        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private Control GetUC(Type type)
        {
            foreach (Control c in this.panel1.Controls)
            {
                if (c.GetType() == type)
                    return c;
            }

            Control nc = null;
            if (type == typeof(UCDitchDevice))
            {
                nc = new UCDitchDevice();
            }
            else if (type == typeof(UCXD202Device))
            {
                nc = new UCXD202Device();
            }
            else if (type == typeof(UCLXRainDevice) )
            {
                nc = new UCLXRainDevice();
            }
            else
            {
                string s = string.Format("", type);
                throw new NotImplementedException(s);
            }

            this.panel1.Controls.Add(nc);
            return nc;
        }