Example #1
0
        public Skin(string name, string virtualPath, string displayName)
        {
            Require.NotNullOrEmpty(name, "name");
            Require.NotNullOrEmpty(virtualPath, "virtualPath");

            Name = name;
            VirtualPath = UrlUtil.ToAbsoluteHtmlPath(virtualPath);
            DisplayName = new LocalizableText(String.IsNullOrEmpty(displayName) ? "{ " + name + " }" : displayName);
        }
Example #2
0
        public Template(string name)
        {
            Require.NotNullOrEmpty(name, "name");

            Name = name;
            DisplayName = new LocalizableText(String.Format("{{ Template={0}, Key={1} }}", name, name));
            Skins = new TemplateSkinCollection(this);
            Layouts = new LayoutCollection(this);
            ResourcesFolder = new ResourceFolder(HostingEnvironment.MapPath(ResourceFolderVirtualPath));
        }
Example #3
0
 public void SetDisplayName(LocalizableText displayName)
 {
     DisplayName = displayName;
     DisplayName.ResourceDescriptor.TemplateName = Name;
 }
Example #4
0
        private void Configure()
        {
            string path = Server.MapPath(UrlUtil.Combine(VirtualPath, "config.config"));

            if (File.Exists(path))
            {
                var xml = XDocument.Load(path).Root;
                var displayName = xml.ChildElementValue("display-name");

                if (!String.IsNullOrEmpty(displayName))
                {
                    DisplayName = new LocalizableText(displayName);
                    DisplayName.ResourceDescriptor.TemplateName = Template.Name;
                }
            }

            if (DisplayName == null)
            {
                DisplayName = new LocalizableText(String.Format("{{ Template={0}, Key={1} }}", Template.Name, Name));
            }

            var layoutParser = LayoutFileParsers.GetParser(".aspx");
            var parseResult = layoutParser.Parse(Server.MapPath(AspxVirtualPath));

            foreach (var zoneName in parseResult.ZoneNames)
            {
                _zones.Add(zoneName, new Zone(zoneName, this));
            }
        }