Exemplo n.º 1
0
        private void btn_next_Click(object sender, RoutedEventArgs e)
        {
            WizardEventArg eee = new WizardEventArg();

            if (!btn_next.Content.Equals("完成"))
            {
                if (OnStepChanged != null)
                {
                    OnStepChanged(CurrStep, CurrStep + 1, eee);
                }
                if (eee.Cancel)
                {
                    return;
                }
                CurrStep++;
                if (CurrStep <= TotalStep)
                {
                    btn_prev.IsEnabled = true;
                    tab1.SelectedIndex = CurrStep - 1;
                    SetStepLbls(CurrStep);
                    if (CurrStep == TotalStep)
                    {
                        btn_next.Content = "完成";
                    }
                }
            }
            else
            {
                JControlOutputData data1 = Communicator == null ? null : Communicator.OutputProperty();
                JControlOutputData data2 = Adapter == null ? null : Adapter.OutputProperty();
                string             f1    = Communicator == null ? null : Communicator.GetType().FullName;
                string             f2    = Adapter == null ? null : Adapter.GetType().FullName;
                if (OnFinished != null)
                {
                    OnFinished(data1, data2, f1, f2);
                }
                this.Close();
            }
        }
Exemplo n.º 2
0
        void fm_comsetting_OnStepChanged(int laststep, int nextstep, WizardEventArg e)
        {
            if (laststep == 1)
            {
                if (lst_com.SelectedItem == null)
                {
                    MessageBox.Show("你必须选择一个通信器!", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
                    e.Cancel = true;
                    return;
                }
                MyListItem item = (MyListItem)lst_com.SelectedItem;
                if (Communicator == null || Communicator.GetType().FullName != item.FullName)
                {
                    Communicator = JWCCommunicatorFactory.CreateCommunicator(item.FullName);
                }

                ComAdPropManager man = new ComAdPropManager(stk_com_prop, txt_comhelp);
                man.RefreshComPropList(Communicator);
            }
            else if (laststep == 3)
            {
                if (lst_ada.SelectedItem == null)
                {
                    MessageBox.Show("你必须选择一个适配器!", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
                    e.Cancel = true;
                    return;
                }
                MyListItem item = (MyListItem)lst_ada.SelectedItem;
                if (Adapter == null || Adapter.GetType().FullName != item.FullName)
                {
                    Adapter = JWCCommunicatorFactory.CreateAdapter(item.FullName);
                }
                ComAdPropManager man = new ComAdPropManager(stk_ada_prop, txt_adahelp);
                man.RefreshComPropList(Adapter);
            }
        }
Exemplo n.º 3
0
        private void btn_prev_Click(object sender, RoutedEventArgs e)
        {
            WizardEventArg eee = new WizardEventArg();

            if (OnStepChanged != null)
            {
                OnStepChanged(CurrStep, CurrStep - 1, eee);
            }
            if (eee.Cancel)
            {
                return;
            }
            CurrStep--;
            if (CurrStep >= 1)
            {
                btn_next.Content   = "下一步>";
                tab1.SelectedIndex = CurrStep - 1;
                SetStepLbls(CurrStep);
                if (CurrStep == 1)
                {
                    btn_prev.IsEnabled = false;
                }
            }
        }