public void AddJob(ParsePriority priority, ParseJob newJob) { //check if we have this version lock (_lock) { if (_parsedVersions.ContainsKey(newJob.Path)) { if (newJob.DocumentVersion <= _parsedVersions[newJob.Path]) return; } } _parseThreads.AddJob(priority, newJob); }
public void AddJob(ParsePriority priority, ParseJob newJob) { lock (_lock) { foreach(var job in _work) { if(job.Path == newJob.Path) { if (priority == ParsePriority.Editing) //we want to move it to the front { _work.Remove(job); break; } else return; } } if (priority == ParsePriority.Editing) _work.Insert(0, newJob); else _work.Insert(_work.Count, newJob); _workerParseEvent.Set(); } }
private void Parse(ParseJob job) { job.Parse(); }