Example #1
0
        public void AddPreference(string name, string value)
        {
            if (Preferences == null)
            {
                Preferences = new List <UserPreference>();
            }

            var preference = UserPreference.Factory.Create(name, value, this.Id, this.Id);

            Preferences.Add(preference);
        }
        bool IUserPreferencesHandler.SetPreference(int locationId, string key, PreferenceTypes pref)
        {
            foreach (PreferenceTypes prefType in Enum.GetValues(typeof(PreferenceTypes)))
            {
                if (prefType == pref)
                {
                    continue;
                }
                _preferences.RemoveIfContains(locationId, key, prefType);
            }

            bool result;

            if (result = _preferences.Add(locationId, key, pref))
            {
                IncrLocalChanges();
            }
            return(result);
        }
 public Builder AddPreference(IModel model)
 {
     Preferences.Add(model);
     return(this);
 }