Ejemplo n.º 1
0
 public static void FillTemplate(ICollection<Person> persons, WordFillerOptions options)
 {
     _fillerStatusStrategy = StrategyFactory.CreateStrategy(options.IsBackground);
     _fillerStatusStrategy.Init(options.BackgroundOps);
     _fillerStatusStrategy.Worker.DoWork += (o, eventArgs) => FillTemplate(options.TemplateName, persons, options.SavePath);
     _fillerStatusStrategy.Run();
 }
Ejemplo n.º 2
0
 public void Link(WordFillerOptions options)
 {
     _packetName = options.PacketName;
     _linker = new Linker();
     _linker.LinkObjectToControl(this, options);
 }
Ejemplo n.º 3
0
 private bool PrepareWordFillerOptions(out WordFillerOptions options)
 {
     options = new WordFillerOptions();
     if (_currentPacket == null) return true;
     options.BackgroundOps = new BackgroundOptions();
     options.PacketName = _currentPacket.Name;
     options.BackgroundOps.BackgroundProgressBar = this.backgroundProgress;
     options.BackgroundOps.BackgroundStopButton = this.backgroundStop;
     var form = new WordFillerForm();
     form.Link(options);
     if (form.ShowDialog() != DialogResult.OK) return true;
     options.BackgroundOps.IsBackground = options.IsBackground;
     options.TemplateName = TemplateStorage.GetFullTemplateName(options.TemplateName);
     return false;
 }