Click or drag to resize

JavaScript Structure

Represents a piece of JavaScript code that will be inserted into an HTML string.

Namespace:  MicaSystems.Utils
Assembly:  MicaSystems.Utils (in MicaSystems.Utils.dll) Version: 1.0.0.0 (1.1.0.123)
Syntax
C#
public struct JavaScript

The JavaScript type exposes the following members.

Constructors
  NameDescription
Public methodJavaScript
Initializes a new JavaScript from the given FormattableString. Variable parts of the template (between '{' and '}') will be serialized to JSON. Specify whether original letter case should be kept. e.g. if set to true PascaleCase property names will NOT be converted to camelCase.
Top
Properties
  NameDescription
Public propertyIsEmpty
Returns true if this instance contains no characters.
Top
Methods
  NameDescription
Public methodStatic memberCreate
Creates a new JavaScript from the given FormattableString. Variable parts of the template (between '{' and '}') will be serialized to JSON. Specify whether original letter case should be kept. e.g. if set to true PascaleCase property names will NOT be converted to camelCase.
Public methodStatic memberFromValue
Returns the JSON representation of the given value. Specify whether original letter case should be kept. e.g. if set to true PascaleCase property names will NOT be converted to camelCase.
Public methodGetHtmlForAttribute
Returns an HTML string that is html encoded. Use this method when inserting dynamic JavaScript code into a html attribute.
Public methodGetHtmlForScriptTag
Returns an HTML string that is NOT html encoded. Use this method when inserting dynamic JavaScript code into a html script tag.
Public methodToString Obsolete. (Overrides ValueTypeToString.)
Top
Fields
  NameDescription
Public fieldStatic memberEmpty
Returns a JavaScript instance with no characters.
Top
Extension Methods
  NameDescription
Public Extension MethodAsT
Casts an object to another type. Returns default(T) if the object is null.
(Defined by Utils_Other.)
Public Extension MethodEqualsAll
Checks that this object is equal to every object in parameters.
(Defined by Utils_Other.)
Public Extension MethodEqualsAny
Checks that this object is equal to at least one of the parameters.
(Defined by Utils_Other.)
Public Extension MethodGetString
Converts an object to String using ToString() method, else returns String.Empty.
(Defined by Utils_Other.)
Public Extension MethodIsGenericListOverloaded.
Checks if this object is a System.Collections.Generic.List.
(Defined by Utils_Linq.)
Public Extension MethodIsGenericList(Type)Overloaded.
Checks if this object is a System.Collections.Generic.List using type as T.
(Defined by Utils_Linq.)
Public Extension MethodSerializeOverloaded.
Serializes an object into an XML document.
(Defined by Utils_Xml.)
Public Extension MethodSerialize(String)Overloaded.
Serializes an object into an XML document.
(Defined by Utils_Xml.)
Public Extension MethodSerializeJsonOverloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.)
Public Extension MethodSerializeJson(ListType)Overloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.)
Public Extension MethodSerializeJson(DataContractJsonSerializerSettings)Overloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.)
Top
See Also