private void DetailContentImproved_Load(object sender, EventArgs e)
        {
            try
            {
                UISyncContext = TaskScheduler.FromCurrentSynchronizationContext();
                ErrorTip      = new ErrorTip();

                if (Backend == null)
                {
                    Backend = new FISCA.Data.QueryHelper();
                }
            }
            catch
            {
            }
        }
        private void GRBLMachinePlugin_Responding(GRBLMachinePlugin.Response response, int code)
        {
            switch (response)
            {
            case GRBLMachinePlugin.Response.alarm:
                SystemSounds.Hand.Play();
                if (code > 0)
                {
                    AlarmTip.Show(ConnectionExpander.AlarmDict[code], this, 0, 0, 10000);
                }
                break;

            case GRBLMachinePlugin.Response.error:
                SystemSounds.Beep.Play();
                if (code > 0)
                {
                    ErrorTip.Show(ConnectionExpander.ErrorDict[code], this, 0, Height, 10000);
                }
                break;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnSaveButtonClick(EventArgs e)
        {
            base.OnSaveButtonClick(e);

            ErrorTip.Clear();
            Dictionary <Control, string> errors = new Dictionary <Control, string>();

            try
            {
                RemoveErrorPanel();
                OnValidateData(errors);
            }
            catch (Exception ex)
            {
                ShowErrorPanel(ex);
                return;
            }

            if (errors.Count > 0)
            {
                foreach (KeyValuePair <Control, string> error in errors)
                {
                    ErrorTip.SetError(error.Key, error.Value);
                }
                return;
            }

            try
            {
                RemoveErrorPanel();
                OnSaveData();
            }
            catch (Exception ex)
            {
                ShowErrorPanel(ex);
            }
        }
Exemplo n.º 4
0
        private void Student_Address_Load(object sender, EventArgs e)
        {
            _errors = new ErrorTip();
            _warnings = new ErrorTip();

            BGWorker = new BackgroundWorker();
            BGWorker.DoWork += new DoWorkEventHandler(BGWorker_DoWork);
            BGWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BGWorker_RunWorkerCompleted);

            _DataListener_Permanent = new ChangeListen();
            _DataListener_Mailing = new ChangeListen();
            _DataListener_Other = new ChangeListen();

            _DataListener_Permanent.StatusChanged += new EventHandler<ChangeEventArgs>(_DataListener_Permanent_StatusChanged);
            _DataListener_Mailing.StatusChanged += new EventHandler<ChangeEventArgs>(_DataListener_Mailing_StatusChanged);
            _DataListener_Other.StatusChanged += new EventHandler<ChangeEventArgs>(_DataListener_Other_StatusChanged);

            CountyTownDownloadTask = Task.Factory.StartNew(() =>
            {
                //XmlElement �i�H�૬�� XmlObject�C
                CountyTownList = (XmlObject)Config.App["�m����ϦC��"].PreviousData;
            });

            // �[�J���y Listener Data
            _DataListener_Permanent.Add(new TextBoxSource(txtZipcode));
            _DataListener_Permanent.Add(new ComboBoxSource(cboCounty, ComboBoxSource.ListenAttribute.Text));
            _DataListener_Permanent.Add(new ComboBoxSource(cboTown, ComboBoxSource.ListenAttribute.Text));
            _DataListener_Permanent.Add(new TextBoxSource(txtDistrict));
            _DataListener_Permanent.Add(new TextBoxSource(txtArea));
            _DataListener_Permanent.Add(new TextBoxSource(txtDetail));
            _DataListener_Permanent.Add(new TextBoxSource(txtLongtitude));
            _DataListener_Permanent.Add(new TextBoxSource(txtLatitude));

            // �[�J�q�T Listener Data
            _DataListener_Mailing.Add(new TextBoxSource(txtZipcode));
            _DataListener_Mailing.Add(new ComboBoxSource(cboCounty, ComboBoxSource.ListenAttribute.Text));
            _DataListener_Mailing.Add(new ComboBoxSource(cboTown, ComboBoxSource.ListenAttribute.Text));
            _DataListener_Mailing.Add(new TextBoxSource(txtDistrict));
            _DataListener_Mailing.Add(new TextBoxSource(txtArea));
            _DataListener_Mailing.Add(new TextBoxSource(txtDetail));
            _DataListener_Mailing.Add(new TextBoxSource(txtLongtitude));
            _DataListener_Mailing.Add(new TextBoxSource(txtLatitude));

            // �[�J�䥦 Listener Data
            _DataListener_Other.Add(new TextBoxSource(txtZipcode));
            _DataListener_Other.Add(new ComboBoxSource(cboCounty, ComboBoxSource.ListenAttribute.Text));
            _DataListener_Other.Add(new ComboBoxSource(cboTown, ComboBoxSource.ListenAttribute.Text));
            _DataListener_Other.Add(new TextBoxSource(txtDistrict));
            _DataListener_Other.Add(new TextBoxSource(txtArea));
            _DataListener_Other.Add(new TextBoxSource(txtDetail));
            _DataListener_Other.Add(new TextBoxSource(txtLongtitude));
            _DataListener_Other.Add(new TextBoxSource(txtLatitude));

            Address.AfterUpdate += new EventHandler<K12.Data.DataChangedEventArgs>(JHAddress_AfterUpdate);

            //_address_type = AddressType.Permanent;
            _address_type = AddressType.Mailing;

            _getCountyBackgroundWorker = new BackgroundWorker();
            _getCountyBackgroundWorker.DoWork += new DoWorkEventHandler(_getCountyBackgroundWorker_DoWork);
            _getCountyBackgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_getCountyBackgroundWorker_RunWorkerCompleted);
            _getCountyBackgroundWorker.RunWorkerAsync();

            if (UserAcl.Current["Content0050"].Editable)
                return;

            if (UserAcl.Current["Content0050"].Viewable)
                this.Enabled = false;

            Disposed += new EventHandler(AddressPalmerwormItem_Disposed);
        }