Ejemplo n.º 1
0
        void ResetProcessorForForeground()
        {
            string didBackground = persister.GetValue(Constants.BACKGROUNDED_WHILE_STREAMING);

            if (didBackground.Equals("true"))
            {
                persister.Save(Constants.BACKGROUNDED_WHILE_STREAMING, "false");
                ClearUpdateProcessor();
                Config.IsStreamingEnabled = true;
            }
        }
        IDictionary <string, FeatureFlag> IUserFlagCache.RetrieveFlags(User user)
        {
            try
            {
                var flagsAsJson = persister.GetValue(Constants.FLAGS_KEY_PREFIX + user.Key);
                if (flagsAsJson != null)
                {
                    return(JsonConvert.DeserializeObject <IDictionary <string, FeatureFlag> >(flagsAsJson));
                }
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("Couldn't get preferences on mobile device: '{0}'", ex, ex.Message);
            }

            return(new Dictionary <string, FeatureFlag>());
        }