コード例 #1
0
ファイル: frmMain.cs プロジェクト: leadscloud/lx
        /// <summary>
        ///
        /// </summary>
        /// <param name="xD202Device"></param>
        private void ShowXD202Device(XD202Device xD202Device)
        {
            UCXD202Device uc = GetUCXD202Device();

            OnlyVisible(uc);
            uc.XD202Device = xD202Device;
        }
コード例 #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;
        }