public void Dispose() { // Dispose templates: if (this.templates != null) { foreach (TemplateInfo item in this.templates.Values) { item.Dispose(); } this.templates = null; } } }