Example #1
0
        private void ExportTargeter_ExportTargetProcessed(object sender, ExportTargetEventArgs e)
        {
            //导出定向进度变化时
            String targeterName = (sender as IExportTargeter).TargeterName;
            Action action       = () =>
            {
                this._pbarExportProcess.Maximum = e.Total;
                this._pbarExportProcess.Value   = e.Current;
                this.ShowTipInformation($"定向器:{targeterName},正在定向文件->{e.FileName}...");
            };

            this.Invoke(action);
        }
 /// <summary>
 /// 继承自 <see cref="IExportTargeter.PointTo(String[])"/>
 /// </summary>
 /// <param name="exportFiles"></param>
 public void PointTo(String[] exportFiles)
 {
     if (exportFiles != null && exportFiles.Length > 0)
     {
         ExportTargetEventArgs args = new ExportTargetEventArgs();
         args.Total = exportFiles.Length;
         foreach (var filePath in exportFiles)
         {
             String fileName = Path.GetFileName(filePath);
             args.FileName = fileName;
             String newPath = Path.Combine(this.TargetDirectory, fileName);
             File.Copy(filePath, newPath, true);
             args.Current++;
             this.ExportTargetProcessed?.Invoke(this, args);
         }
     }
 }