Beispiel #1
0
 private void LoadTemplateData(Dictionary <string, string> replacementsDictionary, string templateFileName)
 {
     try
     {
         templateFileName        = new CompatibleUri(templateFileName).LocalPath;
         this.templateDictionary = new TemplateDictionaryService(replacementsDictionary);
         IVsTemplatesService templatesService =
             (IVsTemplatesService)GetService(typeof(IVsTemplatesService));
         this.template = templatesService.GetTemplate(templateFileName);
     }
     catch (Exception e)
     {
         ErrorHelper.Show((IUIService)GetService(typeof(IUIService)), e, Properties.Resources.Templates_InvalidWizardData);
         throw new WizardCancelledException();
     }
 }
Beispiel #2
0
 /// <summary>
 /// See <see cref="IDisposable.Dispose"/>.
 /// </summary>
 protected override void Dispose(bool disposing)
 {
     if (this.template != null)
     {
         this.template = null;
     }
     if (this.templateDictionary != null)
     {
         this.templateDictionary = null;
     }
     if (UnfoldTemplate.UnfoldingTemplates.Count > 0 && UnfoldTemplate.UnfoldingTemplates.Peek() == this)
     {
         UnfoldTemplate.UnfoldingTemplates.Pop();
     }
     if (openedItems != null)
     {
         openedItems.Clear();
         openedItems = null;
     }
     // Will automatically remove this component from its container.
     base.Dispose(disposing);
 }