コード例 #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);
        }
コード例 #2
0
ファイル: CommonUtils.cs プロジェクト: Changmok/tac-sharp
        private static HapticFeedbackFile Parse(string json)
        {
#if NETFX_CORE
            return(HapticFeedbackFile.ToHapticFeedbackFile(json));
#else
            var obj = fastJSON.JSON.ToObject <HapticFeedbackFile>(json);

            return(obj);
#endif
        }
コード例 #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);
        }
コード例 #4
0
 private static HapticFeedbackFile Parse(string json)
 {
     return(HapticFeedbackFile.ToHapticFeedbackFile(json));
 }