Cradiator.Views.MessageWindow.ShowMessage C# (CSharp) Method

ShowMessage() public method

public ShowMessage ( int pollFrequency, string message ) : void
pollFrequency int
message string
return void
        public void ShowMessage(int pollFrequency, string message)
        {
            Message.Text = message;

            // set the timer to auto-close this window before next screenupdate (delay = 80% of pollFrequency)
            _timer = new DispatcherTimer
                     {
                        Interval = TimeSpan.FromSeconds(pollFrequency / PercentageOfPollFrequency)
                     };

            _timer.Tick += Timer_Tick;
            _timer.Start();

            if (_mainView != null)
            {
                _mainView.ScreenUpdating += MainScreenUpdating;
                _mainView.Closing += MainWindowClosing;
            }

            Show();
        }

Usage Example

Exemplo n.º 1
0
        public static void Main()
        {
            try
            {
                var app = new CradiatorApp();
                var configSettings = new ConfigSettings();
                configSettings.Load();
                var mainWindow = new CradiatorWindow(configSettings);
                var bootstrapper = new Bootstrapper(configSettings, mainWindow);
                var kernel = bootstrapper.CreateKernel();
                var presenter = kernel.Get<CradiatorPresenter>();

                mainWindow.Show();
                presenter.Init();

                app.Run();
            }
            catch (Exception exception)
            {
                _log.Error(exception.Message, exception);

                var messageWindow = new MessageWindow(null);
                messageWindow.ShowMessage(5, "Application Exception - see log for details\nShutting down...");
            }
        }
All Usage Examples Of Cradiator.Views.MessageWindow::ShowMessage