예제 #1
0
 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));
 }
예제 #3
0
 private static string GetTag(FileRegistrationContext fileRegistrationContext, string filePath)
 {
     fileRegistrationContext.SetAttribute(fileRegistrationContext.FilePathAttributeName, filePath);
     return fileRegistrationContext.GetTag();
 }
예제 #4
0
        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;
        }
예제 #5
0
        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;
        }