Beispiel #1
0
 private void OnTemplateGenerationStatus(TemplateGenerationStatusEventArgs e)
 {
     if (TemplateGenerationStatus != null)
     {
         TemplateGenerationStatus(this, e);
     }
 }
Beispiel #2
0
        /// <summary>Compiles the referenced XSLT for all templates.</summary>
        private IDictionary <Template, Task <XslCompiledTransform> > GetTemplateCompilationTaskMap()
        {
            IDictionary <Template, Task <XslCompiledTransform> > templateTransformTaskMap = new ConcurrentDictionary <Template, Task <XslCompiledTransform> >();

            foreach (Template template in this.TemplateOutputs.Keys)
            {
                OnTemplateGenerationStatus(TemplateGenerationStatusEventArgs.CreateCompiling(template));

                try {
                    templateTransformTaskMap.Add(template, CompileTemplateAsync(template));
                }
                catch (Exception ex) {
                    Generator.Logger.Error(ex);
                    OnTemplateGenerationStatus(TemplateGenerationStatusEventArgs.CreateError(template, new ApplicationException("Unable to load XSLT.", ex)));
                    break;
                }

                OnTemplateGenerationStatus(TemplateGenerationStatusEventArgs.CreateWaiting(template));
            }

            return(templateTransformTaskMap);
        }
        void Generator_TemplateGenerationStatus(Generator generator, TemplateGenerationStatusEventArgs e) {
            this.Invoke(new GenericDelegate<TemplateGenerationStatusEventArgs>(x => {
                ListViewGroup group = outputsListView.Groups.Cast<ListViewGroup>().Single(o => o.Tag == e.Template);

                foreach (ListViewItem item in group.Items)
                    UpdateListViewItemStatus(item, e.Status, e.Error);
            }), e);
        }
 private void OnTemplateGenerationStatus(TemplateGenerationStatusEventArgs e) {
     if (TemplateGenerationStatus != null)
         TemplateGenerationStatus(this, e);
 }