Beispiel #1
0
        void DumpPlayReadySettings()
        {
            TestLogger.LogMessage("Dumping PlayReadySettings...");

            Windows.Storage.ApplicationData appData = Windows.Storage.ApplicationData.Current;

            Windows.Storage.StorageFolder storageFolder = appData.LocalFolder;
            TestLogger.LogMessage("AppData LocalFolder Path = " + storageFolder.Path);

            IReadOnlyDictionary <string, ApplicationDataContainer> dictionary = appData.LocalSettings.Containers;

            TestLogger.LogMessage("Container count = " + dictionary.Count);
            foreach (string containerName in dictionary.Keys)
            {
                TestLogger.LogMessage("Container name = " + containerName);
            }

            Windows.Storage.ApplicationDataContainer playreadySettings = appData.LocalSettings.Containers["PlayReady"];

            TestLogger.LogMessage("Settings container Name = " + playreadySettings.Name);
            Windows.Foundation.Collections.IPropertySet propertySetValues = playreadySettings.Values;
            foreach (string strKey in propertySetValues.Keys)
            {
                string strValue = propertySetValues[strKey].ToString();
                TestLogger.LogMessage("Key     = " + strKey);
                TestLogger.LogMessage("Value   = " + strValue);
            }
        }
        public MainPage()
        {
            this.InitializeComponent();
            appSettings = ApplicationData.Current.LocalSettings.Values;

            Loaded += OnLoaded; 

            #region Initialize all selected values in the graduation date popup
            monthComboBox.SelectedIndex = 0;
            dayComboBox.SelectedIndex = 0;
            yearComboBox.SelectedIndex = 0;
            #endregion 

            #region Show the date PopUp if there isn't a saved date 
            if (!appSettings.ContainsKey(dateKey))
            {
                untilTxtBlock.Visibility = Visibility.Collapsed;
                countdownTxtBlock.Visibility = Visibility.Collapsed; 
                datePopUp.IsOpen = true; 
            }
            else
            {
                datePopUp.IsOpen = false;
                string date = appSettings[dateKey].ToString();
                var tempArray = date.Split(' ');    // Results in  tempArray[0] = xx/xx/xx
                var dateArray = tempArray[0].Split('/');
                int month = Convert.ToInt32(dateArray[0]);
                int day = Convert.ToInt32(dateArray[1]);
                int year = Convert.ToInt32(dateArray[2]);
                GraduationDate = new DateTime(year, month, day);
                //Clock.WinRT.ClockTileScheduler.SetGraduationDate(year, month, day); 
            }
            #endregion 
        }
Beispiel #3
0
        /* ----- BUTTON CLICKS START ----- */
        private async void btnLoadCamera_Click(object sender, RoutedEventArgs e)
        {
            CameraCaptureUI mainCamera = new CameraCaptureUI();

            mainCamera.PhotoSettings.CroppedAspectRatio = new Size(16, 9);
            appSettings = ApplicationData.Current.LocalSettings.Values;
            StorageFile file = await mainCamera.CaptureFileAsync(CameraCaptureUIMode.Photo);

            if (file != null)
            {
                previewImage = new BitmapImage();
                using (IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.Read))
                {
                    previewImage.SetSource(fileStream);
                }
                appSettings[imageKey] = file.Path;

                SolvePuzzle();
                SplitPicture(file);
                if (toggleNum == true)
                {
                    ToggleNumbers();
                }
                ReloadImages();
            }
        }
Beispiel #4
0
        public MainPage()
        {
            this.InitializeComponent();
            appSettings = ApplicationData.Current.LocalSettings.Values;

            var bounds = Window.Current.Bounds;
            var height = bounds.Height;
            var width  = bounds.Width;

            VidGrid.Width = .7 * width;     // VidGrid takes up the left half of the page
            VideoInformationGrid.Width = .35 * width;



            // If the user is not logged in
            if (!appSettings.ContainsKey(usernameKey) || !appSettings.ContainsKey(passwordKey))
            {
                loginPopUp.IsOpen = true;
                usernameTxtBox.Focus(Windows.UI.Xaml.FocusState.Keyboard);
                logoutBtn.Visibility  = Visibility.Collapsed;
                accoutnBtn.Visibility = Visibility.Collapsed;
                videosBtn.Visibility  = Visibility.Collapsed;
            }
            else
            {
                loginPopUp.IsOpen     = false;
                logoutBtn.Visibility  = Visibility.Visible;
                accoutnBtn.Visibility = Visibility.Visible;
                videosBtn.Visibility  = Visibility.Visible;
            }



            List <DummiePerson> list = new List <DummiePerson>()
            {
                new DummiePerson {
                    Image_Name = "Made some good progress", Image = "Person1.jpg", Description = "I finally figured out how to calculate congruency complexity!"
                },
                new DummiePerson {
                    Image_Name = "Signing off!", Image = "Person2.jpg", Description = "Thank you all for the awesome experience!"
                },
                new DummiePerson {
                    Image_Name = "Just woke up", Image = "Person3.jpg", Description = "I had such a good time with my friends tonight."
                },
                new DummiePerson {
                    Image_Name = "Talk about a bad hair day...", Image = "Person4.jpg", Description = "You know what's awesome about summer? Long hair."
                },
                new DummiePerson {
                    Image_Name = "Haircuts... ", Image = "Person6.jpg", Description = "I don't like haircuts one bit. That's right, I said. it. "
                },
            };

            DataContext = list;
            groupedItemsViewSource.Source = list;

            OpenVideo();
        }
        /// <summary>
        /// Page constructor
        /// </summary>
        public GroupedItemsPage()
        {
            this.InitializeComponent();
            Loaded += OnLoaded;


            videosProgressRing.Visibility = Visibility.Visible;

            appSettings = ApplicationData.Current.LocalSettings.Values;
           
            var bounds = Window.Current.Bounds;
            var height = bounds.Height;
            var width = bounds.Width;

            if (App.HasNetworkConnection)
                AuthenticateArchiveAPI();       // Authenticate client app with Archive API

            // If the user is not logged in 
            if (!appSettings.ContainsKey(usernameKey) || !appSettings.ContainsKey(passwordKey))
            {

                greetingsBanner.Visibility = Visibility.Visible; 
                usernameTxtBox.Focus(Windows.UI.Xaml.FocusState.Keyboard);
                loginPopUp.Visibility = Visibility.Collapsed; 
                logoutBtn.Visibility = Visibility.Collapsed;
                profileBtn.Visibility = Visibility.Collapsed; 
                loginBtn.Visibility = Visibility.Visible;
                signUpBtn.Visibility = Visibility.Visible;
                lowerButtonsStackPanel.Visibility = Visibility.Collapsed;
               
            }
            else
            {
                greetingsBanner.Visibility = Visibility.Collapsed;
                loginPopUp.Visibility = Visibility.Collapsed; 
                logoutBtn.Visibility = Visibility.Visible;
                profileBtn.Visibility = Visibility.Visible; 
                loginBtn.Visibility = Visibility.Collapsed;
                signUpBtn.Visibility = Visibility.Collapsed;
                lowerButtonsStackPanel.Visibility = Visibility.Visible;
                try
                {

                    var userJSON = appSettings[User];
                    App.LoggedInUser = JsonConvert.DeserializeObject<User>(appSettings[User].ToString());
                   
                }
                catch 
                {
                    // Do something here!
                }
            }
            
        }
        public MainPage()
        {
            this.InitializeComponent();
            appSettings = ApplicationData.Current.LocalSettings.Values;

            var bounds = Window.Current.Bounds;
            var height = bounds.Height;
            var width = bounds.Width;
            VidGrid.Width = .7 * width;     // VidGrid takes up the left half of the page
            VideoInformationGrid.Width = .35 * width; 



            // If the user is not logged in 
            if (!appSettings.ContainsKey(usernameKey) || !appSettings.ContainsKey(passwordKey))
            {
                loginPopUp.IsOpen = true;
                usernameTxtBox.Focus(Windows.UI.Xaml.FocusState.Keyboard); 
                logoutBtn.Visibility = Visibility.Collapsed;
                accoutnBtn.Visibility = Visibility.Collapsed;
                videosBtn.Visibility = Visibility.Collapsed;
            }
            else
            {
                loginPopUp.IsOpen = false;
                logoutBtn.Visibility = Visibility.Visible;
                accoutnBtn.Visibility = Visibility.Visible;
                videosBtn.Visibility = Visibility.Visible; 
            }

       

            List<DummiePerson> list = new List<DummiePerson>()
            {
                new DummiePerson{Image_Name="Made some good progress", Image="Person1.jpg", Description="I finally figured out how to calculate congruency complexity!"},
                new DummiePerson{Image_Name="Signing off!", Image="Person2.jpg", Description="Thank you all for the awesome experience!"},
                new DummiePerson{Image_Name="Just woke up", Image="Person3.jpg", Description="I had such a good time with my friends tonight."},
                new DummiePerson{Image_Name="Talk about a bad hair day...", Image="Person4.jpg", Description="You know what's awesome about summer? Long hair."},
                new DummiePerson{Image_Name="Haircuts... ", Image="Person6.jpg", Description="I don't like haircuts one bit. That's right, I said. it. "},
            };
            DataContext = list;
            groupedItemsViewSource.Source = list;

            OpenVideo(); 
        
        }
        private void tile_styleComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
        {
            appSettings = ApplicationData.Current.LocalSettings.Values;

            switch (tile_styleComboBox.SelectedIndex)
            {
                case 0:
                    App.Live_Tile_Style = 0;
                    appSettings["LiveTileStyle"] = 0;
                    break;
                case 1:
                    App.Live_Tile_Style = 1;
                    appSettings["LiveTileStyle"] = 1;
                    break;
                case 2:
                    App.Live_Tile_Style = 2;
                    appSettings["LiveTileStyle"] = 2;
                    break;
                default: break;
            }
        }
Beispiel #8
0
        private void tile_styleComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
        {
            appSettings = ApplicationData.Current.LocalSettings.Values;

            switch (tile_styleComboBox.SelectedIndex)
            {
            case 0:
                App.Live_Tile_Style          = 0;
                appSettings["LiveTileStyle"] = 0;
                break;

            case 1:
                App.Live_Tile_Style          = 1;
                appSettings["LiveTileStyle"] = 1;
                break;

            case 2:
                App.Live_Tile_Style          = 2;
                appSettings["LiveTileStyle"] = 2;
                break;

            default: break;
            }
        }
        /// <summary>
        /// MainPage constructor        
        /// </summary>
        public MainPage()
        {
            this.InitializeComponent();
            _inputProcessor = new SIUC311.Manipulations.InputProcessor(ReportPopupGrid, null);

            // This is a static public property that will allow downstream pages to get 
            // a handle to the MainPage instance in order to call methods that are in this class.
            Current = this;

            // Setup
            SetWindowsUser();
            SetDNSDomain();

            RefreshQueue();
            InitHeadings();
            InitRadioButtons();

            if (haveInternetAccess = CheckForInternet())
            {
                //NotifyUser("Internet.", NotifyType.ReportMessage);
            }
            else
            {
                //NotifyUser("No internet.", NotifyType.ReportMessage);
            }

            appSettings = ApplicationData.Current.LocalSettings.Values;
            _cd = Window.Current.CoreWindow.Dispatcher;

            _geolocatorForTracker = new Geolocator(); // May not need all three. Just synchronize access to one.
            _geolocatorForRequest = new Geolocator();
            _geolocatorForMap = new Geolocator();

            _compass = Compass.GetDefault(); // Get the default compass object

            _inclinometer = Inclinometer.GetDefault(); // Get the default inlinometer object

            _locationIcon10m = new LocationIcon10m();
            _locationIcon100m = new LocationIcon100m();
            _locationIcon2000m = new LocationIcon2000m();

            // Assign an event handler for the compass reading-changed event
            if (_compass != null)
            {
                // Establish the report interval for all scenarios
                uint minReportInterval = _compass.MinimumReportInterval;
                uint reportInterval = minReportInterval > 16 ? minReportInterval : 16;
                _compass.ReportInterval = reportInterval;
                _compass.ReadingChanged += new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(CompassReadingChanged);
            }
            else
            {
                DirectionTextblock.Text = "No compass";
            }

            // Assign an event handler for the inclinometer reading-changed event
            if (_inclinometer != null)
            {
                // Establish the report interval for all scenarios
                uint minReportInterval = _inclinometer.MinimumReportInterval;
                uint reportInterval = minReportInterval > 16 ? minReportInterval : 16;
                _inclinometer.ReportInterval = reportInterval;

                // Establish the event handler
                _inclinometer.ReadingChanged += new TypedEventHandler<Inclinometer, InclinometerReadingChangedEventArgs>(InclinometerReadingChanged);
            }
            else
            {
                DirectionTextblock.Text = "No inclinometer";
            }

            Application.Current.Suspending += (sender, args) => OnSuspending();
            Application.Current.Resuming += (sender, o) => OnResuming();

            Window.Current.VisibilityChanged += Current_VisibilityChanged;

            TitleGrid.Background = new SolidColorBrush(Color.FromArgb(255, 102, 0, 0));
            Map.MapType = MapType.Aerial;
        }
        // Constructor
        public MainPage()
        {
            appSettings = ApplicationData.Current.LocalSettings.Values;

            InitializeComponent();

            #region  Setup the background task
            BackgroundTaskBuilder builder = new BackgroundTaskBuilder();
            builder.Name = TASKNAMEUSERPRESENT;
            builder.TaskEntryPoint = TASKENTRYPOINT;
            builder.SetTrigger(new SystemTrigger(SystemTriggerType.UserPresent, false));
            builder.Register();
            var registration = builder.Register();
            #endregion 

            #region Setup the screen resolution
            var bounds = Window.Current.Bounds;
            double height = bounds.Height;
            double width = bounds.Width;

            ContentPanel.Height = height;
            ContentPanel.Width = width;
            MainPageGrid.Height = height;
            MainPageGrid.Width = width;
            #endregion 


            random = new Random();
            this.StartFallingSnowAnimation();

            // We keep results in this variable
            //StringBuilder results = new StringBuilder();
            //results.AppendLine();

            //// Create basic date/time formatters.
            //DateTimeFormatter[] basicFormatters = new[]
            //{
            //    // Default date formatters
            //    new DateTimeFormatter("shortdate"),
            //    new DateTimeFormatter("longdate"),

            //    // Default time formatters
            //    new DateTimeFormatter("shorttime"),
            //    new DateTimeFormatter("longtime"),
            // };

            //// Create date/time to format, manipulate and display.
            //DateTime dateTime = DateTime.Now;
            //// Try to format and display date/time if calendar supports it.
            //foreach (DateTimeFormatter formatter in basicFormatters)
            //{
            //    try
            //    {
            //        // Format and display date/time.
            //        results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
            //    }
            //    catch (ArgumentException)
            //    {
            //        // Retrieve and display formatter properties. 
            //        results.AppendLine(String.Format(
            //            "Unable to format Gregorian DateTime {0} using formatter with template {1} for languages [{2}], region {3}, calendar {4} and clock {5}",
            //            dateTime,
            //            formatter.Template,
            //            string.Join(",", formatter.Languages),
            //            formatter.GeographicRegion,
            //            formatter.Calendar,
            //            formatter.Clock));
            //    }
            //}

            // Display the results
            //this.todaysDateTxtBlock.Text = results.ToString();


            TimeSpan ts = Christmas - DateTime.Now;
            int days = ts.Days;
            int hours = ts.Hours;
            //diffTxtBlock.Text = days + " days " + hours + "hours"; 

            Loaded += OnLoaded;
        }
 public SignUpPage()
 {
     this.InitializeComponent();
     appSettings = ApplicationData.Current.LocalSettings.Values;
 }
 public SettingsPage()
 {
     this.InitializeComponent();
     tile_styleComboBox.SelectedIndex = 0;
     appSettings = ApplicationData.Current.LocalSettings.Values;
 }
Beispiel #13
0
        // Constructor
        public MainPage()
        {
            appSettings = ApplicationData.Current.LocalSettings.Values;

            InitializeComponent();

            #region  Setup the background task
            BackgroundTaskBuilder builder = new BackgroundTaskBuilder();
            builder.Name           = TASKNAMEUSERPRESENT;
            builder.TaskEntryPoint = TASKENTRYPOINT;
            builder.SetTrigger(new SystemTrigger(SystemTriggerType.UserPresent, false));
            builder.Register();
            var registration = builder.Register();
            #endregion

            #region Setup the screen resolution
            var    bounds = Window.Current.Bounds;
            double height = bounds.Height;
            double width  = bounds.Width;

            ContentPanel.Height = height;
            ContentPanel.Width  = width;
            MainPageGrid.Height = height;
            MainPageGrid.Width  = width;
            #endregion


            random = new Random();
            this.StartFallingSnowAnimation();

            // We keep results in this variable
            //StringBuilder results = new StringBuilder();
            //results.AppendLine();

            //// Create basic date/time formatters.
            //DateTimeFormatter[] basicFormatters = new[]
            //{
            //    // Default date formatters
            //    new DateTimeFormatter("shortdate"),
            //    new DateTimeFormatter("longdate"),

            //    // Default time formatters
            //    new DateTimeFormatter("shorttime"),
            //    new DateTimeFormatter("longtime"),
            // };

            //// Create date/time to format, manipulate and display.
            //DateTime dateTime = DateTime.Now;
            //// Try to format and display date/time if calendar supports it.
            //foreach (DateTimeFormatter formatter in basicFormatters)
            //{
            //    try
            //    {
            //        // Format and display date/time.
            //        results.AppendLine(formatter.Template + ": " + formatter.Format(dateTime));
            //    }
            //    catch (ArgumentException)
            //    {
            //        // Retrieve and display formatter properties.
            //        results.AppendLine(String.Format(
            //            "Unable to format Gregorian DateTime {0} using formatter with template {1} for languages [{2}], region {3}, calendar {4} and clock {5}",
            //            dateTime,
            //            formatter.Template,
            //            string.Join(",", formatter.Languages),
            //            formatter.GeographicRegion,
            //            formatter.Calendar,
            //            formatter.Clock));
            //    }
            //}

            // Display the results
            //this.todaysDateTxtBlock.Text = results.ToString();


            TimeSpan ts    = Christmas - DateTime.Now;
            int      days  = ts.Days;
            int      hours = ts.Hours;
            //diffTxtBlock.Text = days + " days " + hours + "hours";

            Loaded += OnLoaded;
        }
Beispiel #14
0
 public SettingsPage()
 {
     this.InitializeComponent();
     tile_styleComboBox.SelectedIndex = 0;
     appSettings = ApplicationData.Current.LocalSettings.Values;
 }