private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Test_WPFWindow currentWindow = this;

            if (currentWindow.comboBox.SelectedValue != null)
            {
                currentBridge = config.SelectBridge(currentWindow.comboBox.SelectedValue.ToString());
                currentWindow.textBox_ip.Text   = currentBridge.Ip;
                currentWindow.textBox_name.Text = currentBridge.Name;
                currentWindow.checkBox_SetAsDefault.IsChecked = currentBridge.IsDefault;
            }
        }
        /// <summary>
        /// Speak Button Click event
        /// </summary>
        private void button_Connect_Click(object sender, RoutedEventArgs e)
        {
            Test_WPFWindow currentWindow = this;

            currentBridge = config.SelectBridge(currentWindow.comboBox.SelectedValue.ToString());
            if ((bool)currentWindow.checkBox_SetAsDefault.IsChecked)
            {
                config.SetAsDefault(currentBridge.Name);
                config.Save();
            }

            currentWindow.textBox_ip.Text   = currentBridge.Ip;
            currentWindow.textBox_name.Text = currentBridge.Name;
        }
Exemple #3
0
 /// <summary>
 /// Allows external classes to close the window
 /// </summary>
 internal void FormTest_Close()
 {
     //Debugger.Break();
     if (wpfTest != null)
     {
         if (!wpfTest.IsClosed)
         {
             wpfTest.Dispatcher.Invoke(() =>
             {
                 wpfTest.Close();
                 Console.WriteLine("wpfTest: " + wpfTest.IsClosed);
                 wpfTest = null;
             });
         }
     }
     t.Abort();
 }
Exemple #4
0
        /// <summary>
        /// Method to initialize test window
        /// Sets visuals for the window
        /// </summary>
        private void InitializeWindow()
        {
            //Debugger.Launch();
            //Debugger.Break();

            // Initialize Window Instance
            wpfTest = new Test_WPFWindow();

            //wpfTest.Play(@"C:\Users\Zunair\AppData\Roaming\LINKS\Customization\Sound Effects\Hover_buttons.wav",1);
            //Thread.Sleep(200);
            //Thread.Sleep(2000);

            //wpfTest.Play(@"C:\Users\Zunair\AppData\Roaming\LINKS\Customization\Sound Effects\Hover_main_button.wav",2);
            //Thread.Sleep(200);
            //Thread.Sleep(2000);

            //wpfTest.Play(@"C:\Users\Zunair\AppData\Roaming\LINKS\Customization\Sound Effects\Media_KeyPress.wav",3);
            //Thread.Sleep(200);
            //Thread.Sleep(2000);

            //wpfTest.Play(@"C:\Users\Zunair\AppData\Roaming\LINKS\Customization\Sound Effects\Speech_Pause.wav",4);
            //Thread.Sleep(200);
            //Thread.Sleep(4000);

            //Task.WaitAll();
            Thread.Sleep(200);
            Console.WriteLine("");
            try
            {
                if (wpfTest.LINKSInitialized())
                {
                    //// Get Templates for controls
                    //// Note: This will not work on v2.6.2.3 or older
                    //ControlTemplate buttonTemplate = (ControlTemplate)jarvisWPF.App.Current.FindResource("ButtonControl_CutLeftRight");
                    //ControlTemplate textBoxTemplate = (ControlTemplate)jarvisWPF.App.Current.FindResource("TextBox_ControlTemplate");
                    //ControlTemplate checkBoxTemplate = (ControlTemplate)jarvisWPF.App.Current.FindResource("CheckBox_ControlTemplate");
                    //ControlTemplate comboBoxTemplate = (ControlTemplate)jarvisWPF.App.Current.FindResource("ComboBox_ControlTemplate");
                    //
                    //// Apply templates
                    //// Note: This will not work on v2.6.2.3 or older
                    //wpfTest.test_comboBox.Template = comboBoxTemplate;
                    //wpfTest.button_Connect.Template = buttonTemplate;
                    //wpfTest.textBox_ip.Template = textBoxTemplate;
                    //wpfTest.textBox_URL.Template = textBoxTemplate;
                    //wpfTest.test_checkBox_LoadOnStart.Template = checkBoxTemplate;
                }
            }
            catch
            {
                Console.WriteLine("Not all templates work on v2.6.2.3 or older. Only Button Template can work after commenting out the rest of the template lines.");
            }

            // Set properties
            //wpfTest.test_comboBox.IsDropDownOpen = false;
            //wpfTest.test_comboBox.Visibility = Visibility.Hidden;
            wpfTest.test_checkBox_LoadOnStart.IsChecked = Properties.Settings.Default.LoadOnStart;
            //wpfTest.test_labelBlock_LoadOnStart.FontFamily = jarvisWPF.PublicClass.GetFont();

            wpfTest.Show();
            wpfTest.Closed += (s, e) => Dispatcher.ExitAllFrames();
            Dispatcher.Run();
        }