private void button12_Click(object sender, EventArgs e) { var sectionName = sectionBox.Text; var outputDirectory = textBox1.Text; var notebookParser = new NotebookParser(); var sectionId = notebookParser.GetObjectId( Microsoft.Office.Interop.OneNote.HierarchyScope.hsSections, sectionName); if (String.IsNullOrEmpty(sectionId)) { Log("Unknown section"); } else { var writer = new MDWriter(outputDirectory, true); var pageIds = notebookParser.GetChildObjectIds( sectionId, Microsoft.Office.Interop.OneNote.HierarchyScope.hsChildren, ObjectType.Page); foreach (var pageId in pageIds) { var generator = new MDGenerator(notebookParser); generator.GeneratePageMD(pageId, writer); } } }
private void button13_Click(object sender, EventArgs e) { var outputDirectory = textBox1.Text; var writer = new MDWriter(outputDirectory, true); var notebookParser = new NotebookParser(); var pageId = notebookParser.GetObjectId( Microsoft.Office.Interop.OneNote.HierarchyScope.hsPages, pageBox.Text); if (String.IsNullOrEmpty(pageId)) { Log("Unknown page"); } else { var generator = new MDGenerator(notebookParser); generator.GeneratePageMD(pageId, writer); } }