示例#1
0
 // events
 //
 private void PageSettingButton_Click(object sender, RoutedEventArgs e)
 {
     PEWindow = new window.PageEditorWindow();
     PEWindow.WindowStartupLocation  = System.Windows.WindowStartupLocation.CenterScreen;
     PEWindow.button_Activate.Click += ButtonActivate_Click;
     PEWindow.ShowDialog();
 }
示例#2
0
        //
        //
        //
        public MainWindow()
        {
            InitializeComponent();

            NIcon              = new src.NIcon(Icon);
            NIcon.Click       += notifyIcon_Click;
            NIcon.DoubleClick += notifyIcon_Click;

            NIcon.ContextMenuClose   += onClose;
            NIcon.ContextMenuConnect += ConnectPortContext_Click;

            timer       = new System.Windows.Threading.DispatcherTimer();
            timer.Tick += TimerElapsed;

            DSender              = new src.SerialControl.DataSender();
            DSender.TimerIsOver += EnableSend;
            DSender.SuccSend    += LockSend;
            string[] lstSpd = { "300", "1200", "2400", "4800", "9600", "19200", "38400" };
            comboBoxSPD.ItemsSource   = lstSpd;
            comboBoxSPD.SelectedIndex = 4;

            if (SerialPort.GetPortNames().Length > 0)
            {
                comboBoxPort.ItemsSource   = SerialPort.GetPortNames();
                comboBoxPort.SelectedIndex = 0;
            }
            else
            {
                MessageBox.Show("Нет доступных портов");
            }

            PEWindow = new window.PageEditorWindow();

            if (PEWindow.pageList.Count >= 1)
            {
                SenderPage = PEWindow.pageList[0];
            }
            else
            {
                SenderPage = new APage();
            }
            PEWindow.Close();
        }