public AwarenessNotifyIconController(AbstractPlatform platform, AwarenessController controller) { Platform = platform; Platform.ApplicationWillQuit += ApplicationWillQuit; Controller = controller; Controller.BreakTimer.BreakChecked += BreakChecked; Controller.BreakTimer.BreakSuggested += BreakSuggested; Icon = new NotifyIcon { Visible = true, ContextMenu = BuildContextMenu (), Icon = new Icon (Platform.ResourceNamed ("bowl.ico")) }; Icon.DoubleClick += (sender, args) => DoubleClick.Raise (this); Icon.BalloonTipClicked += BalloonTipClicked; }
public override void AwakeFromNib() { Platform = Runtime.Initialize (new MacPlatform ()); // Do this before we start listening for notifications. Platform.Preferences.StartAtLogin = AppStartAtLogin; Platform.Preferences.Changed += PreferencesChanged; Controller = new AwarenessController (Platform); Controller.FirstRun += FirstRun; Controller.BowlPlayer.WillPlay += BowlPlayerWillPlay; Controller.BowlPlayer.StartedPlaying += BowlPlayerStartedPlaying; Controller.BreakTimer.BreakChecked += HandleBreakChecked; iTunes = new iTunes (Platform); if (Platform.MacPreferences.ShowInMenuBar) CreateAndDisplayStatusItem (); base.AwakeFromNib (); }