public MainPage() { InitializeComponent(); isoSettings = IsolatedStorageSettings.ApplicationSettings; basicJsonObjectConverter = new JsonConverter<BasicJsonObject>(); // TODO Remove App.Settings.APP_ID = "cylinder-manager-e30"; App.Settings.API_KEY = "d6c6b4b7aa0f4162a04f23ebd34c6d2e"; App.Settings.ADMIN_KEY = "e4b4709e31924777a4521df5fbf57692"; data = new BasicJsonObject(); // use two-way binding to set BasicjsonObject's key/value pairs JsonObjectGrid.DataContext = data; if (isoSettings.Contains(SETTINGS_BUCKET_NAME)) BucketName_Box.Text = isoSettings[SETTINGS_BUCKET_NAME] as string; if (isoSettings.Contains(SETTINGS_OBJECT_ID)) ObjectId_Box.Text = isoSettings[SETTINGS_OBJECT_ID] as string; if (isoSettings.Contains(SETTINGS_CCID)) CCID_Box.Text = isoSettings[SETTINGS_CCID] as string; if (isoSettings.Contains(SETTINGS_CLIENT_ID)) ClientId_Box.Text = isoSettings[SETTINGS_CLIENT_ID] as string; }
public Login() { InitializeComponent(); this.Loaded += new RoutedEventHandler(Login_Loaded); //加载所有公司、部门、岗位信息 // organClient.GetCompanyActivedAsync(""); //登录控件禁用 在加载完组织架构后 再激活 this.OK.IsEnabled = false; this.OK.Content = "加载中...."; settings = IsolatedStorageSettings.ApplicationSettings; if (settings.Contains("SYS_PostInfo") && settings["SYS_PostInfo"] != null) { App.Current.Resources.Add("SYS_PostInfo", settings["SYS_PostInfo"]); App.Current.Resources.Add("SYS_CompanyInfo", settings["SYS_CompanyInfo"]); App.Current.Resources.Add("SYS_DepartmentInfo", settings["SYS_DepartmentInfo"]); } isDict = true; isHR = true; if (settings.Contains("UserName")) { UserName.Text = Convert.ToString(settings["UserName"]); paw.Password = Convert.ToString(settings["UserPWD"]); } RefreshBtn(); }
// Constructor public MainPage() { InitializeComponent(); savedSettings = IsolatedStorageSettings.ApplicationSettings; if (savedSettings.Contains("callsign")) { callsign = (string)savedSettings["callsign"]; } tbCallsign.Text = callsign + "_chase"; if (savedSettings.Contains("interval")) { interval = Convert.ToUInt32(savedSettings["interval"]); } if (savedSettings.Contains("consent")) { consent = (bool)savedSettings["consent"]; } if (!consent) { MessageBoxResult result = MessageBox.Show("This app accesses your phone's location. Is this okay?", "Location", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { updateSetting("consent", true); consent = true; } } }
public classicgamelevel() { InitializeComponent(); var prog = new ProgressIndicator { Text = "Lord of The Math", IsVisible = true, IsIndeterminate = false, Value = 0 }; SystemTray.SetProgressIndicator(this, prog); stroge = IsolatedStorageSettings.ApplicationSettings; if (!stroge.Contains("levelclassic")) { IsolatedStorageSettings.ApplicationSettings["levelclassic"] = "1"; IsolatedStorageSettings.ApplicationSettings.Save(); } //gameoverden gelince limitsizi açması için if (stroge.Contains("hangigrid")) { if (IsolatedStorageSettings.ApplicationSettings["hangigrid"] == "1") { kırmızı.Visibility = Visibility.Visible; yesil.Visibility = Visibility.Collapsed; imgkırmızı.Opacity = 100; imgyesil.Opacity = 0; } } levelresimleri(); }
public Password() { InitializeComponent(); appSettings = IsolatedStorageSettings.ApplicationSettings; if (!appSettings.Contains("pass")) { appSettings.Add("pass", "blue"); } if (!appSettings.Contains("fake")) { appSettings.Add("fake", "red"); } pass = (string)appSettings["pass"]; fakePass = (string)appSettings["fake"]; }
public StorageHandler() { settings = IsolatedStorageSettings.ApplicationSettings; if (!settings.Contains(levelsKey)) { settings.Add(levelsKey, new LevelsInfo()); } if (!settings.Contains(challengesKey)) { settings.Add(challengesKey, new ChallengesInfo()); } }
public MainPage() { InitializeComponent(); map1.ZoomLevel = 18; settings = IsolatedStorageSettings.ApplicationSettings; if (settings.Contains("map")) { if ((int)settings["map"] == 0) { map1.Mode = new AerialMode(); } } else { map1.Mode = new RoadMode(); } pin1.Location = map1.Center; map1.Children.Add(pin1); if (settings.Contains("name")) { if ((string)settings["name"] != "") MessageBox.Show("Welcome back " + (string)settings["name"] + ". Get Ready."); } else MessageBox.Show("Welcome to Workout Assistant. U may consider to create/update your profile in settings->profile"); if (settings.Contains("EnableLocation")) { if ((bool)settings["EnableLocation"] == false) { MessageBoxResult m = MessageBox.Show("This App cannot work without Location service, Enable Location service?", "Problem Spotted!!", MessageBoxButton.OKCancel); if (m == MessageBoxResult.OK) settings["EnableLocation"] = true; else { if (NavigationService.CanGoBack) { NavigationService.GoBack(); } } } } else settings["EnableLocation"] = true; StartLocationService(GeoPositionAccuracy.High, true); }
// Constructor public Login() { InitializeComponent(); CreateAppbar(); settings = IsolatedStorageSettings.ApplicationSettings; if (settings.Contains("username")) { Username.Text = settings["username"] as string; } if (settings.Contains("password")) { var passBytes = ProtectedData.Unprotect(settings["password"] as byte[], null); Password.Password = Encoding.UTF8.GetString(passBytes, 0, passBytes.Length); } }
public AccountViewModel(Simperium.Settings _settings) { isoSettings = IsolatedStorageSettings.ApplicationSettings; settings = _settings; if (isoSettings.Contains(SETTINGS_APP_ID)) settings.APP_ID = (isoSettings[SETTINGS_APP_ID] as string); }
public About() { InitializeComponent(); settings = IsolatedStorageSettings.ApplicationSettings; // Load initial settings if (settings.Contains("UseLocation")) { locationtoggle.IsChecked = settings["UseLocation"].ToString() == "true"; } else { settings["UseLocation"] = "false"; locationtoggle.IsChecked = false; } textBlock1.Text = "WHEWCIRC\nVersion "+ appversion +"\n\nCoded lovingly by\nJeff Stephens in St. Louis\n@jefftheman45"; textBlock1.Text += "\n\nFor support, please contact\[email protected]"; textBlock1.Text += "\n\nThanks to Colin E. for his great article on\nanimation!"; // Change logo if light theme Visibility isLight = (Visibility)Resources["PhoneLightThemeVisibility"]; // for light theme if (isLight == System.Windows.Visibility.Visible) { image1.Source = new BitmapImage(new Uri("/WhewCirc;component/icons/Marketplace_Device_173x173.png", UriKind.Relative)); } }
// Constructor public MainPage() { InitializeComponent(); settings = IsolatedStorageSettings.ApplicationSettings; if (! settings.Contains("data")) { settings.Add("data", ""); } }
private void LoadSettings() { _isolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings; if (_isolatedStorageSettings.Contains(_merchantServerUrlKey)) { _merchantServerUrl = (string)_isolatedStorageSettings[_merchantServerUrlKey]; } }
/// <summary> /// Private helper method for performing deletes on a setting /// </summary> /// <param name="store">The IsolatedStorageSettings store to use (either "site" or "application")</param> /// <param name="key">The key of the object to delete</param> private static void DeleteSetting(IsolatedStorageSettings store, string key) { if(store.Contains(key)) { store.Remove(key); store.Save(); } }
private RecentData() { storage = IsolatedStorageSettings.ApplicationSettings; if (storage.Contains("recent")) data = (List<string>)storage["recent"]; else data = new List<string>(); }
//constructor gets settings public StorageSetting() { settings = IsolatedStorageSettings.ApplicationSettings; if (!settings.Contains(RouteMode)) { settings.Add(RouteMode, RouteModeDefault); settings.Save(); } }
public MainPage() { InitializeComponent(); _isNew = true; _isolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings; if (_isolatedStorageSettings.Contains(EMAIL_ADDRESS_KEY)) Address.Text = _isolatedStorageSettings[EMAIL_ADDRESS_KEY].ToString(); }
private FavoriteData() { storage = IsolatedStorageSettings.ApplicationSettings; if (storage.Contains("favorites")) data = (List<string>)storage["favorites"]; else data = new List<string>(); }
private void LoadSettings() { _isolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings; if (_isolatedStorageSettings.Contains(_merchantServerUrlKey)) { MerchantServerUrl.Text = (string)_isolatedStorageSettings[_merchantServerUrlKey]; } else _isolatedStorageSettings.Add(_merchantServerUrlKey, ""); }
// Constructor public MainPage() { InitializeComponent(); settings = IsolatedStorageSettings.ApplicationSettings; if (! settings.Contains("memory")) { settings.Add("memory", ""); } if (!settings.Contains("haptic")) { settings.Add("haptic", is_haptic); } is_haptic = settings["haptic"].ToString(); b_haptic = (ApplicationBarIconButton)ApplicationBar.Buttons[0]; b_nohaptic = (ApplicationBarIconButton)ApplicationBar.Buttons[1]; b_point = (ApplicationBarIconButton)ApplicationBar.Buttons[2]; b_comma = (ApplicationBarIconButton)ApplicationBar.Buttons[3]; b_haptic.IsEnabled = is_haptic == "0"; b_nohaptic.IsEnabled = is_haptic != "0"; // decimal point or comma is hidden during a callback in do_load() }
void FotoTomada_Loaded(object sender, RoutedEventArgs e) { ReadFromIsolatedStorage("FotoSacada"); settings = IsolatedStorageSettings.ApplicationSettings; if (!settings.Contains("mostrarPopUp")) { settings.Add("mostrarPopUp","True"); } }
// Constructor public MainPage() { InitializeComponent(); //Thread.Sleep(2000); settings = IsolatedStorageSettings.ApplicationSettings; colocarAudiosSiNoExisten(); if (!settings.Contains("mostrarMensajeMusica")) { //MessageBox.Show("hola"); settings.Add("mostrarMensajeMusica", "false"); } }
// Constructor public MainPage() { InitializeComponent(); // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); mobileTribunal = MobileTribunal.GetInstance(); loginHandler = new LoginHandler(mobileTribunal); appSettings = IsolatedStorageSettings.ApplicationSettings; if (appSettings.Contains("Username")) { UsernameWatermark.Visibility = System.Windows.Visibility.Collapsed; UsernameField.Text = appSettings["Username"].ToString(); } if (appSettings.Contains("Remember")) { RememberCheckBox.IsChecked = true; } instance = this; }
/// <summary> /// Private helper method for performing saves on settings /// </summary> /// <param name="store">The IsolatedStorageSettings store to use (either "site" or "application")</param> /// <param name="key">The key of the object to save</param> /// <param name="value">The value to be saved in storage</param> private static void SaveOrUpdateSetting(IsolatedStorageSettings store, string key, object value) { if (store.Contains(key)) { store[key] = value; } //Otheriwse, add this new key and its value to the store else { store.Add(key, value); } store.Save(); }
// get virtual space for application private LocationData() { storage = IsolatedStorageSettings.ApplicationSettings; if ( storage.Contains("data") ) data = (Dictionary<string, SimpleCoordinates>)storage["data"]; else data = new Dictionary<string, SimpleCoordinates>(); // add sample test data this["http://www.europeana.eu/portal/record/09421/81F7D02542BF7B77BE9F0DBC1D2017D5503953A5.html"] = new SimpleCoordinates(4.699835, 50.874304); this["http://www.europeana.eu/portal/record/09421/401D3574118D2D7166F73946C56FCD73434C1D15.html"] = new SimpleCoordinates(4.698633, 50.877689); this["http://www.europeana.eu/portal/record/92106/FA96E7D51F97A14C7FF2548E03F3CDF14132A8D0.html"] = new SimpleCoordinates(4.706666, 50.878421); }
private void SaveCity(string city) { m_appSettings = IsolatedStorageSettings.ApplicationSettings; if (m_appSettings.Contains("city")) { m_appSettings["city"] = city; } else { m_appSettings.Add("city", city); } m_appSettings.Save(); WebService.City = city; }
// Constructor public MainPage() { settings = IsolatedStorageSettings.ApplicationSettings; InitializeComponent(); // Sample code to localize the ApplicationBar BuildLocalizedApplicationBar(); // Set reasonable limits for SNPP this.numberTextBox.MaxLength = 10; this.messageTextBox.MaxLength = 240; if (settings.Contains("snppserver")) { snppTextBox.Text = (string)settings[snppserver]; } if (settings.Contains("number")) { numberTextBox.Text = (string)settings[number]; } }
// Constructor public MainPage() { InitializeComponent(); settings = IsolatedStorageSettings.ApplicationSettings; ready = false; DateTime now = DateTime.Now; Debugger.Log(0, "Debug", "NextCirc Version " + NextCirc.Images.About.appVersion.ToString("N1") + "\nCurrent Time: " + now.ToShortDateString() + " " + now.ToShortTimeString() + "\n\n"); // Load saved stop if (settings.Contains(curStopKey)) { currentStop = Convert.ToInt32(settings[curStopKey]); Debugger.Log(0, "Debug", "found setting = " + currentStop + "\n"); } else { settings.Add(curStopKey, currentStop); Debugger.Log(0, "Debug", "no setting\n"); } // Build list of stops stopList = new List<CircStop>(); // TODO: stopList.Add(new CircStop("NextCirc", new GeoCoordinate(0, 0), 0)); stopList.Add(new CircStop("south forty", new GeoCoordinate(38.645327, -90.312952), 0)); stopList.Add(new CircStop("mallinckrodt (to skinker)", new GeoCoordinate(38.647021, -90.309522), 3)); stopList.Add(new CircStop("skinker", new GeoCoordinate(38.647654, -90.30133), 6)); stopList.Add(new CircStop("millbrook", new GeoCoordinate(38.650172, -90.311331), 10)); stopList.Add(new CircStop("brookings", new GeoCoordinate(38.647923, -90.304025), 14)); stopList.Add(new CircStop("mallinckrodt (to south forty)", new GeoCoordinate(38.647021, -90.309522), 17)); this.stopPicker.ItemsSource = stopList; this.stopPicker.SelectedIndex = currentStop; ready = true; Debugger.Log(0, "Debug", "initialized.\n"); chooseStop(currentStop); // Register timer to keep View up to date DispatcherTimer timer = new DispatcherTimer(); timer.Tick += timer_Tick; timer.Interval = new TimeSpan(0, 0, 1); timer.Start(); // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); }
public static string GetCity() { if(m_strCity == null) { m_appSetting = IsolatedStorageSettings.ApplicationSettings; if (!m_appSetting.Contains("city")) { m_strCity = DEFAULT_CITY; } else { m_strCity = m_appSetting["city"].ToString(); } } return m_strCity; }
public AppSettings(IsolatedStorageSettings settings) { if (settings == null) throw new ArgumentNullException("settings"); _settings = settings; _globalPass = new GlobalPassHandler(this); if (!_settings.Contains(KEY_INSTANCE_ID)) { _instanceId = Guid.NewGuid().ToString("N"); _settings[KEY_INSTANCE_ID] = _instanceId; _settings.Save(); } else _instanceId = (string)_settings[KEY_INSTANCE_ID]; }
private void MainPageLoaded(object sender, RoutedEventArgs e) { if (!NetworkInterface.GetIsNetworkAvailable()) { MessageBox.Show("This application must require for internet connection. Please check your internet connection status", "Sorry", MessageBoxButton.OK); this.NavigationService.GoBack(); } settings = IsolatedStorageSettings.ApplicationSettings; if (settings.Contains("facebook_token")) { if (MessageBox.Show("You've aleardy setting facebook account. Reset your account?", "Notice", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel) { this.NavigationService.GoBack(); } } wbLogin.Navigate(FBUris.GetLoginUri()); }
public static void Write <TT>(string name, TT value) { System.IO.IsolatedStorage.IsolatedStorageSettings settings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings; if (settings == null) { return; } if (settings.Contains(name)) { settings[name] = value; } else { settings.Add(name, value); } settings.Save(); }
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { SystemTray.ProgressIndicator = new ProgressIndicator(); SystemTray.ProgressIndicator.IsIndeterminate = true; if ((string)store["disableLandscape"] == "true") { ListTopicPage.SupportedOrientations = SupportedPageOrientation.Portrait; } if (store.Contains("navigatedback")) { store.Remove("navigatedback"); if (isoStore.DirectoryExists("topics")) { foreach (string fileName in isoStore.GetFileNames("topics/*")) { isoStore.DeleteFile("topics/" + fileName); } } } else { // Récupération de l'URI de la sous-catégorie NavigationContext.QueryString.TryGetValue("souscaturi", out souscatUri); souscatUri = HttpUtility.UrlDecode(souscatUri); // Récupération de l'ID de la catégorie NavigationContext.QueryString.TryGetValue("idcat", out idCat); // Récupération du nom du forum NavigationContext.QueryString.TryGetValue("souscatname", out souscatName); if (souscatName == null) { souscatName = GetCatName.PlainNameFromId(idCat); } topicsPivot.Title = souscatName.ToUpper(); // Récupération de la provenance NavigationContext.QueryString.TryGetValue("from", out from); if (from == "changepage") { NavigationService.RemoveBackEntry(); } // Pivot NavigationContext.QueryString.TryGetValue("pivot", out pivot); // listPageNumber NavigationContext.QueryString.TryGetValue("listpagenumber", out listPageNumber); if (Convert.ToInt32(listPageNumber) > 1) { ((ApplicationBarIconButton)ApplicationBar.Buttons[1]).IsEnabled = true; } else { ((ApplicationBarIconButton)ApplicationBar.Buttons[1]).IsEnabled = false; } if (!souscatUri.Contains("cat=0")) { souscatUri = souscatUri.Substring(0, souscatUri.Length - 5) + listPageNumber + ".htm"; } if (pivot == "drap") { topicsPivot.SelectedIndex = 1; } else if (pivot == "topics") { topicsPivot.SelectedIndex = 0; } // Récupération du cookie if (store.Contains("HFRcookies")) { container = store["HFRcookies"] as CookieContainer; } else { // Création du cookie de l'user List <Cookie> listCookies = store["listHFRcookies"] as List <Cookie>; foreach (Cookie c in listCookies) { container.Add(new Uri("https://forum.hardware.fr", UriKind.Absolute), c); } store.Remove("HFRcookies"); store.Add("HFRcookies", container); } // ItemsSources drapList.ItemsSource = null; topicsList.ItemsSource = null; // Téléchargement de la liste DownloadTopicsDrapals(Convert.ToInt32(listPageNumber)); } }