コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DisplayStateController" /> class.
 /// </summary>
 /// <param name="textViewNavigator">The text view navigator.</param>
 /// <param name="idleMonitor">The idle monitor.</param>
 /// <param name="display">The text display device.</param>
 /// <param name="displayStateControllerReporter">The display state controller reporter.</param>
 public DisplayStateController(ITextViewNavigator textViewNavigator, IIdleMonitor idleMonitor, IDisplay display, IDisplayStateControllerReporter?displayStateControllerReporter)
 {
     this.textViewNavigator = textViewNavigator;
     this.display           = display;
     this.displayStateControllerReporter = displayStateControllerReporter;
     this.displayStateControllerReporter?.SetSource(this);
     idleMonitor.InputIdle += this.OnIdleControllerInputIdle;
     idleMonitor.Activated += this.OnIdleControllerActivated;
 }
コード例 #2
0
        private static IEnumerable <ulong> RunMonitor(IIdleMonitor monitor)
        {
            var returned = new List <ulong>();

            monitor.Start();
            for (var i = 0; i < 10; ++i)
            {
                returned.Add(monitor.Total);
                Thread.Sleep(300);
            }
            monitor.Stop();

            return(returned);
        }
コード例 #3
0
ファイル: ShutdownController.cs プロジェクト: hugener/Aupli
 /// <summary>
 /// Initializes a new instance of the <see cref="ShutdownController" /> class.
 /// </summary>
 /// <param name="idleMonitor">The input controller.</param>
 /// <param name="systemControl">The shutdown button.</param>
 /// <param name="applicationExit">The application exit.</param>
 /// <param name="allowShutdown">if set to <c>true</c> [allow shutdown].</param>
 /// <param name="shutdownControllerReporter">The shutdown controller reporter.</param>
 public ShutdownController(
     IIdleMonitor idleMonitor,
     ISystemControl systemControl,
     IApplicationExit applicationExit,
     bool allowShutdown,
     IShutdownControllerReporter?shutdownControllerReporter = null)
 {
     this.idleMonitor                = idleMonitor;
     this.systemControl              = systemControl;
     this.applicationExit            = applicationExit;
     this.allowShutdown              = allowShutdown;
     this.shutdownControllerReporter = shutdownControllerReporter;
     this.shutdownControllerReporter?.SetSource(this);
     this.idleMonitor.SystemIdle      += this.OnIdleControllerSystemIdle;
     this.systemControl.ShuttingDown  += this.OnShutdownControlShuttingDown;
     this.applicationExit.ExitRequest += this.OnApplicationExitRequest;
     this.applicationExit.Exiting     += this.OnApplicationExiting;
 }
コード例 #4
0
 public PlaySessionTracker(IIdleMonitor idleMonitor, ISessionSubmissionQueue queue)
 {
     this.idleMonitor = idleMonitor;
     this.submissionQueue = queue;
 }