Exemple #1
0
        public static void FromJsonObjectToDictionary(IVOSJsonObject jobj, IDictionary <string, int> dct)
        {
            string key = string.Empty;

            for (int i = 0; i < jobj.count; ++i)
            {
                key = jobj.GetKey(i);

                dct.Add(key, jobj.GetIntField(key));
            }
        }
Exemple #2
0
        public static void FromJsonObjectToJobjDictionary <TValue>(IVOSJsonObject jobj, IDictionary <string, TValue> dct)
            where TValue : IVOSJsonSirializable, new()
        {
            TValue val = new TValue();
            string key = string.Empty;

            for (int i = 0; i < jobj.count; ++i)
            {
                key = jobj.GetKey(i);

                val = new TValue();
                val.DeserializeFromJson(
                    jobj.GetObjectField(key));

                dct.Add(key, val);
            }
        }
Exemple #3
0
        public static void FromJsonObjectToEnumDictionary <TEnum, TValue>(IVOSJsonObject jobj, IDictionary <TEnum, TValue> dct)
            where TValue : IVOSJsonSirializable, new()
        {
            TValue val = new TValue();
            string key = string.Empty;

            for (int i = 0; i < jobj.count; ++i)
            {
                key = jobj.GetKey(i);

                val = new TValue();
                val.DeserializeFromJson(
                    jobj.GetObjectField(key));

                dct.Add(
                    (TEnum)System.Enum.Parse(typeof(TEnum), key),
                    val);
            }
        }