Exemplo n.º 1
0
        public static HapticFeedbackFile ToHapticFeedbackFile(string jsonStr)
        {
            HapticFeedbackFile feedbackFile = new HapticFeedbackFile();

            JSONObject jsonObject = JSON.Parse(jsonStr).AsObject;
            var        projectObj = jsonObject["project"];

            feedbackFile.Project = Project.ToProject(projectObj.AsObject);
            return(feedbackFile);
        }
Exemplo n.º 2
0
        private static HapticFeedbackFile Parse(string json)
        {
#if NETFX_CORE
            return(HapticFeedbackFile.ToHapticFeedbackFile(json));
#else
            var obj = fastJSON.JSON.ToObject <HapticFeedbackFile>(json);

            return(obj);
#endif
        }
Exemplo n.º 3
0
        public static HapticFeedbackFile ToHapticFeedbackFile(string jsonStr)
        {
            HapticFeedbackFile feedbackFile = new HapticFeedbackFile();

            JsonObject jsonObject = JsonObject.Parse(jsonStr);
            var        projectObj = jsonObject.GetNamedObject("project");

            feedbackFile.Project        = Project.ToProject(projectObj);
            feedbackFile.DurationMillis = (int)jsonObject.GetNamedNumber("durationMillis");
            feedbackFile.IntervalMillis = (int)jsonObject.GetNamedNumber("intervalMillis");
            feedbackFile.Size           = (int)jsonObject.GetNamedNumber("size");
            return(feedbackFile);
        }
 private static HapticFeedbackFile Parse(string json)
 {
     return(HapticFeedbackFile.ToHapticFeedbackFile(json));
 }