public IResourceUrl CreateThemedResourceUrl(ResourceType resourceType, string relativeUrl)
        {
            ArgumentUtility.CheckNotNull("resourceType", resourceType);
            ArgumentUtility.CheckNotNullOrEmpty("relativeUrl", relativeUrl);

            return(_resourceUrlFactory.CreateResourceUrl(typeof(QuirksModeInfrastructureResourceUrlFactory), resourceType, relativeUrl));
        }
        public void CreateResourceUrl()
        {
            var resourceUrl = _factory.CreateResourceUrl(typeof(ResourceUrlFactoryTest), ResourceType.Image, "theRelativeUrl.img");

            Assert.That(resourceUrl, Is.InstanceOf(typeof(ResourceUrl)));
            Assert.That(((ResourceUrl)resourceUrl).ResourcePathBuilder, Is.SameAs(_resourcePathBuilder));
            Assert.That(((ResourceUrl)resourceUrl).DefiningType, Is.EqualTo(typeof(ResourceUrlFactoryTest)));
            Assert.That(((ResourceUrl)resourceUrl).ResourceType, Is.EqualTo(ResourceType.Image));
            Assert.That(((ResourceUrl)resourceUrl).RelativeUrl, Is.EqualTo("theRelativeUrl.img"));
        }
Пример #3
0
        public static IconInfo CreateSpacer(IResourceUrlFactory resourceUrlFactory)
        {
            ArgumentUtility.CheckNotNull("resourceUrlFactory", resourceUrlFactory);

            var infrastructureType = SafeServiceLocator.Current.GetInstance <IInfrastructureResourceUrlFactory>().GetType();

            string url = resourceUrlFactory.CreateResourceUrl(infrastructureType, ResourceType.Image, "Spacer.gif").GetUrl();

            return(new IconInfo(url)
            {
                AlternateText = ""
            });
        }
Пример #4
0
        public void RegisterHtmlHeadContents(HtmlHeadAppender htmlHeadAppender, IControl control)
        {
            ArgumentUtility.CheckNotNull("htmlHeadAppender", htmlHeadAppender);
            ArgumentUtility.CheckNotNull("control", control);

            // Do not call base implementation
            //base.RegisterHtmlHeadContents

            string key = typeof(WebTabStripQuirksModeRenderer).FullName + "_Style";

            if (!htmlHeadAppender.IsRegistered(key))
            {
                var styleSheetUrl = _resourceUrlFactory.CreateResourceUrl(typeof(WebTabStripQuirksModeRenderer), ResourceType.Html, "TabStrip.css");
                htmlHeadAppender.RegisterStylesheetLink(key, styleSheetUrl, HtmlHeadAppender.Priority.Library);
            }

            ScriptUtility.Instance.RegisterJavaScriptInclude(control, htmlHeadAppender);
        }
Пример #5
0
 private string GetResourceUrl(string icon)
 {
     return(_resourceUrlFactory.CreateResourceUrl(typeof(BocBooleanValueQuirksModeResourceSetFactory), ResourceType.Image, icon).GetUrl());
 }
Пример #6
0
 private string GetResolvedImageUrl(string imageUrl)
 {
     return(_resourceUrlFactory.CreateResourceUrl(typeof(BocListNavigationBlockQuirksModeRenderer), ResourceType.Image, imageUrl).GetUrl());
 }