public void Start() { if (JobProcessor.Current != this.service.Thread) { this.service.Thread.Enqueue(Job.Create(new Action(this.Start))); return; } if (OperationPerformance.GatherPerformance) { return; } OperationPerformance.GatherPerformance = true; ScheduleRepeater.Schedule(this.service.Thread, Job.Create(new Action(this.PerformanceLog)), this.interval, false); }
public CactiCsvFileDropper(string dir, string fileName, int interval_ms, List <string> columns) { this.JobProcessor = new JobProcessor(); this.JobProcessor.Start(); this.CactiDir = dir; if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } this.FileName = Path.Combine(dir, fileName); this.Columns = new List <string>(columns); this.Values = this.Columns.ToDictionary((string x) => x, (string x) => 0); ScheduleRepeater.Schedule(this.JobProcessor, Job.Create(new Action(this.DropFile)), interval_ms, false); }
protected void MyListBox_SelectedIndexChanged(object sender, EventArgs e) { try { ScheduleSource.DataFile = String.Format(@"http://www.finnkino.fi/xml/Schedule/?area={0}", MyListBox.SelectedValue); ScheduleRepeater.DataSourceID = ScheduleSource.ID; ScheduleRepeater.DataBind(); MyLiteral.Text = String.Format("Elokuvateatteri {0}", MyListBox.SelectedItem); } catch (Exception ex) { MyLiteral.Text = ex.Message; } }
public void Start(int reportInterval) { if (reportInterval <= 1000) { return; } Log <ServiceReporter> .Logger.InfoFormat("ServiceReporter.Start() : Interval={0}", reportInterval); this.JobProc = new JobProcessor(); this.JobProc.Start(); ScheduleRepeater.Schedule(this.JobProc, Job.Create(new Action(this.ReportData)), reportInterval, false); foreach (ServiceReporter.SubjectEntry subjectEntry in this.Subjects) { if (subjectEntry.GatheringInterval >= 1000) { ScheduleRepeater.Schedule(this.JobProc, Job.Create <ServiceReporter.SubjectEntry>(new Action <ServiceReporter.SubjectEntry>(this.DoGathering), subjectEntry), subjectEntry.GatheringInterval, false); } } }
protected void Page_Load(object sender, EventArgs e) { Server.ScriptTimeout = _serverTimeout; try { if (Session["User"] == null) { Response.Redirect("Home.aspx"); } ScheduleRepeater.DataSource = new string[] { "", "", "", "", "", "", "", "", "", "" }; ScheduleRepeater.DataBind(); UploadTitle.Text = _inviteToOverrideFieldText; UploadCreator.Text = _inviteToOverrideFieldText; UploadDate.Text = _inviteToOverrideFieldText; UploadDescription.Text = _inviteToOverrideFieldText; UploadDisplayDuration.Text = _inviteToOverrideFieldText; UploadURL.Text = _inviteToOverrideFieldText; SetDefaultToTextBox(UploadTitle); SetDefaultToTextBox(UploadCreator); SetDefaultToTextBox(UploadDate); SetDefaultToTextBox(UploadDescription); SetDefaultToTextBox(UploadDisplayDuration); SetDefaultToTextBox(UploadURL); ImageUploader1.LicenseKey = System.Configuration.ConfigurationSettings.AppSettings["imageUploaderLicense"]; ImageUploader1.FileMask = System.Configuration.ConfigurationSettings.AppSettings["imageUploaderFileMask"]; User user = (User)Session["User"]; if (user == null) { return; } var producer = ServiceLocator.Current.GetInstance <IPublisherManagementService>().GetByUserId(user.UserID); UsedBytes.Value = (user.TotalAvailableBytes - user.UsedBytes).ToString(); BytesBegin.Value = user.UsedBytes.ToString(); BytesTotal.Value = user.TotalAvailableBytes.ToString(); string storageCapacity = ((int)((float)user.TotalAvailableBytes / (1024F * 1024F))).ToString(); StorageCapacity.Text = storageCapacity; StorageCapacity2.Text = storageCapacity; displayDurationFlashMin.Text = System.Configuration.ConfigurationSettings.AppSettings["displayDurationFlashMin"]; displayDurationFlashMax.Text = System.Configuration.ConfigurationSettings.AppSettings["displayDurationFlashMax"]; displayDurationVideoMin.Text = System.Configuration.ConfigurationSettings.AppSettings["displayDurationVideoMin"]; displayDurationVideoMax.Text = System.Configuration.ConfigurationSettings.AppSettings["displayDurationVideoMax"]; displayDurationImageMin.Text = System.Configuration.ConfigurationSettings.AppSettings["displayDurationImageMin"]; displayDurationImageMax.Text = System.Configuration.ConfigurationSettings.AppSettings["displayDurationImageMax"]; ImageUploader1.PaneLayout = PaneLayout.TwoPanes; ImageUploader1.TreePaneWidth = 205; ImageUploader1.UploadView = Aurigma.ImageUploader.View.AdvancedDetails; ImageUploader1.AdvancedDetailsPreviewThumbnailSize = 40; ImageUploader1.ButtonSendText = String.Empty; ImageUploader1.BackgroundColor = System.Drawing.Color.Transparent; ImageUploader1.SplitterLineColor = System.Drawing.Color.Blue; ImageUploader1.FolderPaneBorderStyle = Aurigma.ImageUploader.BorderStyle.Fixed3D; ImageUploader1.UploadPaneBorderStyle = Aurigma.ImageUploader.BorderStyle.None; ImageUploader1.TreePaneBorderStyle = Aurigma.ImageUploader.BorderStyle.Fixed3D; ImageUploader1.SplitterLineStyle = LineStyle.Dot; ImageUploader1.UploadThumbnail1FitMode = ThumbnailFitMode.Fit; ImageUploader1.UploadThumbnail1Width = 100; ImageUploader1.UploadThumbnail1Height = 75; ImageUploader1.UploadThumbnail1JpegQuality = 60; ImageUploader1.UploadThumbnail2FitMode = ThumbnailFitMode.Fit; ImageUploader1.UploadThumbnail2Width = 1900; ImageUploader1.UploadThumbnail2Height = 1200; ImageUploader1.UploadThumbnail2JpegQuality = 75; ImageUploader1.UploadThumbnail1ResizeQuality = ResizeQuality.High; ImageUploader1.TimeOut = 3600000; ImageUploader1.FilesPerOnePackageCount = 1; ImageUploader1.AutoRecoverMaxTriesCount = 2; ImageUploader1.AutoRecoverTimeOut = 10000; ImageUploader1.MaxConnectionCount = 5; ImageUploader1.ShowDescriptions = false; ImageUploader1.MaxTotalFileSize = (int)((user.TotalAvailableBytes - user.UsedBytes) * 1.1F); ImageUploader1.Action = "CreateWizard.aspx"; _templates = producer.AssignedTemplates; //foreach (Template template in templates) // TemplateList.Text += "<option value=\"" + template.Id + "\">" + template.Name + "</option>"; // Get total number of uploaded files (all files are uploaded in a single package). // (if files have been uploaded) if (Request.Form["FileCount"] == null) { return; } long totalUploadSize; UploadAndSaveToDB(out totalUploadSize); ((User)Session["User"]).UsedBytes += totalUploadSize; } catch (Exception ex) { _logger.Error(ex.ToString()); } }
private void ScheduleUpdatePrice() { ScheduleRepeater.Schedule(this.service.Thread, Job.Create(new Action(this.UpdatePrice)), 3600000, true); }