public void RawClone() { JRaw r1 = new JRaw("raw1"); JToken r2 = r1.CloneToken(); CustomAssert.IsInstanceOfType(typeof(JRaw), r2); }
public void RawToObject() { JRaw r1 = new JRaw("1"); int i = r1.ToObject<int>(); Assert.AreEqual(1, i); }
private void setAutoComplite() { JObject joContextKey = new JObject(); joContextKey["SearchCode"] = "1"; this.AutoComplit(ref joContextKey, "~/Tools/LandUse.asmx/GetCompletionList", this.txtFirst); joContextKey.Remove("SearchCode"); joContextKey["SearchParams"] = new JRaw("function () {return UpdateContext();}"); this.AutoComplit(ref joContextKey, "~/Tools/LandUse.asmx/GetCompletionList2", this.txtSecond); }
public void RawEquals() { JRaw r1 = new JRaw("raw1"); JRaw r2 = new JRaw("raw1"); JRaw r3 = new JRaw("raw2"); Assert.IsTrue(JToken.DeepEquals(r1, r2)); Assert.IsFalse(JToken.DeepEquals(r1, r3)); }
// Token: 0x060005D8 RID: 1496 // RVA: 0x00035994 File Offset: 0x00033B94 public static JRaw Create(JsonReader reader) { JRaw result; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) { jsonTextWriter.WriteToken(reader); result = new JRaw(stringWriter.ToString()); } } return result; }
public override void ExecuteResult(ControllerContext context) { JObject result = new JObject(); JObject response = new JObject(); result["actionSuccess"] = this.Accept; if (this.RefusalMessage.IsNotEmpty()) { result["message"] = this.RefusalMessage; } if (this.Attributes != null) { response["attributes"] = new JRaw(JSON.Serialize(this.Attributes)); } if (this.Value != null) { if (this.Value is string) { response["value"] = this.Value.ToString(); } else { response["value"] = new JRaw(JSON.Serialize(this.Value)); } } if (this.NodeID != null) { response["id"] = this.NodeID; } if (response.Count > 0) { result["response"] = response; } CompressionUtils.GZipAndSend(result.ToString(Newtonsoft.Json.Formatting.None)); }
/// <summary> /// Initializes a new instance of the <see cref="JRaw"/> class from another <see cref="JRaw"/> object. /// </summary> /// <param name="other">A <see cref="JRaw"/> object to copy from.</param> public JRaw(JRaw other) : base(other) { }
/// <summary> /// Returns the definition of the column (or columns) corresponding /// to the drop down list. /// </summary> private IEnumerable<JObject> GetDropDownListColumnDefinitions( ModelMetadata propMetadata, DropDownList dropDownList) { JObject groupColumnInfo = null; JObject objectColumnInfo = new JObject(); objectColumnInfo["name"] = propMetadata.PropertyName; objectColumnInfo["display"] = propMetadata.DisplayName; objectColumnInfo["type"] = "select"; if (propMetadata.IsRequired) { objectColumnInfo["ctrlClass"] = "required"; } if (dropDownList.GroupFilter == null) { objectColumnInfo["ctrlOptions"] = "0:Select;" + string.Join ( ";", dropDownList.Choices .Select(dropDownList.ItemAccessor) .OrderBy(i => i.Name, new NaturalComparer()) .Select(item => $"{item.Value}:{item.Name}") ); yield return objectColumnInfo; yield break; } else { objectColumnInfo["ctrlAttr"] = new JObject() { ["disabled"] = "disabled" }; groupColumnInfo = new JObject(); groupColumnInfo["name"] = dropDownList.GroupColumnName; groupColumnInfo["display"] = dropDownList.GroupColumnDisplayName; groupColumnInfo["type"] = "select"; groupColumnInfo["ctrlOptions"] = "0:Select;" + string.Join ( ";", dropDownList.Choices .Select(dropDownList.GroupFilter) .Distinct() .OrderBy(i => i.Name, new NaturalComparer()) .Select(item => $"{item.Value}:{item.Name}") ); groupColumnInfo["onChange"] = new JRaw ( $"handle{dropDownList.GroupColumnName}Changed" ); yield return groupColumnInfo; yield return objectColumnInfo; } }
public JRawValue(JRaw value) { _value = value.ToString(); }
public JRaw EchoJRaw(JRaw input) { return input; }
public JRaw(JRaw other) : base((JValue) other) { }
/// <summary> /// Initializes a new instance of the <see cref="T:Newtonsoft.Json.Linq.JRaw" /> class from another <see cref="T:Newtonsoft.Json.Linq.JRaw" /> object. /// </summary> /// <param name="other">A <see cref="T:Newtonsoft.Json.Linq.JRaw" /> object to copy from.</param> public JRaw(JRaw other) : base((JValue)other) { }
public JRaw(JRaw other) : base(other) { }
public JRaw(JRaw other) { Class6.yDnXvgqzyB5jw(); base(other); }