public SourceCodeFileGeneratedEventArgs(SourceCodeFile file, DateTime executedTime)
 {
     if (file == null) throw new ArgumentNullException();
     this.File = file;
     this.FileName = Path.GetFileName(this.FilePath);
     this.ExecutedTime = executedTime;
 }
Пример #2
0
 public SourceCodeFileGeneratedEventArgs(SourceCodeFile file, DateTime executedTime)
 {
     if (file == null)
     {
         throw new ArgumentNullException();
     }
     this.File         = file;
     this.FileName     = Path.GetFileName(this.FilePath);
     this.ExecutedTime = executedTime;
 }
Пример #3
0
        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();
            }
        }
Пример #4
0
        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();
            }
        }