/// <summary>
/// Method to check if theme exists
/// </summary>
/// <param name="themeName"></param>
/// <returns></returns>
public static bool ThemeExists(string themeName)
{
bool hasTheme = false;
try
{
System.IO.DirectoryInfo themeInfo = new System.IO.DirectoryInfo(System.Web.HttpContext.Current.Server.MapPath("~/App_Themes"));
System.IO.DirectoryInfo[] dirInfo = themeInfo.GetDirectories();
var theme = dirInfo.AsEnumerable().Where(dir => dir.Name == themeName);
hasTheme = (theme != null && theme.Count() > 0);
}
catch
{
}
return hasTheme;
}
/// Method to check if theme exists
/// </summary>
/// <param name="themeName"></param>
/// <returns></returns>
public static bool ThemeExists(string themeName)
{
bool hasTheme = false;
try
{
System.IO.DirectoryInfo themeInfo = new System.IO.DirectoryInfo(System.Web.HttpContext.Current.Server.MapPath("~/App_Themes"));
System.IO.DirectoryInfo[] dirInfo = themeInfo.GetDirectories();
var theme = dirInfo.AsEnumerable().Where(dir => dir.Name == themeName);
hasTheme = (theme != null && theme.Count() > 0);
}
catch
{
}
return hasTheme;
}
No comments:
Post a Comment