private static MvcHtmlString RegisterResource(ClientResourceRegister register, KeyValuePair <string, string>[] attributes, bool throwException) { string output; MvcHtmlString result; if (throwException) { result = new MvcHtmlString(register.RegisterResource(attributes)); } else if (register.TryRegisterResource(out output, attributes)) { result = new MvcHtmlString(output); } else { result = MvcHtmlString.Empty; } return(result); }