Esempio n. 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;
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 5
0
        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);
        }
Esempio n. 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;
		}
Esempio n. 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);
        }
Esempio n. 8
0
 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;            
 }