Ejemplo n.º 1
0
        internal static DotMode ToDotMode(JSONObject jsonObj)
        {
            var dotMode = new DotMode();

            dotMode.DotConnected = jsonObj["dotConnected"];
            var feedbackList = new List <DotModeObjectCollection>();
            var arr          = jsonObj["feedback"];

            foreach (var val in arr)
            {
                feedbackList.Add(DotModeObjectCollection.ToObject(val.Value.AsObject));
            }

            dotMode.Feedback = feedbackList.ToArray();
            return(dotMode);
        }
Ejemplo n.º 2
0
        internal static DotMode ToDotMode(JsonObject jsonObj)
        {
            var dotMode = new DotMode();

            dotMode.DotConnected = jsonObj.GetNamedBoolean("dotConnected");
            var feedbackList = new List <DotModeObjectCollection>();
            var arr          = jsonObj.GetNamedArray("feedback", new JsonArray());

            foreach (var val in arr)
            {
                feedbackList.Add(DotModeObjectCollection.ToObject(val.GetObject()));
            }

            dotMode.Feedback = feedbackList.ToArray();
            return(dotMode);
        }
Ejemplo n.º 3
0
        internal static DotModeObjectCollection ToObject(JSONObject val)
        {
            var obj = new DotModeObjectCollection();

            obj.StartTime = ParseUtil.GetInt(val, "startTime");
            obj.EndTime   = ParseUtil.GetInt(val, "endTime");

            obj.PlaybackType = EnumParser.ToPlaybackType(val.GetValueOrDefault("playbackType", "NONE"));
            var list = new List <DotModeObject>();

            foreach (var jsonValue in val["pointList"])
            {
                list.Add(DotModeObject.ToObject(jsonValue.Value.AsObject));
            }

            obj.PointList = list.ToArray();

            return(obj);
        }
Ejemplo n.º 4
0
        internal static DotModeObjectCollection ToObject(JsonObject val)
        {
            var obj = new DotModeObjectCollection();

            obj.StartTime = (int)val.GetNamedNumber("startTime");
            obj.EndTime   = (int)val.GetNamedNumber("endTime");

            obj.PlaybackType = EnumParser.ToPlaybackType(val.GetNamedString("playbackType", "NONE"));
            var list = new List <DotModeObject>();

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

            obj.PointList = list.ToArray();

            return(obj);
        }