public override void ViewDidLoad() { base.ViewDidLoad (); Title = "WatchTodo"; // Perform any additional setup after loading the view, typically from a nib. NSUserDefaults shared = new NSUserDefaults( "group.co.conceptdev.WatchTodo", NSUserDefaultsType.SuiteName); var isEnabled = shared.BoolForKey ("enabled_preference"); var name = shared.StringForKey ("name_preference"); Console.WriteLine ("Enabled: " + isEnabled); Console.WriteLine ("Name: " + name); //Title = name; // for testing }
static iCloudPrefs() { if (CoreXT.IsDevice) { // get id from user defaults _userDefaults = NSUserDefaults.StandardUserDefaults(); iCloudID = _userDefaults.Object(ID_KEY) as string; store = NSUbiquitousKeyValueStore.DefaultStore(); store.DidChangeExternally += _OnStoreChanged; NSFileManager.DefaultManager().UbiquityIdentityDidChange += _Init; CoreXT.ApplicationResumed += _Init; _Init(); } }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear (animated); NSUserDefaults shared = new NSUserDefaults("group.com.conceptdevelopment.TodoToday", NSUserDefaultsType.SuiteName); var count = shared.IntForKey ("TodoCount"); Console.WriteLine ("Read NSUserDefaults TodoCount: " + count); if (count == 0) { todoLabel.Text = "nothing to do"; } else if (count == 1) { todoLabel.Text = "one thing to do"; } else { todoLabel.Text = String.Format("{0} things to do", count); } // textToSpeak = todoLabel.Text; }
public SettingsImpl(string nameSpace) { this.KeysNotToClear = new List<string> { "WebKitKerningAndLigaturesEnabledByDefault", "AppleLanguages", "monodevelop-port", "AppleITunesStoreItemKinds", "AppleLocale", "connection-mode", "AppleKeyboards", "NSLanguages", "UIDisableLegacyTextView", "NSInterfaceStyle" }; if (nameSpace == null) { this.prefs = NSUserDefaults.StandardUserDefaults; this.IsRoamingProfile = false; } else { this.prefs = new NSUserDefaults(nameSpace, NSUserDefaultsType.SuiteName); this.IsRoamingProfile = true; } }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { SettingsTableViewCell cell; SettingsProfileTableViewCell cell2; TextTableViewCell cell3; int section = indexPath.Section; int row = indexPath.Row; if (section == 0) { if (row == 0) { cell = (SettingsTableViewCell)tableView.DequeueReusableCell(CELL_ID, indexPath); cell.Tag = 100; cell.UpdateLabelText(); return(cell); } else if (row == 1) { cell = (SettingsTableViewCell)tableView.DequeueReusableCell(CELL_ID, indexPath); cell.Tag = 101; cell.UpdateLabelText(); return(cell); } } else if (section == 1) { cell2 = (SettingsProfileTableViewCell)tableView.DequeueReusableCell(PROFILE_CELL_ID, indexPath); NSUserDefaults defaults = NSUserDefaults.StandardUserDefaults; nint row_ = defaults.IntForKey("selectedProfile"); if (row_ == row) { cell2.Accessory = UITableViewCellAccessory.Checkmark; } else { cell2.Accessory = UITableViewCellAccessory.None; } switch (row) { case 0: cell2.Configure("profile_button_original", "Original"); break; case 1: cell2.Configure("profile_button_bw", "Black & White"); break; case 2: cell2.Configure("profile_button_gray", "Gray"); break; case 3: cell2.Configure("profile_button_color", "Color"); break; } return(cell2); } else if (section == 2) { cell = (SettingsTableViewCell)tableView.DequeueReusableCell(CELL_ID, indexPath); cell.Accessory = UITableViewCellAccessory.None; if (row == 0) { cell.Tag = 102; } else { cell.Tag = 103; } cell.UpdateLabelText(); return(cell); } else if (section == 3) { cell3 = (TextTableViewCell)tableView.DequeueReusableCell(TEXT_PROFILE_CELL_ID, indexPath); cell3.Accessory = UITableViewCellAccessory.None; if (row == 0) { cell3.Tag = 104; } cell3.UpdateLabelText(); return(cell3); } else if (section == 4) { cell2 = (SettingsProfileTableViewCell)tableView.DequeueReusableCell(PROFILE_CELL_ID, indexPath); NSUserDefaults defaults = NSUserDefaults.StandardUserDefaults; nint row_ = defaults.IntForKey("selectedSaveFormat"); cell2.Accessory = row_ == row ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None ; switch (row) { case 0: cell2.Configure("save_format_button_pdf", "PDF"); break; case 1: { cell2.Configure("save_format_button_pdf_from_png", "PDF from PNG"); break; } case 2: { cell2.Configure("save_format_button_tiff", "TIFF G4"); break; } case 3: { cell2.Configure("save_format_button_png", "PNG"); break; } case 4: { cell2.Configure("save_format_button_jpg", "JPG"); break; } } return(cell2); } else if (section == 5) { cell = (SettingsTableViewCell)tableView.DequeueReusableCell(CELL_ID, indexPath); cell.Accessory = UITableViewCellAccessory.None; cell.Tag = 104; cell.UpdateLabelText(); return(cell); } else if (section == 6) { cell2 = (SettingsProfileTableViewCell)tableView.DequeueReusableCell(PROFILE_CELL_ID, indexPath); cell2.Accessory = UITableViewCellAccessory.None; cell2.Configure("", "About product"); return(cell2); } return(null); }
public static T GetSerializedObject <T> (this NSUserDefaults instance, string defaultName) { return(SerializerHelper.DeserializeObject <T> (instance.StringForKey(defaultName))); }
async Task ReportScore() { string leaderboardIdentifier = null; string gameTypeString = null; GameTypePlayed gameType = GameTypePlayed.Invalid; if (GameInfo.GameTime == GameTime.Fifteen) { if (GameInfo.GameMode == GameMode.Easy) { gameTypeString = "15secondseasymode"; gameType = GameTypePlayed.Easy15; } else if (GameInfo.GameMode == GameMode.Hard) { gameTypeString = "15secondshardmode"; gameType = GameTypePlayed.Hard15; } } else if (GameInfo.GameTime == GameTime.Thirty) { if (GameInfo.GameMode == GameMode.Easy) { gameTypeString = "30secondseasymode"; gameType = GameTypePlayed.Easy30; } else if (GameInfo.GameMode == GameMode.Hard) { gameTypeString = "30secondshardmode"; gameType = GameTypePlayed.Hard30; } } else if (GameInfo.GameTime == GameTime.FourtyFive) { if (GameInfo.GameMode == GameMode.Easy) { gameTypeString = "45secondseasymode"; gameType = GameTypePlayed.Easy45; } else if (GameInfo.GameMode == GameMode.Hard) { gameTypeString = "45secondshardmode"; gameType = GameTypePlayed.Hard45; } } if (gameTypeString != null) { leaderboardIdentifier = Prefix + gameTypeString; } if (leaderboardIdentifier != null) { GKScore score = new GKScore(leaderboardIdentifier) { Value = GameInfo.CurrentTaps, Context = 0 }; var challenges = GameInfo.Challenge == null ? null : new [] { GameInfo.Challenge }; await GKScore.ReportScoresAsync(new [] { score }, challenges); } if (GKLocalPlayer.LocalPlayer.Authenticated) { if (GameInfo.GameMode == GameMode.Hard) { var playhard = new GKAchievement(PlayHardId, GKLocalPlayer.LocalPlayer.PlayerID) { PercentComplete = 100 }; await GKAchievement.ReportAchievementsAsync(new [] { playhard }); } int playedGameTypesBitField; using (NSUserDefaults defaults = NSUserDefaults.StandardUserDefaults) { playedGameTypesBitField = (int)defaults.IntForKey("playedGameTypes") | (int)gameType; defaults.SetInt(playedGameTypesBitField, "playedGameTypes"); defaults.Synchronize(); } int numTypesPlayed = 0; for (int i = 0; i < 6; i++) { if ((playedGameTypesBitField & 0x01) != 0) { numTypesPlayed++; } playedGameTypesBitField >>= 1; } GKAchievement playAllModesAchievement = new GKAchievement(PlayAllId) { PercentComplete = numTypesPlayed / 6.0 * 100.0 }; await GKAchievement.ReportAchievementsAsync(new [] { playAllModesAchievement }); await UpdateCurrentTapsLeaderboardAndTapAchievements(); } }
public TouchStoredSettingsBase() { _preferences = NSUserDefaults.StandardUserDefaults; }
public PreferencesService() { _standardDefaults = NSUserDefaults.StandardUserDefaults; }
public override void ViewDidLoad() { base.ViewDidLoad (); _appController.ShowSelected += toggleShowSelected; userDefs = NSUserDefaults.StandardUserDefaults; UIApplication.Notifications.ObserveDidEnterBackground ((sender, args) => { var ser = JsonSerializer.SerializeToString (_appController.Eigenschappen); if (IsProfileNull) { userDefs.SetString (ser, "eigenschappen"); userDefs.Synchronize (); } else { _appController.AddOrUpdateEigenschappenSer (currProfiel.name, ser); } }); }
void SetElementValueFromDefaults(EntryElement e, NSUserDefaults defs, string key, string defaultVal) { string value = defs.StringForKey (key); if (value == null) e.Value = defaultVal; else e.Value = value; }
public static IDictionary <string, string> AsDictionary(this NSUserDefaults defaults) { return(defaults .ToDictionary() .ToDictionary(x => x.Key.ToString(), x => x.Value.ToString())); }
public override void WillActivate() { // This method is called when the watch view controller is about to be visible to the user. Console.WriteLine ("{0} will activate", this); NSUserDefaults shared = new NSUserDefaults (); var isEnabled = shared.BoolForKey ("enabled_preference"); var name = shared.StringForKey ("name_preference"); Console.WriteLine ("Enabled: " + isEnabled); Console.WriteLine ("Name: " + name); // reload each view data = Database.GetItems ().ToList(); // HACK: the recommendation is to use Insert and Remove rows // becaues if you reload the entire table, all the data is // re-sent from the extension to the watch TodoTable.SetNumberOfRows ((nint)data.Count, "todoRow"); for (var i = 0; i < data.Count; i++) { var elementRow = (TodoRowController)TodoTable.GetRowController (i); elementRow.Set(data [i].Name, data [i].Done); } }
public void RespondToChangeEvent(object sender, CheckPointDataChangedEventArgs args) { ToastNotificationType type; switch (args.ActionOccurred) { case ActionType.Deleted: type = ToastNotificationType.Error; break; case ActionType.Written: type = ToastNotificationType.Warning; break; default: type = ToastNotificationType.Info; break; } var ud = new NSUserDefaults(AppGroupPathProvider.SuiteName, NSUserDefaultsType.SuiteName); ud.SetValueForKey(DateTime.Now.ToNSDate(), new NSString("MRU")); ud.Synchronize(); notify (args.Result.ToString(), string.Format ("{0} {1}", args.Entity, args.ActionOccurred.ToString ()), type); if (args.ConditionallyRefreshData) this.ConditionallyRefreshData (true); if (args.RespondToModelChanges&!args.ConditionallyRefreshData) this.RespondToModelChanges (); }
public Settings(string defaultsName) { _defaults = string.IsNullOrWhiteSpace(defaultsName) ? NSUserDefaults.StandardUserDefaults : new NSUserDefaults(defaultsName, NSUserDefaultsType.SuiteName); }
public AuthenticatorService() { this.userDefaults = NSUserDefaults.StandardUserDefaults; this.currentUser = this.ReadUserFromPreferences(this.userDefaults); }
public override void ViewDidLoad() { base.ViewDidLoad(); userDefs = NSUserDefaults.StandardUserDefaults; }
/// <summary> /// Dispose the local database. /// </summary> public override void Dispose() { _userDefaults = null; }
protected override IPreferenceStore CreatePreferenceStore() { const string preferencesVersionKey = "preferencesVersion"; const string inspectorBundleId = "com.xamarin.Inspector"; var preferenceStore = new NSUserDefaultsPreferenceStore(synchronizeOnSet: true); // Check for, and if necessary, perform a one-time preferences migration from // com.xamarin.Inspector to com.xamarin.Workbooks, allowing the two client // applications to more fully split (they no longer share CFBundleIdentifier) if (ClientInfo.Flavor == ClientFlavor.Inspector || preferenceStore.GetInt64(preferencesVersionKey) >= 2) { return(preferenceStore); } var migratedPrefs = 0; using (var inspectorDefaults = new NSUserDefaults()) { inspectorDefaults.AddSuite(inspectorBundleId); foreach (var item in inspectorDefaults.ToDictionary()) { if (item.Key is NSString nsKey && item.Value != null) { var key = nsKey.ToString(); switch (key) { // preserve some Cocoa/WebKit preferences case "WebKitDeveloperExtras": case "NSNavLastRootDirectory": case "NSNavRecentPlaces": break; default: // preserve all nav panel (open/save) prefs if (key.StartsWith("NSNavPanel", StringComparison.Ordinal)) { break; } // lastly, preserve our own explicit preferences if (key.StartsWith(inspectorBundleId + ".", StringComparison.Ordinal)) { key = preferenceStore.BundleId + key.Substring(inspectorBundleId.Length); break; } // there are tons of "junk" preferences/state stored by various // controls (e.g. frame dimensions) that I'd rather just discard continue; } preferenceStore.UserDefaults.SetValueForKey(item.Value, new NSString(key)); migratedPrefs++; } } preferenceStore.Set(preferencesVersionKey, 2); preferenceStore.UserDefaults.Synchronize(); Log.Info(TAG, $"Migrated {migratedPrefs} preferences from " + $"{inspectorBundleId} to {preferenceStore.BundleId}"); } return(preferenceStore); }
public DocumentAppSettings (NSUserDefaults defaults) { if (defaults == null) throw new ArgumentNullException ("defaults"); defs = defaults; }
public IOSSettingsStorage() : base() { this.userDefaults = new NSUserDefaults(); }
public override void ClearSettings() { NSUserDefaults.ResetStandardUserDefaults(); NSUserDefaults.StandardUserDefaults.Synchronize(); }
public EncryptedUserDefaults(string name, NSUserDefaults defaults) : this(name, defaults, new TinkAead(name)) { }
public UserPreferences() { _plist = NSUserDefaults.StandardUserDefaults; }
public EncryptedUserDefaults(string name, NSUserDefaults defaults, IAead provider) { _name = name; UserDefaults = defaults; _provider = provider; }
public TouchStorage() { _prefs = NSUserDefaults.StandardUserDefaults; }
public static int getMaskType() { NSUserDefaults prefs = NSUserDefaults.StandardUserDefaults; return((int)prefs.IntForKey("maskType")); }
public void DoWorkInBackground() { ThreadPool.QueueUserWorkItem(delegate { using (NSAutoreleasePool autorelease = new NSAutoreleasePool()) { Util.Log("Apirator launched"); bool forceShowDialog = false; #if DEBUG //forceShowDialog = true; #endif bool shouldShowDialog = false; string currentVersion = NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleVersion").ToString(); using (NSUserDefaults defaults = NSUserDefaults.StandardUserDefaults) { string trackingVersion = defaults.StringForKey(CONFIG_CURRENTVERSION); if (trackingVersion == null) { trackingVersion = currentVersion; defaults.SetString(trackingVersion, CONFIG_CURRENTVERSION); } Util.Log("Tracking version: " + trackingVersion); if (trackingVersion == currentVersion) { int launchCount = defaults.IntForKey(CONFIG_LAUNCHCOUNT); launchCount++; defaults.SetInt(launchCount, CONFIG_LAUNCHCOUNT); Util.Log("Launch count is: " + launchCount); bool declinedToRate = defaults.BoolForKey(CONFIG_DECLINEDTORATE); bool hasRated = defaults.BoolForKey(CONFIG_RATEDCURRENTVERSION); if (launchCount > LAUNCHES_UNTIL_PROMPT && !declinedToRate && !hasRated) { if (IsConnectedToNetwork()) { shouldShowDialog = true; } } defaults.Synchronize(); } else { Util.Log("Setting defatuls"); defaults.SetString(currentVersion, CONFIG_CURRENTVERSION); defaults.SetInt(1, CONFIG_LAUNCHCOUNT); defaults.SetBool(false, CONFIG_RATEDCURRENTVERSION); defaults.SetBool(false, CONFIG_DECLINEDTORATE); defaults.Synchronize(); } } if (shouldShowDialog || forceShowDialog) { Util.Log("Apirator: Showing Dialog"); UIApplication.SharedApplication.InvokeOnMainThread(delegate { alertView = new UIAlertView(string.Format(MESSAGE_TITLE, APP_NAME), string.Format(MESSAGE, APP_NAME), null, CANCEL_BUTTON, string.Format(RATE_BUTTON, APP_NAME), LATER_BUTTON); alertView.Clicked += delegate(object sender, UIButtonEventArgs e) { using (NSUserDefaults defaults = NSUserDefaults.StandardUserDefaults) { switch (e.ButtonIndex) { case 0: defaults.SetBool(true, CONFIG_DECLINEDTORATE); defaults.Synchronize(); Util.Log("declined to rate. Boo"); break; case 1: Util.Log("rating it! yay!"); string reviewUrl = string.Format(TemplateReviewUrl, APP_ID); Util.Log(reviewUrl); UIApplication.SharedApplication.OpenUrl(new NSUrl(reviewUrl)); defaults.SetBool(true, CONFIG_RATEDCURRENTVERSION); defaults.Synchronize(); break; case 2: Util.Log("doing it later"); defaults.SetInt(5, CONFIG_LAUNCHCOUNT); defaults.Synchronize(); int launchCount = defaults.IntForKey(CONFIG_LAUNCHCOUNT); Util.Log("Launch count is: " + launchCount); break; } } }; alertView.Canceled += delegate(object sender, EventArgs e) { }; alertView.Show(); }); } } }); }
public static bool getIsUseKeyAction() { NSUserDefaults prefs = NSUserDefaults.StandardUserDefaults; return(prefs.BoolForKey("isUseKeyAction")); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. NSUserDefaults plist = NSUserDefaults.StandardUserDefaults; string userid = plist.StringForKey("userid"); Console.WriteLine("user id: " + userid); if (userid != null && !userid.Equals("")) { UserIdTextField.Text = userid; LoginButton.SetTitle("Logout", UIControlState.Normal); } LoginButton.TouchUpInside += (object sender, EventArgs e) => { if (userid == null || userid.Equals("")) { // Login string newUserId = UserIdTextField.Text; if (newUserId != null && !newUserId.Equals("")) { plist.SetString(newUserId, "userid"); plist.Synchronize(); userid = newUserId; LoginButton.SetTitle("Logout", UIControlState.Normal); WebEngage.SharedInstance().User.Login(newUserId); } } else { // Logout plist.SetString("", "userid"); plist.Synchronize(); userid = ""; UserIdTextField.Text = ""; LoginButton.SetTitle("Login", UIControlState.Normal); WebEngage.SharedInstance().User.Logout(); } }; TrackButton.TouchUpInside += (object sender, EventArgs e) => { // Track string eventName = EventTextField.Text; if (eventName != null && !eventName.Equals("")) { WebEngage.SharedInstance().Analytics.TrackEventWithName(eventName); } }; SetButton.TouchUpInside += (object sender, EventArgs e) => { // Set screen string screen = ScreenTextField.Text; if (screen != null && !screen.Equals("")) { WebEngage.SharedInstance().Analytics.NavigatingToScreenWithName(screen); } }; TestButton.TouchUpInside += (object sender, EventArgs e) => { // For testing }; }
/// <summary> /// Synchronizes the with data dictionary. /// </summary> /// <param name="dataDict"> /// The data dictionary. /// </param> /// <returns> /// The <see cref="int"/>. /// </returns> public int SyncWithDataDictionary(Dictionary <string, object> dataDict) { var fullSync = false; var dataModelDef = dataDict.ValueOrDefault("dataModel") as JObject; if (dataModelDef != null) { // DDLogCRequest("Import DATAMODEL"); this.Logger.LogDebug("Import DATAMODEL", LogFlag.LogRequests); var dataModelSync = new UPSyncDataModel(this.DataStore); dataModelSync.SyncWithDataModelDefinition(dataModelDef.ToObject <Dictionary <string, object> >()); fullSync = true; } var catalogDef = dataDict.ValueOrDefault("fixedCatalogs") as JArray; UPSyncCatalogs catalogSync = null; if (catalogDef != null) { // DDLogCRequest("Import FIXED CATALOGS"); this.Logger.LogDebug("Import FIXED CATALOGS", LogFlag.LogRequests); catalogSync = new UPSyncCatalogs(this.DataStore); catalogSync.SyncFixedCatalogs(catalogDef.ToObject <List <object> >()); } catalogDef = dataDict.ValueOrDefault("variableCatalogs") as JArray; if (catalogDef != null) { // DDLogCRequest("Import VARIABLE CATALOGS"); this.Logger.LogDebug("Import VARIABLE CATALOGS", LogFlag.LogRequests); if (catalogSync == null) { catalogSync = new UPSyncCatalogs(this.DataStore); } catalogSync.SyncVariableCatalogs(catalogDef.ToObject <List <object> >()); } var configurationDef = dataDict.ValueOrDefault("configuration") as JObject; if (configurationDef != null) { // DDLogCRequest("Import CONFIGURATION"); this.Logger.LogDebug("Import CONFIGURATION", LogFlag.LogRequests); var configurationSync = new UPSyncConfiguration(this.ConfigStore); configurationSync.SyncWithConfigurationDefinition(configurationDef.ToObject <Dictionary <string, object> >()); if (fullSync) { var v = this.ConfigStore.ConfigValue("System.iOSServerTimeZone"); if (!string.IsNullOrEmpty(v)) { this.DataStore.SetTimeZoneUtcDifference(v, 0); } } } bool isEnterprise = false; var licenseDef = dataDict.ValueOrDefault("licenseInfo") as JObject; if (licenseDef != null) { // DDLogCRequest("Import LICENSEINFO"); this.Logger.LogDebug("Import LICENSEINFO", LogFlag.LogRequests); Dictionary <string, object> licenseDefDictionary = licenseDef.ToObject <Dictionary <string, object> >(); isEnterprise = bool.Parse(licenseDefDictionary.ValueOrDefault("IsEnterpriseVersion").ToString()); #if PORTING NSUserDefaults.StandardUserDefaults().SetBoolForKey(isEnterprise.BoolValue, "System.isEnterprise"); NSUserDefaults.StandardUserDefaults().Synchronize(); #endif } var recordDef = dataDict.ValueOrDefault("records") as JArray; if (recordDef != null) { // DDLogCRequest("Import RECORDS"); this.Logger.LogDebug("Import RECORDS", LogFlag.LogRequests); var recordSyncResult = UPCRMRecordSync.SyncRecordSetDefinitionsCrmDataStore(recordDef.ToObject <List <object> >(), this.DataStore, isEnterprise); if (recordSyncResult.Successful) { this.RecordCount += recordSyncResult.RecordCount; } else { return(recordSyncResult.ReturnCode); } } var queryDef = dataDict.ValueOrDefault("queries"); if (queryDef != null) { var querySync = new UPSyncQuery(this.DataStore); querySync.SyncWithQueryDefinition((List <object>)queryDef); } return(0); }
public UserSettings() { _defaults = NSUserDefaults.StandardUserDefaults; }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { int section = indexPath.Section; int row = indexPath.Row; switch (section) { case 1: { foreach (UITableViewCell c in tableView.VisibleCells) { c.Accessory = UITableViewCellAccessory.None; } tableView.DeselectRow(indexPath, true); SettingsProfileTableViewCell cell = (SettingsProfileTableViewCell)tableView.CellAt(indexPath); cell.Accessory = UITableViewCellAccessory.Checkmark; NSUserDefaults defaults = NSUserDefaults.StandardUserDefaults; defaults.SetInt(row, "selectedProfile"); defaults.Synchronize(); break; } case 4: { foreach (UITableViewCell c in tableView.VisibleCells) { c.Accessory = UITableViewCellAccessory.None; } tableView.DeselectRow(indexPath, true); SettingsProfileTableViewCell cell = (SettingsProfileTableViewCell)tableView.CellAt(indexPath); cell.Accessory = UITableViewCellAccessory.Checkmark; NSUserDefaults defaults = NSUserDefaults.StandardUserDefaults; defaults.SetInt(row, "selectedSaveFormat"); defaults.Synchronize(); break; } case 6: { AboutViewController vc = new AboutViewController(); vc.ModalPresentationStyle = UIModalPresentationStyle.FullScreen; viewController.PresentViewController(vc, true, null); break; } default: { tableView.DeselectRow(indexPath, false); break; } } }
public Storage() { userDefaults = NSUserDefaults.StandardUserDefaults; }
public Storage() { _preferences = NSUserDefaults.StandardUserDefaults; }
public UISettings() { defaults = NSUserDefaults.StandardUserDefaults; }
public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) { if (systemVersion > minVersionWidget) { if (url.AbsoluteString.Contains (WidgetUpdateService.TodayUrlPrefix)) { var widgetManager = ServiceContainer.Resolve<WidgetSyncManager>(); if (url.AbsoluteString.Contains (WidgetUpdateService.StartEntryUrlPrefix)) { widgetManager.StartStopTimeEntry(); } else { var nsUserDefaults = new NSUserDefaults ("group.com.toggl.timer", NSUserDefaultsType.SuiteName); var guid = nsUserDefaults.StringForKey (WidgetUpdateService.StartedEntryKey); widgetManager.ContinueTimeEntry (Guid.Parse (guid)); } return true; } } return SignIn.SharedInstance.HandleUrl (url, sourceApplication, annotation); }
/// <summary> /// Constructor retrieves user defaults to display if this view appears in the Settings screen. /// </summary> /// <param name="handle"></param> public UITableViewControllerServerConnect(IntPtr handle) : base(handle) { userDefaults = NSUserDefaults.StandardUserDefaults; defaultServerName = userDefaults.StringForKey(strings.defaultsServerNameHestia); defaultIP = userDefaults.StringForKey(strings.defaultsIpHestia); }
void SetElementValueFromDefaults(CheckboxElement e, NSUserDefaults defs, string key, bool defaultVal) { var value = defs.DataForKey (key); if (value == null) e.Value = defaultVal; else e.Value = defs.BoolForKey(key); }
/// <summary> /// Initializes a new instance of the <see cref="T:Crex.tvOS.ApplePreferences"/> class. /// </summary> public ApplePreferences() { Preferences = NSUserDefaults.StandardUserDefaults; }
public override void ViewDidLoad() { base.ViewDidLoad (); userDefs = NSUserDefaults.StandardUserDefaults; }
// Constructor public MacPreferencesProvider() : base() { defaults = new NSUserDefaults(); }