/// <summary> /// Convert compilation level enum value to code /// </summary> /// <param name="compilationLevel">Compilation level enum value</param> /// <returns>Compilation level code</returns> internal static string ConvertCompilationLevelEnumValueToCode(CompilationLevel compilationLevel) { string code; switch (compilationLevel) { case CompilationLevel.WhitespaceOnly: code = "WHITESPACE_ONLY"; break; case CompilationLevel.Simple: code = "SIMPLE"; break; case CompilationLevel.Advanced: code = "ADVANCED"; break; default: throw new InvalidCastException(string.Format(CoreStrings.Common_EnumValueToCodeConversionFailed, compilationLevel.ToString(), typeof(CompilationLevel))); } return(code); }
public ClosureCodeRequest(string apiUrl, CompilationLevel level, string jsContent) { apiUrl = string.IsNullOrEmpty(apiUrl) ? DefaultApiUrl : apiUrl; request = new Request(apiUrl, new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("compilation_level", level.ToString()), new KeyValuePair<string, string>("js_code", jsContent), new KeyValuePair<string, string>("output_format", "xml"), new KeyValuePair<string, string>("output_info", "compiled_code"), }); }
public ClosureCodeRequest(string apiUrl, CompilationLevel level, string jsContent) { apiUrl = string.IsNullOrEmpty(apiUrl) ? DefaultApiUrl : apiUrl; request = new Request(apiUrl, new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("compilation_level", level.ToString()), new KeyValuePair <string, string>("js_code", jsContent), new KeyValuePair <string, string>("output_format", "xml"), new KeyValuePair <string, string>("output_info", "compiled_code"), }); }
/// <summary> /// Converts a compilation level enum value to code /// </summary> /// <param name="compilationLevel">Compilation level enum value</param> /// <returns>Compilation level code</returns> internal static string ConvertCompilationLevelEnumValueToCode(CompilationLevel compilationLevel) { string code; switch (compilationLevel) { case CompilationLevel.WhitespaceOnly: code = "WHITESPACE_ONLY"; break; case CompilationLevel.Simple: code = "SIMPLE_OPTIMIZATIONS"; break; case CompilationLevel.Advanced: code = "ADVANCED_OPTIMIZATIONS"; break; default: throw new InvalidCastException(string.Format(CoreStrings.Common_EnumValueToCodeConversionFailed, compilationLevel.ToString(), typeof(CompilationLevel))); } return code; }