private bool Equals(FileRegistrationContext other) { if (ReferenceEquals(null, other)) { return false; } if (ReferenceEquals(this, other)) { return true; } return Equals(other.ContainerVirtualPath, ContainerVirtualPath) && Equals(other.FileName, FileName) && Equals(other.Condition, Condition); }
private bool Equals(FileRegistrationContext other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.ContainerVirtualPath, ContainerVirtualPath) && Equals(other.FileName, FileName) && Equals(other.Condition, Condition)); }
private static string GetTag(FileRegistrationContext fileRegistrationContext, string filePath) { fileRegistrationContext.SetAttribute(fileRegistrationContext.FilePathAttributeName, filePath); return fileRegistrationContext.GetTag(); }
public FileRegistrationContext RegisterStyle(string fileName, HtmlHelper html) { if (string.IsNullOrEmpty(fileName)) throw new ArgumentException(T("Style fileName was not given.").ToString()); var context = new FileRegistrationContext(html.ViewContext, html.ViewDataContainer, "link", fileName); context.SetAttribute("type", "text/css"); context.SetAttribute("rel", "stylesheet"); if (!_styles.Contains(context)) _styles.Add(context); return context; }
public FileRegistrationContext RegisterHeadScript(string fileName, HtmlHelper html) { if (string.IsNullOrEmpty(fileName)) throw new ArgumentException(T("Head script fileName was not given.").ToString()); var context = new FileRegistrationContext(html.ViewContext, html.ViewDataContainer, "script", fileName); context.SetAttribute("type", "text/javascript"); if (!_headScripts.Contains(context)) _headScripts.Add(context); return context; }