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); }
private static HapticFeedbackFile Parse(string json) { #if NETFX_CORE return(HapticFeedbackFile.ToHapticFeedbackFile(json)); #else var obj = fastJSON.JSON.ToObject <HapticFeedbackFile>(json); return(obj); #endif }
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)); }