Example #1
0
        public ConfigForm(DeviceClass SelectedDevice)
        {
            InitializeComponent();

            Debug.Assert(SelectedDevice != null, "Invalid SelectedDevice!");
            this.CurrentDevice = SelectedDevice;

            //暂时不支持以下界面;
            this.tabControl.TabPages.Remove(this.tabPage_PPP);
            this.tabControl.TabPages.Remove(this.tabPage_PPPoE);
        }
Example #2
0
        /// <summary>
        /// 集中处理操作返回错误码,并生成错误说明信息;
        /// </summary>
        /// <param name="eCode">tagErrorCode</param>
        /// <returns>错误说明信息</returns>
        public static string HandleDeviceError(DevControl.tagErrorCode eCode, DeviceClass device)
        {
            string errorMsg;

            if (eCode == DevControl.tagErrorCode.DM_ERR_NOAUTH)
            {
                LoginForm    loginform = new LoginForm();
                DialogResult result    = loginform.ShowDialog();
                if (result == DialogResult.OK)
                {
                    eCode = device.Login(loginform.UserName, loginform.Password);
                }
            }

            errorMsg = HandleError(eCode);

            return(errorMsg);
        }