예제 #1
0
 public static object parse(string jsonInput)
 {
     try
     {
         return(LPFJsonMapper.ToObjectSimple(jsonInput));
     }
     catch (JsonException inner_exception)
     {
         throw new JsonParseException("Internal JSON parse error:", inner_exception);
     }
 }
예제 #2
0
        protected IDictionary <string, object> LoadFromFile(string filePath, ConfigurationFileInfo configFileInfo)
        {
            IDictionary <string, object> result = null;
            string text = null;

            if (configFileInfo.IsResourceFile)
            {
                TextAsset textAsset = Resources.Load(filePath, typeof(TextAsset)) as TextAsset;
                if (textAsset != null)
                {
                    text = textAsset.text;
                }
            }
            if (text == null)
            {
                text = File.ReadAllText(filePath);
            }
            string text2 = null;

            if (configFileInfo.IsEncrypted)
            {
                try
                {
                    text2 = AesCipher.Decrypt(text, configFileInfo.EncryptionKey);
                }
                catch (Exception)
                {
                }
            }
            if (text2 == null)
            {
                text2 = text;
            }
            if (text2 != null)
            {
                result = LPFJsonMapper.ToObjectSimple(text2) as IDictionary <string, object>;
            }
            return(result);
        }
예제 #3
0
        public static void LoadSettings()
        {
            string buildSettingsJson = EnvironmentManager.GetBuildSettingsJson();

            m_keyValueStore = (string.IsNullOrEmpty(buildSettingsJson) ? new Dictionary <string, object>() : (LPFJsonMapper.ToObjectSimple(buildSettingsJson) as IDictionary <string, object>));
        }