/// <summary> /// Ctor /// </summary> /// <param name="jsonName"></param> public JsonNameAttribute(string jsonName) { #if !NO_ECMASCRIPT this.jsonName = EcmaScriptIdentifier.EnsureValidIdentifier(jsonName, false); #else this.jsonName = jsonName; #endif }
/// <summary> /// Ensures is a valid EcmaScript variable expression. /// </summary> /// <param name="varExpr">the variable expression</param> /// <returns>varExpr</returns> public static string EnsureValidIdentifier(string varExpr, bool nested) { return(EcmaScriptIdentifier.EnsureValidIdentifier(varExpr, nested, true)); }
/// <summary> /// Ctor /// </summary> public EcmaScriptIdentifier(string ident) { this.identifier = String.IsNullOrEmpty(ident) ? String.Empty : EcmaScriptIdentifier.EnsureValidIdentifier(ident, true); }
/// <summary> /// Ctor /// </summary> /// <param name="jsonName"></param> public JsonNameAttribute(string jsonName) { this.jsonName = EcmaScriptIdentifier.EnsureValidIdentifier(jsonName, false); }
public EcmaScriptIdentifier(string ident) { this.identifier = ((!string.IsNullOrEmpty(ident)) ? EcmaScriptIdentifier.EnsureValidIdentifier(ident, true) : string.Empty); }