public void LoadProject(DocProject project) { if (Model.Project != null) { Model.KavaDocsModel.Configuration.AddRecentProjectItem(Model.Project.Filename, Model.KavaDocsModel.ActiveTopic?.Id, Model.Project.Title); } Model.Project = project; if (Model.Project == null) { Model.TopicTree = new ObservableCollection <DocTopic>(); return; } project.GetTopicTree(); //StringBuilder sb = new StringBuilder(); //project.WriteTopicTree(project.Topics, 0, sb); if (project.Topics != null && project.Topics.Count > 0) { Model.KavaDocsModel.ActiveTopic = project.Topics[0]; } Model.TopicTree = project.Topics; Model.KavaDocsModel.Configuration.AddRecentProjectItem(project.Filename, projectTitle: project.Title); }
public TopicsTreeModel(DocProject project) { KavaDocsModel = kavaUi.AddinModel; MarkdownMonsterModel = kavaUi.MarkdownMonsterModel; Project = project; if (project != null) { project.GetTopicTree(); } else { TopicTree = new ObservableCollection <DocTopic>(); } }