Beispiel #1
0
        public Dictionary <string, string> LoadTranslationsFile()
        {
            Dictionary <string, string> returnValue = new Dictionary <string, string>();


            if (File.Exists(FileName))
            {
                string jsonFormat = CreateJsonFormatFromFile(FileName);
                returnValue = JSONSerializer.Deserialize <Dictionary <string, string> >(jsonFormat);
                //string[] lines = File.ReadAllLines(path);
                //foreach (string line in lines)
                //{
                //    string[] values = line.Split(new char[] { ':' });
                //    string original = values[0];
                //    string translation = values[1];
                //    returnValue.Add(original, translation);
                //}
            }

            return(returnValue);
        }
Beispiel #2
0
        public static string ToJsonString(this object DataObject)
        {
            string test = JSONSerializer.Serialize(DataObject);

            return(JSONSerializer.Serialize(DataObject));
        }
Beispiel #3
0
        public void SetDataObject(Object obj)
        {
            string JsonObj = JSONSerializer.Serialize(obj);

            this.Data = UTF8.Encode(JsonObj);
        }