public static LayoutSettings LayoutFromJson(dynamic json) { var layout = new LayoutSettings(); if (Script.Write <bool>("untyped __typeof__(json) == \"string\"")) { layout.Mode = json; } else { if (json.mode) { layout.Mode = json.mode; } if (json.additionalSettings) { string[] keys = Platform.Platform.JsonKeys(json.additionalSettings); foreach (var key in keys) { layout.AdditionalSettings[key.ToLower()] = json.additionalSettings[key]; } } } return(layout); }
public static LayoutSettings LayoutFromJson(dynamic json) { var layout = new LayoutSettings(); if (JsContext.@typeof(json) == "string") { layout.Mode = json; } else { if (json.mode) { layout.Mode = json.mode; } if (json.additionalSettings) { string[] keys = Std.JsonKeys(json.additionalSettings); foreach (var key in keys) { layout.AdditionalSettings[key.ToLower()] = json.additionalSettings[key]; } } } return(layout); }