Пример #1
0
        internal static PathModeObjectCollection ToObject(JSONObject jsonObject)
        {
            var collection = new PathModeObjectCollection();

            collection.PlaybackType  = EnumParser.ToPlaybackType(jsonObject.GetValueOrDefault("playbackType", "NONE"));
            collection.MovingPattern = EnumParser.ToMovingPattern(jsonObject["movingPattern"]);

            List <PathModeObject> list = new List <PathModeObject>();

            foreach (var jsonValue in jsonObject.GetValueOrDefault("pointList", new JSONArray()))
            {
                list.Add(PathModeObject.ToObject(jsonValue.Value.AsObject));
            }

            collection.PointList = list.ToArray();

            return(collection);
        }
Пример #2
0
        internal static PathModeObjectCollection ToObject(JsonObject jsonObject)
        {
            var collection = new PathModeObjectCollection();

            collection.PlaybackType  = EnumParser.ToPlaybackType(jsonObject.GetNamedString("playbackType", "NONE"));
            collection.MovingPattern = EnumParser.ToMovingPattern(jsonObject.GetNamedString("movingPattern"));

            List <PathModeObject> list = new List <PathModeObject>();

            foreach (var jsonValue in jsonObject.GetNamedArray("pointList", new JsonArray()))
            {
                list.Add(PathModeObject.ToObject(jsonValue.GetObject()));
            }

            collection.PointList = list.ToArray();

            return(collection);
        }