public ComponentCollection GetConfigCollection() { var cl = new ComponentCollection(); var host = ContextHelper.GetHostUrl(); var query = ContextHelper.GetQueryString(); cl.Components.Add(new Component() { Name = "Files", Url = string.Format("{0}{1}/files{2}", host, AppConst.Configurations, query) });//, Components= ConfigFileManager.Current.GetFileComonents(ContextHelper.GetHostUrl()})); cl.Components.Add(new Component() { Name = "Beans", Url = string.Format("{0}{1}/beans{2}", host, AppConst.Configurations, query) });//Components= ConfigBeanManager.Current.GetBeanComponents(ContextHelper.GetHostUrl()})); return cl; }
public ComponentCollection GetCategories() { ComponentCollection category = new ComponentCollection(); var query = ContextHelper.GetQueryString(); category.Components.Add(new Component() { Name = "IISLog", Url = ContextHelper.GetHostUrl() + AppConst.LocalLog + "/IISLog/" + query }); category.Components.Add(new Component() { Name = "AppLog", Url = ContextHelper.GetHostUrl() + AppConst.LocalLog + "/AppLog/" + query }); //category.Categories.Add(GetLogs(IISLogPath,"IISLog")); //category.Categories.Add(GetLogs(AppLogPath, "AppLog")); return category; }
/// <summary> /// 返回包含所有Validator的集合 /// </summary> /// <returns>集合</returns> public ComponentCollection GetValidatorCollection() { var coll = new ComponentCollection(); try { coll.Name = "Validation"; var query = ContextHelper.GetQueryString(); coll.Components = validators.Values.Select(v => new Component() { Name = v.FriendlyName, Url = ContextHelper.GetHostUrl() + AppConst.Validation + "/" + ContextHelper.ReplaceDotToLine(v.GetType().FullName).ToLowerInvariant() + query }).ToList<Component>(); } catch { } return coll; }
private ComponentCollection SetMenus() { var url = HttpContext.Current.Request.Url; var query = ContextHelper.GetQuery(); var hostUrl = ContextHelper.GetHostUrl(); ComponentCollection mc = new ComponentCollection(); mc.Name = "Menus"; mc.Components.Add(new Component() { Name = AppConst.ComponentsTitle, Url = string.Format(format, hostUrl, AppConst.Components, query) }); mc.Components.Add(new Component() { Name = AppConst.ConfigurationsTitle, Url = string.Format(format, hostUrl, AppConst.Configurations, query) }); mc.Components.Add(new Component() { Name = AppConst.FeatureContingencyTitle, Url = string.Format(format, hostUrl, AppConst.FeatureContingency, query) }); mc.Components.Add(new Component() { Name = AppConst.ValidationTitle, Url = string.Format(format, hostUrl, AppConst.Validation, query) }); mc.Components.Add(new Component() { Name = AppConst.LocalLogTitle, Url = string.Format(format, hostUrl, AppConst.LocalLog, query) }); mc.Components.Add(new Component() { Name = AppConst.RefreshCacheTitle, Url = string.Format(format, hostUrl, AppConst.RefreshCache, query) }); return mc; }
public ComponentCollection GetConfigCollection(string type) { var host = ContextHelper.GetHostUrl(); var cl = new ComponentCollection(); if (type == "files") { cl.Name = "Files"; cl.Components.AddRange(ConfigFileManager.Current.GetFileComonents(ContextHelper.GetHostUrl())); } else { cl.Name = "Beans"; cl.Components.AddRange(ConfigBeanManager.Current.GetBeanComponents(ContextHelper.GetHostUrl())); } return cl; }
/// <summary> /// 得到所有的Component, 以ComponentCollection形式返回 /// </summary> /// <returns>ComponentCollection</returns> public ComponentCollection GetCollection() { var cl = new ComponentCollection(); try {cl.Name = "Componets"; var query = ContextHelper.GetQueryString(); cl.Components = GetComponents() .Select( a => new Component() { Name = a.GetType().Name.ToLowerInvariant(), Url = ContextHelper.GetHostUrl() + AppConst.Components + "/" + ContextHelper.ReplaceDotToLine( a.GetType().FullName ).ToLowerInvariant() + query } ) .ToList<Component>(); } catch ( Exception ex ) { } return cl; }
private ComponentCollection Collections() { ComponentCollection collection = new ComponentCollection(); collection.Name = "FeatureContingencies"; string hostUrl = ContextHelper.GetHostUrl(); string query = ContextHelper.FormatQueryString(); collection.Components = fcInfos.Values.Select(fc => new Component() { Name = fc.Name.ToLower(), LastModifyTime = fc.LastWriteTime(), Url = string.Format("{0}{1}/{3}{2}action=view", hostUrl, AppConst.FeatureContingency, query, fc.Name) }).ToList<Component>(); return collection; }