/// <summary>
        /// Parses the text in the input text box and displays a MEDITECH document node collection and HTML representation
        /// </summary>
        private void parse() {
            var document = new MeditechUtilities.FormattedTextDocument();
            document.MeditechText = inputTextBox.Text;
            document.BodyStyle = radioButton1.Checked ? document.BodyStyleFixed : document.BodyStyleProportional;
            document.ToHtml();

            sourceTextBox.Text = document.HtmlText;
            displayWebBrowser.DocumentText = document.HtmlText;
            populateTreeView(document.Nodes);
        }
        /// <summary>
        /// Generates a sample MEDITECH document
        /// </summary>
        private void generate() {
            // create the document
            var document = new MeditechUtilities.FormattedTextDocument();
            // allow local escape codes (for example italic)
            document.SupportsLocalEscapeCodes = true;

            // work with the node collection to build the document
            var nodes = document.Nodes;
            // create a new document
            nodes.StartDocument();

            // highlighted document title
            nodes.StartHighlight();
            nodes.AddText("***** DIAGNOSTIC REPORT******");
            nodes.StartNormalText();

            nodes.AddLineBreak();

            nodes.StartUnderline();
            nodes.AddText("Attending Physician");
            nodes.StartNormalText();
            nodes.AddText(": LARRY CARLIN");
            nodes.AddLineBreak();

            // this block has inline italics
            nodes.AddText("Compared to a prior study of ");
            nodes.StartItalic();
            nodes.AddText("02/22/94");
            nodes.StartNormalText();
            nodes.AddText(".  A small pneumothorax is seen at the");
            // we break here as the line will exceed the maximum line length
            nodes.AddText(" right apex.  Atelecatic changes are seen in the right mid lung and also in the left base.");
            nodes.AddLineBreak();

            nodes.AddText("Mediastinal and right thoracic chest tubes are also noted as before.");
            nodes.AddNewLine();
            nodes.AddText("Multiple surgical clips are seen in the lower thoracic region due to prior esophageal surgery.");
            nodes.AddLineBreak();

            nodes.AddText("No evidence of florid CHF.  No evidence of new parenchymal opacity since the prior study. The NG tube is also visualized as before.");
            nodes.AddLineBreak();

            nodes.AddLine("  Signed: R.A. Kolarshky, M.D.");
            nodes.AddLine("Cosigned: Victoria V. Venestia, M.D.");

            // end the document
            nodes.EndDocument();

            // build the MEDITECH formatted text codes
            inputTextBox.Text = document.ToMeditech();
        }
        private void helloWorld() {
            // create the document
            var document = new MeditechUtilities.FormattedTextDocument();
            // allow local escape codes (for example italic)
            document.SupportsLocalEscapeCodes = true;

            // work with the node collection to build the document
            var nodes = document.Nodes;
            // create a new document
            nodes.StartDocument();

            // highlighted document title
            nodes.StartHighlight();
            nodes.AddText("Hello World!");
            nodes.StartNormalText();

            // end the document
            nodes.EndDocument();

            // build the MEDITECH formatted text codes
            inputTextBox.Text = document.ToMeditech();
        }