Example #1
0
 private void ShowBalloonPopup(Func <BalloonPopupBase> popupFactory)
 {
     Invoke.OnSTA(
         () => NotifyIcon.ShowCustomBalloon(
             popupFactory(),
             PopupAnimation.Slide,
             null));
 }
Example #2
0
        private static string AskForExportLocation()
        {
            var saveFileDialog = new SaveFileDialog
            {
                Filter       = Properties.SessionManager.SaveFileDialogFilter,
                AddExtension = true
            };
            var result = Invoke.OnSTA(() => saveFileDialog.ShowDialog());

            return(result == DialogResult.Cancel ? null : saveFileDialog.FileName);
        }
        private static void TestDisplayXaml(string xaml, Action <Paragraph> assertion)
        {
            Invoke.OnSTA(
                () =>
            {
                var uut = new XamlBindableRichTextBox {
                    Xaml = xaml
                };

                // wait for asynchronous task on dispatcher to finish
                uut.Dispatcher.Invoke(new Action(() => { }), DispatcherPriority.Input);

                var paragraph = uut.Document.Blocks.FirstBlock as Paragraph;
                Assert.NotNull(paragraph);
                assertion(paragraph);
            });
        }
Example #4
0
 private void ShowAbsenceNotification()
 {
     Invoke.OnSTA(
         () => _notifyIcon.ShowCustomBalloon(new AbsenceNotification(CalculateMinutesSinceLastAction(), _viewModel.ActiveTask.Title,
                                                                     OnNotificationClosed), PopupAnimation.Slide, null));
 }
Example #5
0
 public NotifyTrayIcon(ILogManager logManager)
 {
     _logManager = logManager;
     Invoke.OnSTA(InitTaskbarIcon);
 }
Example #6
0
 public static bool IsPressed(this Key key)
 {
     return(Invoke.OnSTA(() => Keyboard.IsKeyDown(key)));
 }