Exemple #1
0
        public void LoadAvailableTheme(string themeId)
        {
            string themePhysicalRoot = WebAppSettings.ApplicationBuiltinThemesPath + "\\theme-" + themeId + "\\";

            if (!Directory.Exists(themePhysicalRoot))
            {
                return;
            }

            _Info = new ThemeInfo();
            if (File.Exists(Path.Combine(themePhysicalRoot, "bvtheme.xml")))
            {
                _Info.LoadFromString(File.ReadAllText(Path.Combine(themePhysicalRoot, "bvtheme.xml")));
            }

            if (File.Exists(Path.Combine(themePhysicalRoot, ".customized")))
            {
                _IsCustomized = true;
            }
            else
            {
                _IsCustomized = false;
            }

            if (File.Exists(Path.Combine(themePhysicalRoot, "preview.png")))
            {
                _PreviewImageUrl = "/content/themes/theme-" + themeId + "/preview.png";
            }
            else
            {
                _PreviewImageUrl = string.Empty;
            }
        }
Exemple #2
0
        public void LoadInstalledTheme(MerchantTribeApplication app, string themeId)
        {
            long storeId = app.CurrentStore.Id;
            string themePhysicalRoot = Storage.DiskStorage.BaseStoreThemePhysicalPath(storeId, themeId);

            if (!Directory.Exists(themePhysicalRoot))
            {
                return;
            }

            _Info = new ThemeInfo();
            if (File.Exists(Path.Combine(themePhysicalRoot,"bvtheme.xml")) )
            {
                _Info.LoadFromString(File.ReadAllText(Path.Combine(themePhysicalRoot,"bvtheme.xml")));
            }

            if (File.Exists(Path.Combine(themePhysicalRoot,".customized")))
            {
                _IsCustomized = true;
            }
            else
            {
                _IsCustomized = false;  
            }

            if (File.Exists(Path.Combine(themePhysicalRoot,"preview.png")))
            {
                _PreviewImageUrl = Storage.DiskStorage.BaseUrlForStoreTheme(app, themeId, true) + "preview.png";
            }
            else
            {
                _PreviewImageUrl = string.Empty;
            }
        }
Exemple #3
0
        public void LoadAvailableTheme(string themeId)
        {
            string themePhysicalRoot = WebAppSettings.ApplicationBuiltinThemesPath + "\\theme-" + themeId + "\\";

            if (!Directory.Exists(themePhysicalRoot))
            {
                return;
            }

            _Info = new ThemeInfo();
            if (File.Exists(Path.Combine(themePhysicalRoot, "bvtheme.xml")))
            {
                _Info.LoadFromString(File.ReadAllText(Path.Combine(themePhysicalRoot, "bvtheme.xml")));
            }

            if (File.Exists(Path.Combine(themePhysicalRoot, ".customized")))
            {
                _IsCustomized = true;
            }
            else
            {
                _IsCustomized = false;
            }

            if (File.Exists(Path.Combine(themePhysicalRoot, "preview.png")))
            {
                _PreviewImageUrl = "/content/themes/theme-" + themeId + "/preview.png";
            }
            else
            {
                _PreviewImageUrl = string.Empty;
            }
        }
Exemple #4
0
        public void LoadInstalledTheme(MerchantTribeApplication app, string themeId)
        {
            long   storeId           = app.CurrentStore.Id;
            string themePhysicalRoot = Storage.DiskStorage.BaseStoreThemePhysicalPath(storeId, themeId);

            if (!Directory.Exists(themePhysicalRoot))
            {
                return;
            }

            _Info = new ThemeInfo();
            if (File.Exists(Path.Combine(themePhysicalRoot, "bvtheme.xml")))
            {
                _Info.LoadFromString(File.ReadAllText(Path.Combine(themePhysicalRoot, "bvtheme.xml")));
            }

            if (File.Exists(Path.Combine(themePhysicalRoot, ".customized")))
            {
                _IsCustomized = true;
            }
            else
            {
                _IsCustomized = false;
            }

            if (File.Exists(Path.Combine(themePhysicalRoot, "preview.png")))
            {
                _PreviewImageUrl = Storage.DiskStorage.BaseUrlForStoreTheme(app, themeId, true) + "preview.png";
            }
            else
            {
                _PreviewImageUrl = string.Empty;
            }
        }
        public ThemeInfo GetThemeInfo(string themeId)
        {
            string    newInfoXml = Storage.DiskStorage.ReadThemeFile(MTApp.CurrentStore.Id, themeId, "bvtheme.xml");
            ThemeInfo newInfo    = new ThemeInfo();

            newInfo.LoadFromString(newInfoXml);
            return(newInfo);
        }
Exemple #6
0
		public static ThemeInfo ReadFromXml(string fileName)
		{
			ThemeInfo result = new ThemeInfo();

			try {
				if (File.Exists(fileName)) {
					string xmlData = File.ReadAllText(fileName);
					result.LoadFromString(xmlData);
				}
			}
			catch {
				// surpress errors
			}

			return result;
		}
Exemple #7
0
        public static ThemeInfo ReadFromXml(string fileName)
        {
            ThemeInfo result = new ThemeInfo();

            try {
                if (File.Exists(fileName))
                {
                    string xmlData = File.ReadAllText(fileName);
                    result.LoadFromString(xmlData);
                }
            }
            catch {
                // surpress errors
            }

            return(result);
        }
 public ThemeInfo GetThemeInfo(string themeId)
 {
     string newInfoXml = Storage.DiskStorage.ReadThemeFile(MTApp.CurrentStore.Id, themeId, "bvtheme.xml");
     ThemeInfo newInfo = new ThemeInfo();
     newInfo.LoadFromString(newInfoXml);
     return newInfo;            
 }