private static void Popup_DISPATCHER() { if (null == instance) { instance = new PopupInCiteControl(); chw = new StandardWindow(); chw.Title = "Qiqqa InCite"; chw.Content = instance; chw.Closing += chw_Closing; chw.Width = 700; chw.Height = 340; chw.Topmost = true; chw.WindowStyle = WindowStyle.ToolWindow; chw.ShowInTaskbar = true; //chw.AllowsTransparency = true; //chw.Background = Brushes.Transparent; } // Show the window chw.Show(); Keyboard.Focus(instance.TxtSearchTerms); instance.TxtSearchTerms.SelectAll(); // Attempt to get focus { IntPtr window = Interop.GetWindowHandle(chw); Interop.SetForegroundWindow(window); } }
public static int DefaultOperationsTest() { Assert.DoesNotThrow(Calculator.Instance.Launch, "Could not successfully start calculator instance"); StandardWindow window = new StandardWindow(Calculator.Instance.GetWindow()); window.KeypadNumeric.EnterNumber("123456"); window.DefaultOperations.ButtonAdd.Click(); window.KeypadNumeric.EnterNumber("987654"); window.DefaultOperations.ButtonSub.Click(); window.KeypadNumeric.EnterNumber("2380"); window.DefaultOperations.ButtonGetResult.Click(); Assert.AreEqual(1108730, Convert.ToInt32(window.LabelResult.Text)); window.DefaultOperations.ButtonMul.Click(); window.KeypadNumeric.EnterNumber("503"); window.DefaultOperations.ButtonDiv.Click(); window.KeypadNumeric.EnterNumber("2"); window.DefaultOperations.ButtonGetResult.Click(); string resultValue = window.LabelResult.Text; return(Convert.ToInt32(resultValue)); }
public Routes() { standardWindow = new StandardWindow(); scientificWindow = new ScientificWindow(); programmerWindow = new ProgrammerWindow(); dateCalculationWindow = new DateCalculationWindow(); graphingWindow = new GraphingWindow(); currencyWindow = new CurrencyWindow(); }
/// <summary> /// Gets the window. /// </summary> /// <param name="viewModel">The view model.</param> /// <param name="isDialogWindow">if set to <c>true</c> [is dialog window].</param> /// <returns>Window.</returns> private Window GetWindow(ViewModelBase viewModel, bool isDialogWindow) { lock (LockObject) { var window = _openedWindows.SingleOrDefault(w => w.DataContext == viewModel); if (window != null) { window.WindowState = WindowState.Normal; window.Activate(); return(window); } if (isDialogWindow) { // Set window owner in order to prevent that it becomes hidden when minimizing the application window = new DialogWindow { Owner = _openedWindows.Any() ? _openedWindows.Last() : Application.Current.MainWindow }; } else { // Doesn't need a window owner since it's shown in the taskbar window = new StandardWindow(); } _openedWindows.Add(window); window.Closed += (sender, e) => { Closed?.Invoke(sender, e); _openedWindows.Remove(window); window = null; if (!_openedWindows.Any() && Application.Current.MainWindow != null) { Application.Current.MainWindow.Activate(); } }; window.Closing += (sender, e) => { Closing?.Invoke(sender, e); }; return(window); } }
internal SpeedReadControl OpenSpeedRead() { SpeedReadControl src = new SpeedReadControl(); StandardWindow window = new StandardWindow(); window.Title = "Qiqqa SpeedRead"; window.Content = src; window.Width = 700; window.Height = 340; window.Show(); return(src); }
public static void Test() { // TODO: REMOVE AFTER TESTING Library library = WebLibraryManager.Instance.Library_Guest; while (!library.LibraryIsLoaded) { Thread.Sleep(100); } LibraryPivotReportControl lprc = new LibraryPivotReportControl(); lprc.Library = library; StandardWindow sw = new StandardWindow(); sw.Content = lprc; sw.Width = 800; sw.Height = 800; sw.Show(); }
public static int MemoryButtonsTest() { Assert.DoesNotThrow(Calculator.Instance.Launch, "Could not successfully start calculator instance"); StandardWindow window = new StandardWindow(Calculator.Instance.GetWindow()); window.KeypadNumeric.EnterNumber("12"); window.DefaultOperations.ButtonAdd.Click(); window.KeypadNumeric.EnterNumber("999"); window.DefaultOperations.ButtonGetResult.Click(); window.KeypadMemory.ButtonMemoryStore.Click(); window.KeypadNumeric.EnterNumber("19"); window.DefaultOperations.ButtonSub.Click(); window.DefaultOperations.ButtonAdd.Click(); window.DefaultOperations.ButtonAdd.Click(); window.KeypadMemory.ButtonMemoryRecall.Click(); window.DefaultOperations.ButtonGetResult.Click(); string resultValue = window.LabelResult.Text; return(Convert.ToInt32(resultValue)); }