コード例 #1
0
 public PreferencesWindowController(MacPlatform platform, BowlPlayer player)
     : base("PreferencesWindow")
 {
     Platform = platform;
     BowlPlayer = player;
     Initialize ();
 }
コード例 #2
0
        public AwarenessController(AbstractPlatform platform)
        {
            Platform = platform;
            Platform.ApplicationLaunched += ApplicationLaunched;
            Platform.ApplicationWillQuit += ApplicationWillQuit;

            BreakTimer = new BreakTimer(Platform);
            BreakTimer.BreakSuggested += BreakSuggested;

            BowlPlayer = new BowlPlayer(Platform);
        }
コード例 #3
0
        public AwarenessController(AbstractPlatform platform)
        {
            Platform = platform;
            Platform.ApplicationLaunched += ApplicationLaunched;
            Platform.ApplicationWillQuit += ApplicationWillQuit;

            BreakTimer = new BreakTimer (Platform);
            BreakTimer.BreakSuggested += BreakSuggested;

            BowlPlayer = new BowlPlayer (Platform);
        }
コード例 #4
0
        void ApplicationLaunched(object sender, EventArgs e)
        {
            if (Platform.Preferences.IsFirstRun)
            {
                Log.Info("Awareness launched for the first time.");
                FirstRun.Raise(this);
                Platform.Preferences.IsFirstRun = false;
            }
            else
            {
                Log.Info("Awareness launched.");
            }

            if (Platform.Preferences.PlayBowlOnStart)
            {
                BowlPlayer.Play(1);
            }
            BreakTimer.Start();
        }
コード例 #5
0
 void ApplicationWillQuit(object sender, EventArgs e)
 {
     Log.Info("Awareness will quit.");
     BowlPlayer.StopPlaying();
     BreakTimer.Stop();
 }
コード例 #6
0
 void BreakSuggested(object sender, EventArgs e)
 {
     BowlPlayer.Play(BreakTimer.ElapsedMaxActivityIntervals);
 }