private void RestoreTemplateState() { // Let's restore the stack, we are if (UnfoldingTemplates.Count > 0 && UnfoldingTemplates.Peek() == this) { UnfoldingTemplates.Pop(); } foreach (ProjectItem prItem in openedItems) { if (prItem.Document != null) { prItem.Document.Close(vsSaveChanges.vsSaveChangesNo); } } openedItems.Clear(); if (didEnable) { IRecipeManagerService recipeManager = (IRecipeManagerService) GetService(typeof(IRecipeManagerService)); if (recipeManager != null) { recipeManager.DisablePackage(Package); } } }
private void LoadDictionary() { if (UnfoldingTemplates.Count > 0) { UnfoldTemplate parentTemplate = (UnfoldTemplate)UnfoldingTemplates.Peek(); CheckConflictingArguments(parentTemplate); foreach (DictionaryEntry keyValuePair in parentTemplate.templateDictionary.State) { if (this.templateDictionary.GetValue(keyValuePair.Key) == null) { this.templateDictionary.SetValue(keyValuePair.Key, keyValuePair.Value); } } } // After we load the Dictionary, now push ourselves into the unfolding templates stack UnfoldTemplate.UnfoldingTemplates.Push(this); }