Example #1
0
        private static void JoggWithoutUsingFacade()
        {
            // The phone has been booted up and all the controllers are running
            GPSController gps = new GPSController();
            MobileDataController data = new MobileDataController();
            MusicController zune = new MusicController();
            WifiController wifi = new WifiController();

            ///////////// Going for Jogging /////////////////////

            // 1. Turn off the wifi
            wifi.IsSwitchedOn = false;

            // 2. Switch on the Mobile Data
            data.IsSwitchedOn = true;

            // 3. Turn on the GPS
            gps.IsSwitchedOn = true;

            // 4. Turn on the Music
            zune.IsSwitchedOn = true;

            // 5. Start the Sports-Tracker
            SportsTrackerApp app = new SportsTrackerApp();
            app.Start();

            ///////////// Back from Jogging /////////////////////
            Console.WriteLine();

            // 0. Share Sports tracker stats on twitter and facebook
            app.Share();

            // 1. Stop the Sports Tracker
            app.Stop();

            // 2. Turn off the Music
            zune.IsSwitchedOn = false;

            // 3. Turn off the GPS
            gps.IsSwitchedOn = false;

            // 4. Turn off the Mobile Data
            data.IsSwitchedOn = false;

            // 5. Turn on the wifi
            wifi.IsSwitchedOn = true;
        }
        public void StartJogging()
        {
            // 1. Turn off the wifi
            wifi.IsSwitchedOn = false;

            // 2. Switch on the Mobile Data
            data.IsSwitchedOn = true;

            // 3. Turn on the GPS
            gps.IsSwitchedOn = true;

            // 4. Turn on the Music
            zune.IsSwitchedOn = true;

            // 5. Start the Sports-Tracker
            app = new SportsTrackerApp();
            app.Start();
        }
Example #3
0
        public void StartJogging()
        {
            // 1. Turn off the wifi
            this.wifi.IsSwitchedOn = false;

            // 2. Switch on the Mobile Data
            this.data.IsSwitchedOn = true;

            // 3. Turn on the GPS
            this.gps.IsSwitchedOn = true;

            // 4. Turn on the Music
            this.music.IsSwitchedOn = true;

            // 5. Start the Sports-Tracker
            this.app = new SportsTrackerApp();
            this.app.Start();
        }
Example #4
0
        public void StartJogging()
        {
            // 1. Turn off the wifi
            this.wifi.IsSwitchedOn = false;

            // 2. Switch on the Mobile Data
            this.data.IsSwitchedOn = true;

            // 3. Turn on the GPS
            this.gps.IsSwitchedOn = true;

            // 4. Turn on the Music
            this.music.IsSwitchedOn = true;

            // 5. Start the Sports-Tracker
            this.app = new SportsTrackerApp();
            this.app.Start();
        }
Example #5
0
        private static void JoggWithoutUsingFacade()
        {
            // The phone has been booted up and all the controllers are running
            var textStatus       = new TextStatusController();
            var gps              = new GPSController();
            var data             = new MobileDataController();
            var iTunes           = new MusicController();
            var wifi             = new WifiController();
            var heartRateMonitor = new HeartRateMontiorController();
            var moodIndicator    = new MoodIndicatorController();

            ///////////// Going for Jogging /////////////////////

            // 1. Set IM Status to Away
            textStatus.SetToAway = true;

            // 2. Turn off the wifi -- save battery
            wifi.IsSwitchedOn = false;

            // 3. Switch on the Mobile Data
            data.IsSwitchedOn = true;

            // 4. Turn on the GPS
            gps.IsSwitchedOn = true;

            // 5. Turn on Heart Rate Monitor
            heartRateMonitor.IsSwitchedOn = true;

            // 6. Turn on Mood Indicator
            moodIndicator.IsSwitchedOn = true;

            // 7. Turn on the Music
            iTunes.IsSwitchedOn = true;

            // 8. Start the Sports-Tracker
            var app = new SportsTrackerApp();

            app.Start();

            // 9. Pair Heart Rate Monitor
            heartRateMonitor.Pair();

            // 10. Load GPS Map

            // 11. Load playlist
            iTunes.LoadPlaylist("RockOut");

            // 12. Start playing music
            iTunes.Start();

            // 13. Start Monitoring Heart Rate
            heartRateMonitor.Start();


            ///////////// Back from Jogging /////////////////////
            Console.WriteLine();

            // 1. Stop heart rate monitor
            heartRateMonitor.Stop();

            // 2. Turn off the Music
            iTunes.IsSwitchedOn = false;

            // 3. Turn off the GPS
            gps.IsSwitchedOn = false;

            // 4. Share Sports tracker stats on twitter and facebook
            app.Share();

            // 5. Stop the Sports Tracker
            app.Stop();

            // 6. Turn off heart rate monitor
            heartRateMonitor.IsSwitchedOn = false;

            // 7. Turn off the GPS
            moodIndicator.IsSwitchedOn = false;

            // 8. Turn off the Mobile Data
            data.IsSwitchedOn = false;

            // 9. Turn on the wifi
            wifi.IsSwitchedOn = true;
        }