コード例 #1
0
 /// <summary>
 /// Constructor: initializes snoozeUntilTime to harmless value
 /// </summary>
 public AlarmController()
 {
     this.alarmList       = new List <Alarm>();
     this.audioController = AbstractAudioController.GetController();
     this.guiController   = AbstractGuiController.GetController();
     this.snoozeUntilTime = TimeFetcher.getCurrentTime();
 }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: psettle/seng403alarmclock
 /// <summary>
 /// Assigns the platform dependent controllers at runtime
 /// </summary>
 private void AssignPlatformControllers()
 {
     AbstractAudioController.SetController(new AudioController());
     AbstractGuiController.SetController(new GuiController());
     AbstractDataDriver.addType(typeof(List <Alarm>));
     AbstractDataDriver.addType(typeof(Alarm));
     AbstractDataDriver.addType(typeof(Audio.Audio));
     AbstractDataDriver.Instance = new DataDriver();
 }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: psettle/seng403alarmclock
 /// <summary>
 /// Called when the application exits
 /// </summary>
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     //turn off all alarms
     AbstractAudioController.GetController().endAllAlarms();
     //teardown the alarm/time controllers
     ac.Teardown();
     //finally save any residual state data
     AbstractDataDriver.Instance.Shutdown();
 }
コード例 #4
0
ファイル: App.xaml.cs プロジェクト: psettle/seng403alarmclock
        /// <summary>
        /// Builds controller objects and starts th e app
        /// </summary>
        public App()
        {
            AbstractGuiController.SetController(new GuiController());
            TimePulseGenerator.Instance = new TimePulseGenerator(new SengDispatcherTimer());
            AbstractAudioController.SetController(new AudioController());

            this.Startup            += this.Application_Startup;
            this.Exit               += this.Application_Exit;
            this.UnhandledException += this.Application_UnhandledException;

            InitializeComponent();


            TimeController tc = new TimeController();

            GuiEventCaller.GetCaller().AddListener(tc);
            TimePulseGenerator.Instance.registerListener(tc);

            AlarmController ac = new AlarmController();

            GuiEventCaller.GetCaller().AddListener(ac);
            TimePulseGenerator.Instance.registerListener(ac);
        }