public SourceCodeFileGeneratedEventArgs(SourceCodeFile file, DateTime executedTime) { if (file == null) throw new ArgumentNullException(); this.File = file; this.FileName = Path.GetFileName(this.FilePath); this.ExecutedTime = executedTime; }
public SourceCodeFileGeneratedEventArgs(SourceCodeFile file, DateTime executedTime) { if (file == null) { throw new ArgumentNullException(); } this.File = file; this.FileName = Path.GetFileName(this.FilePath); this.ExecutedTime = executedTime; }
private void Execute(SourceCodeFile file) { CSharpSourceCodeGenerator cs = null; using (var stm = new StreamWriter(file.FilePath, false, Encoding.UTF8)) { cs = new CSharpSourceCodeGenerator(stm); cs.Write(file.SourceCode); this.OnFileGenerated(new SourceCodeFileGeneratedEventArgs(file, DateTime.Now)); } Interlocked.Increment(ref _GeneratedCount); if (_GeneratedCount == _SourceCodeCount) { this.OnCompleted(); } }