public void Example() { #region Usage JavaScriptSettings settings = new JavaScriptSettings { OnLoadFunction = new JRaw("OnLoad"), OnUnloadFunction = new JRaw("function(e) { alert(e); }") }; string json = JsonConvert.SerializeObject(settings, Formatting.Indented); Console.WriteLine(json); // { // "OnLoadFunction": OnLoad, // "OnUnloadFunction": function(e) { alert(e); } // } #endregion StringAssert.AreEqual( @"{ ""OnLoadFunction"": OnLoad, ""OnUnloadFunction"": function(e) { alert(e); } }", json ); }
public void Example() { #region Usage JavaScriptSettings settings = new JavaScriptSettings { OnLoadFunction = new JRaw("OnLoad"), OnUnloadFunction = new JRaw("function(e) { alert(e); }") }; string json = JsonConvert.SerializeObject(settings, Formatting.Indented); Console.WriteLine(json); // { // "OnLoadFunction": OnLoad, // "OnUnloadFunction": function(e) { alert(e); } // } #endregion }