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); } }
async void DataChangedHandler(ApplicationData appData, object o) { // DataChangeHandler may be invoked on a background thread, so use the Dispatcher to invoke the UI-related code on the UI thread. await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { DisplayOutput(); }); }
private void SettingsChanged(Windows.Storage.ApplicationData sender, object args) { RaisePropertyChanged(nameof(WordWrap)); RaisePropertyChanged(nameof(FontFamily)); RaisePropertyChanged(nameof(FontSize)); RaisePropertyChanged(nameof(UseSoftTab)); RaisePropertyChanged(nameof(TabSize)); }
async void DataChangedHandler(Windows.Storage.ApplicationData appData, object o) { // DataChangeHandler may be invoked on a background thread, so use the Dispatcher to invoke the UI-related code on the UI thread. await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { DisplayOutput(); }); }
public SetVersion() { this.InitializeComponent(); appData = ApplicationData.Current; DisplayOutput(); }
/// <summary> /// Roaming app data change handler /// </summary> /// <param name="appData"></param> /// <param name="o"></param> void DataChangeHandler(Windows.Storage.ApplicationData appData, object o) { ApplicationDataContainer roamingSettings = appData.RoamingSettings; current_state.access_token = (string)roamingSettings.Values["access_token"]; current_state.refresh_token = (string)roamingSettings.Values["refresh_token"]; current_state.expire_time = DateTime.Parse((string)roamingSettings.Values["expire_time"]); current_state.logged_in = (bool)roamingSettings.Values["logged_in"]; }
public DataChangedEvent() { this.InitializeComponent(); applicationData = ApplicationData.Current; roamingSettings = applicationData.RoamingSettings; DisplayOutput(); }
public HighPriority() { this.InitializeComponent(); applicationData = ApplicationData.Current; roamingSettings = applicationData.RoamingSettings; DisplayOutput(false); }
/// <summary> /// Event triggered when an ApplicationData's RoamingSettings are changed (gets changed in the SettingsOptionsContext page /// which is part of the Settings flyout) /// </summary> async void Current_DataChanged(ApplicationData sender, object args) { // DataChangeHandler may be invoked on a background thread, so use the Dispatcher to invoke the UI-related code on the // UI thread. await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { // Cause the web browser to reload in its content UpdateURI(); }); }
public static IEnumerable<string> GetChannelsOrDefault(ApplicationData data = null) { if (data == null) data = ApplicationData.Current; var channels = data.RoamingSettings.Values["Channels"] as string; if (string.IsNullOrWhiteSpace(channels)) return new List<string> { "10","11","9","12","299","15","21","156" }; return channels.ToObject<ChannelGroup>().ChannelIds; }
public static IEnumerable<string> GetFavoritesOrDefault(ApplicationData data = null) { if (data == null) data = ApplicationData.Current; var favorites = data.RoamingSettings.Values["Favorites"] as string; if (string.IsNullOrWhiteSpace(favorites)) return new List<string>(); return favorites.ToObject<FavoriteGroup>().Favorites; }
async void DataChangedHandler(Windows.Storage.ApplicationData sender, object args) { // DataChangeHandler may be invoked on a background thread, // so use the Dispatcher to invoke the UI-related code on the UI thread. await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { var roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; DateTime lastSuspensionTime = Convert.ToDateTime( roamingSettings.Values["lastRoamingSettingDate"].ToString()); DataChangedInvoked.Text = "Yes"; }); }
private void InitializeApplicationSettingsSections() { applicationData = ApplicationData.Current; localSettings = applicationData.LocalSettings; if (localSettings.Values["Credentials"] == null) { credentials = new Windows.Storage.ApplicationDataCompositeValue(); } else { credentials = (ApplicationDataCompositeValue)localSettings.Values["Credentials"]; } }
private static async void CurrentOnDataChanged(ApplicationData sender, object args) { try { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (DataChanged != null) { DataChanged(args, null); } }); } catch (Exception ex) { if (DataChanged != null) { DataChanged(null, ex); } } }
async void Current_DataChanged(ApplicationData sender, object args) { if (viewModel != null) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { var channels = App.GetChannelsOrDefault(sender); var changed = CheckIfChanged(channels); if (changed) { viewModel.Channels = channels; await LoadChannels(); } else { UpdateFavorites(); } }); } }
/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; appData = ApplicationData.Current; Object value = appData.LocalSettings.Values["scannerInterval"]; if (value == null) { // No data System.Diagnostics.Debug.WriteLine("Null"); button_scanner_interval = 5; appData.LocalSettings.Values["scannerInterval"] = button_scanner_interval; } else { button_scanner_interval = (int)value; } deviceController = new DeviceManager(); bm.connectToDefault(null, null); time.Interval = TimeSpan.FromSeconds(15); time.Tick += checkConnection; time.Start(); }
private void Current_DataChanged(ApplicationData sender, object args) { //is this only for a roaming change? }
private static void DataChangeHandler(ApplicationData data, object o) { // Refresh data here! LoadData(); }
//TODO: Fix this to actually update lists in the various views somehow. Maybe each view should be responsible for subscribing to it? private async void OnRoamingDataChanged(ApplicationData sender, object args) { using (await f_lock.Acquire()) { foreach (var file in _localFiles) { if (file.IsRoamed) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => _localFiles.Remove(file)); } } var roamingFiles = await sender.RoamingFolder.GetFilesAsync(); foreach (var file in roamingFiles.Where(f => f.Name != Constants.IV_FILE_NAME)) { BindableStorageFile bsf = await BindableStorageFile.Create(file); await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => _localFiles.Add(bsf)); } } }
async void onDataChanged(Windows.Storage.ApplicationData sender, object args) => await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => tbRoamDataChd.Text = $"{DateTime.Now:ddd HH:mm:ss} {DevOp.MachineName} {args}\r\n" + tbRoamDataChd.Text);
private async void LoadSavedGame(ApplicationData appData) { try { CurrentGame = await StorageHelper.GetObjectFromRoamingFolder<Game>(appData, STR_Gamejson); CurrentGame.OnFailure += _game_OnFailure; CurrentGame.OnVictory += _game_OnVictory; Moves.Clear(); var moves = await StorageHelper.GetObjectFromRoamingFolder<ObservableCollection<PlayerMoveViewModel>>(appData, STR_Movesjson); foreach (var move in moves) { Moves.Add(move); } MoveSlotOne = StorageHelper.GetObjectFromSetting<string>(appData, "MoveSlotOne"); MoveSlotTwo = StorageHelper.GetObjectFromSetting<string>(appData, "MoveSlotTwo"); MoveSlotThree = StorageHelper.GetObjectFromSetting<string>(appData, "MoveSlotThree"); MoveSlotFour = StorageHelper.GetObjectFromSetting<string>(appData, "MoveSlotFour"); SolutionVisibility = Visibility.Collapsed; } catch (Exception ex) { // show error message ClearSavedGameState(); Messenger.Default.Send<ErrorLoadingGameMessage>(new ErrorLoadingGameMessage(ex)); // start new game StartNewGame(); } }
private void DataChangeHandler(ApplicationData appData, object o) { // TODO: Make a decision here to load the saved game data or not based on some rules. For now, just load it if you find it. LoadSavedGame(appData); }
public void Current_DataChanged(ApplicationData sender, object args) { Debug.WriteLine("Roaming data is veranderd"); }
public SharedPreferencesPropertySet() { #pragma warning disable 618 _preferences = PreferenceManager.GetDefaultSharedPreferences(ApplicationData.GetAndroidAppContext()); #pragma warning restore 618 }
public void RefreshData(ApplicationData freshData) { var roamingSettings = freshData.RoamingSettings; // roamingSettings.Values["profile"] = composite; //check if there is already a profile if (roamingSettings.Values.ContainsKey("profile")) { var composite = roamingSettings.Values["profile"] as ApplicationDataCompositeValue; if (composite != null) { if (composite.ContainsKey("recitatorId")) { var selected = composite["recitatorId"] as int?; if (selected != null) { RecitatorId = selected.Value; } } } } SaveProfile(RecitatorId); }
private void RoamingDataChangeHandler(Windows.Storage.ApplicationData appData, object o) { NotificationsManager.UpdateTaskNotifications(); }
private void applicationData_DataChanged(ApplicationData sender, object args) { Debug.WriteLine("DataChanged"); }
partial void InitializePartial(ApplicationData owner) { Values = new NSUserDefaultsPropertySet(); }
partial void InitializePartial(ApplicationData owner) { Values = new FilePropertySet(owner, Locality); }
private void Current_DataChanged(ApplicationData sender, object args) { ApplicationDataContainer roamingSettings = ApplicationData.Current.RoamingSettings; var ac = roamingSettings.Values["AutoConnect"]; AutoConnect = (ac == null) ? false : true; }
/// <summary> /// Creates a new instance of <see cref="WinRTFileSystem"/> /// </summary> public WinRTFileSystem() { _applicationData = ApplicationData.Current; }
private void DataChangeHandler(Windows.Storage.ApplicationData appData, object someObject) { // Refresh local data here. }
private async void DataChangedHandler(ApplicationData sender, object args) { Debug.WriteLine("Data changed!"); await this.Dispatcher.DispatchAsync(async () => { if (timer != null && timer.IsEnabled) { timer.Stop(); } await App.AccountsModel.ReadChanged(); }); }
private void DataChangeHandler(ApplicationData appData, object o) { ReloadItems(); }
public void DataChangeHandler(Windows.Storage.ApplicationData appData, object o) { // TODO: Refresh your data }
private async void OnDataChanged(ApplicationData sender, object args) { string message = "Application data " + sender.Version + " synchronized on " + DateTime.Now; string title = "Roaming Application Data Synchronized"; // When data changes. Settings should be unloaded/loaded so websites get synchronized. SettingsManager.Unload(); SettingsManager.Load(); // Also unload and load read-list. ReadListManager.Unload(); // When data changes, the read-list may contain new read-questions. await QuestionsManager.RemoveReadQuestionsUpdateTileAndBadgeAndSaveAsync(); HandleTaskCompletedOrDataChanged(message, title); }
private void AppDataOnDataChanged(ApplicationData sender, object args) { var content = new ToastContent() { Visual = new ToastVisual() { TitleText = new ToastText() { Text = "Selfwin" }, BodyTextLine1 = new ToastText() { Text = "Settings have roamed to your device" }, }, }; var toast = new ToastNotification(content.GetXml()); var notifier = ToastNotificationManager.CreateToastNotifier(); notifier.Show(toast); }
private void Current_DataChanged(ApplicationData sender, object args) { }
void DataChangeHandler(ApplicationData appData, object o) { }
partial void InitializePartial(ApplicationData owner) { Values = new SharedPreferencesPropertySet(); }
private static void Current_DataChanged(ApplicationData sender, object args) { if(OnDataChanged != null) { // TODO: This callback should be passed some context.. otherwise the user will have no idea // on what changed and what to do. OnDataChanged(); } }
private void Current_DataChanged(ApplicationData sender, object args) { Object value = roamingSettings.Values["SeekValue"]; }
void DataChangeHandler(Windows.Storage.ApplicationData appData, object o) { DoRefresh(); }
public ApplicationDataEvents(ApplicationData This) { this.This = This; }
partial void InitializePartial(ApplicationData owner);
static ApplicationData() { _instance = new ApplicationData(); _instance.Initialize(); }