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)); } }
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); } }
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); } }