public ThemeObj GetById(string name) { ThemeObj result = new ThemeObj(); ThemeObjFilter filter = new ThemeObjFilter(); filter.Name = name; List<ThemeObj> list = new ThemesObjManager().GetByFilter(filter); if (list.Count > 0) result = list[0]; return result; }
public Dictionary<string, string> GetList() { Dictionary<string, string> res = new Dictionary<string, string>(); ThemeObjFilter filter = new ThemeObjFilter(); List<ThemeObj> list = GetByFilter(filter); foreach (ThemeObj item in list) { res.Add(item.Name, item.Name); } return res; }
public List<ThemeObj> GetByFilter(ThemeObjFilter filter) { List<ThemeObj> result = new List<ThemeObj>(); string path = HttpContext.Current.Request.MapPath("~/App_Themes"); DirectoryInfo dir = new DirectoryInfo(path); DirectoryInfo[] dirs = dir.GetDirectories(); foreach (DirectoryInfo currDir in dirs) { if (currDir.Name.ToLower() != ".svn") { ThemeObj item = new ThemeObj(currDir.Name); result.Add(item); } } return result; }
protected void ObjDsTemplates_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { ThemeObjFilter filter = new ThemeObjFilter(); e.InputParameters["filter"] = filter; }