internal void EnqueueScan(BakingSettings settings, DateTime dt) { var existing = this.WorkItems.Where(v => v.Settings.AssemblyPath == settings.AssemblyPath && v.AtOrAfter != DateTime.MinValue).FirstOrDefault(); if (existing != null) { existing.AtOrAfter = dt; return; } else { this.WorkItems.Enqueue(new ScanWorkItem(settings.Clone(), dt)); this.Waiter.Set(); } }
public void Run(BakingSettings settings) { if (this.IsRunning) { throw new InvalidOperationException("Already running."); } // create... this.Log(string.Format("Starting monitoring of '{0}'...", settings.AssemblyPath)); // run... this.LastSettings = settings.Clone(); this.Runner.EnqueueScan(this.LastSettings); // ok... this.IsRunning = true; }
internal WorkItem(BakingSettings settings, DateTime atOrAfter, ManualResetEvent waiter) { this.Settings = settings; this.AtOrAfter = atOrAfter; this.Waiter = waiter; }
internal void EnqueueBaking(BakingSettings settings, ManualResetEvent waiter = null) { this.WorkItems.Enqueue(new BakingWorkItem(settings.Clone(), DateTime.MinValue, waiter)); this.Waiter.Set(); }
internal void EnqueueScan(BakingSettings settings) { this.EnqueueScan(settings, DateTime.MinValue); }
internal ScanWorkItem(BakingSettings settings, DateTime atOrAfter, ManualResetEvent waiter = null) : base(settings, atOrAfter, waiter) { }
internal Resolver(BakingSettings settings) { this.Settings = settings; AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; }