public void AddNewTemplateEditor(RazorTemplateViewModel template, bool current = true) { Log.Debug("Adding new template editor (current: {0})...", current); template.AutoExecute = AutoExecute; template.AutoSave = AutoExecute; template.Messages = Messages; template.Executing += OnAutoSave; Templates.Add(template); if (!string.IsNullOrWhiteSpace(template.Filename)) { RecentFiles.Add(template.Filename); } if (current) { Log.Debug("Setting as current template"); CurrentTemplate = template; } template.Execute(); Log.Info("Added new template editor"); }
public void AddNewTemplateEditor(RazorTemplateViewModel template, bool current = true) { Log.Debug("Adding new template editor (current: {0})...", current); template.AutoExecute = AutoExecute; template.AutoSave = AutoExecute; template.Messages = Messages; template.Executing += OnAutoSave; Templates.Add(template); if (!string.IsNullOrWhiteSpace(template.Filename)) RecentFiles.Add(template.Filename); if (current) { Log.Debug("Setting as current template"); CurrentTemplate = template; } template.Execute(); Log.Info("Added new template editor"); }