public ItemBlock(ScheduleItem item, int top, int height) { _rectangle = new Rectangle(); Item = item; Top = top; Height = height; ProgramName = System.IO.Path.GetFileName(item.FilePath); }
private void _Execute(ScheduleItem item) { try { _SetEnableState(false); string filepath = item.FilePath; VixenSystem.Logging.Schedule("Executing scheduled item: " + filepath); IProgramContext context; if (_cachedPrograms.ContainsKey(filepath)) { VixenSystem.Logging.Schedule("Item found in cached programs. Reusing."); context = _cachedPrograms[filepath]; } else { VixenSystem.Logging.Schedule("Item NOT found in cached programs. Generating..."); Program program = Vixen.Services.ApplicationServices.LoadProgram(filepath); context = VixenSystem.Contexts.CreateProgramContext(new ContextFeatures(ContextCaching.ContextLevelCaching), program); foreach (ISequence sequence in context.Program.Sequences) { VixenSystem.Logging.Schedule(" - Prerendering effects for sequence: " + sequence.Name); foreach (IEffectNode effectNode in sequence.SequenceData.EffectData.Cast<IEffectNode>()) { effectNode.Effect.PreRender(); } } _cachedPrograms[filepath] = context; } context.ProgramEnded += context_ProgramEnded; _currentContexts[context] = item; item.IsExecuting = true; item.LastExecutedAt = DateTime.Now; VixenSystem.Logging.Schedule("Starting execution."); context.Start(); _SetEnableState(true); } catch(Exception ex) { VixenSystem.Logging.Schedule("Could not execute sequence " + item.FilePath + "; " + ex.Message); } }
private bool _CanExecute(ScheduleItem item) { return !item.IsExecuting; }
private void scheduleDayView_TimeDoubleClick(object sender, ScheduleEventArgs e) { ScheduleItem item = new ScheduleItem { RunStartTime = e.TimeOffset, RepeatsWithinBlock = false, RepeatsOnInterval = false }; using (ScheduleItemEditForm scheduleItemEditForm = new ScheduleItemEditForm(item)) { if (scheduleItemEditForm.ShowDialog() == DialogResult.OK) { _data.Items.Add(item); _RefreshView(); } } }
public ScheduleItemEditForm(ScheduleItem scheduleItem) { InitializeComponent(); _ScheduleItem = scheduleItem; }
public ScheduleItemEditForm(ScheduleItem scheduleItem) { InitializeComponent(); _ScheduleItem = scheduleItem; }
private void _Execute(ScheduleItem item) { try { _SetEnableState(false); Program program = Vixen.Services.ApplicationServices.LoadProgram(item.FilePath); IProgramContext context = VixenSystem.Contexts.CreateProgramContext(new ContextFeatures(ContextCaching.ContextLevelCaching), program); context.ProgramEnded += context_ProgramEnded; _contexts[context] = item; item.IsExecuting = true; item.LastExecutedAt = DateTime.Now; context.Start(); _SetEnableState(true); } catch(Exception ex) { VixenSystem.Logging.Schedule("Could not execute sequence " + item.FilePath + "; " + ex.Message); } }
private bool _CanExecute(ScheduleItem item) { return(!item.IsExecuting); }