public void Initialise (DirectoryManager directoryManager, SourceFile sourceFile) { this.directoryManager = directoryManager; SourceFile = sourceFile; string dateTime = Utilities.FilenameFriendlyDateTime (this.timeStarted); string filename = Path.GetFileName (SourceFile.FilePath); this.workingSourcePath = Path.Combine (this.directoryManager.WorkingDirectory, Path.GetFileNameWithoutExtension (filename) + ".Source." + Environment.MachineName + "." + dateTime + Path.GetExtension (filename)); }
/// <summary> /// add a single source file to encode /// </summary> /// <param name="file">file to add</param> public void AddFile (SourceFile file) { // excluded file? if (ExcludeFile (file.FilePath)) { return; } lock (this.sourceFiles) { // already in queue? foreach (SourceFile fileCheck in this.sourceFiles) { if (file.FilePath == fileCheck.FilePath) { return; } } this.sourceFiles.Enqueue (file); } ThreadPool.QueueUserWorkItem (this.EncodeJob); }