Esempio n. 1
0
            public ChildConvertibleObject FromMValue(IMValueReader reader)
            {
                if (reader.Peek() == MValueReaderToken.Nil)
                {
                    return(null);
                }
                reader.BeginObject();
                string test = null;

                while (reader.HasNext())
                {
                    switch (reader.NextName())
                    {
                    case "test":
                        test = reader.NextString();
                        break;

                    default:
                        reader.SkipValue();
                        break;
                    }
                }

                reader.EndObject();
                return(test == null ? null : new ChildConvertibleObject(test));
            }
Esempio n. 2
0
            public ConvertibleObject FromMValue(IMValueReader reader)
            {
                reader.BeginObject();
                string test = null;
                List <ConvertibleObject> list = null;

                while (reader.HasNext())
                {
                    switch (reader.NextName())
                    {
                    case "test":
                        test = reader.NextString();
                        break;

                    case "list":
                        list = listAdapter.FromMValue(reader);
                        break;

                    default:
                        reader.SkipValue();
                        break;
                    }
                }

                reader.EndObject();
                return(test == null ? null : new ConvertibleObject(test, list));
            }
            public List <T> FromMValue(IMValueReader reader)
            {
                var list = new List <T>();

                reader.BeginArray();
                while (reader.HasNext())
                {
                    list.Add(elementAdapter.FromMValue(reader));
                }

                reader.EndArray();
                return(list);
            }
            public IDictionary <string, T> FromMValue(IMValueReader reader)
            {
                var dictionary = new Dictionary <string, T>();

                reader.BeginObject();
                while (reader.HasNext())
                {
                    var key = reader.NextName();
                    dictionary[key] = elementAdapter.FromMValue(reader);
                }

                reader.EndObject();
                return(dictionary);
            }
Esempio n. 5
0
 object IMValueBaseAdapter.FromMValue(IMValueReader reader)
 {
     return(FromMValue(reader));
 }