示例#1
0
        private void ButtonActivate_Click(object sender, RoutedEventArgs e)
        {
            // Активация активной страницы из настроек
            //
            SenderPage = PEWindow.curPage;

            if (SenderPage != null)
            {
                PEWindow.ShowPopup("Активирована страница:\n" + SenderPage.Name);
                PEWindow.Close();
            }
            else
            {
                PEWindow.ShowPopup("Пусто");
            }
        }
示例#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();
        }