RunBlockGamut(string text)
+ {
+ if (text is null)
+ {
+ throw new ArgumentNullException(nameof(text));
+ }
+
+ return this.DoHeaders(text,
+ s1 => this.DoHorizontalRules(s1,
+ s2 => this.DoLists(s2,
+ s3 => this.DoTable(s3,
+ sn => this.FormParagraphs(sn)))));
+
+ //text = DoCodeBlocks(text);
+ //text = DoBlockQuotes(text);
+
+ //// We already ran HashHTMLBlocks() before, in Markdown(), but that
+ //// was to escape raw HTML in the original Markdown source. This time,
+ //// we're escaping the markup we've just created, so that we don't wrap
+ //// tags around block-level tags.
+ //text = HashHTMLBlocks(text);
+
+ //text = FormParagraphs(text);
+
+ //return text;
+ }
+
+ ///
+ /// Perform transformations that occur *within* block-level tags like paragraphs, headers,
+ /// and list items.
+ ///
+ private IEnumerable RunSpanGamut(string text)
+ {
+ if (text is null)
+ {
+ throw new ArgumentNullException(nameof(text));
+ }
+
+ return this.DoCodeSpans(text,
+ s0 => this.DoImages(s0,
+ s1 => this.DoAnchors(s1,
+ s2 => this.DoItalicsAndBold(s2,
+ s3 => this.DoText(s3)))));
+
+ //text = EscapeSpecialCharsWithinTagAttributes(text);
+ //text = EscapeBackslashes(text);
+
+ //// Images must come first, because ![foo][f] looks like an anchor.
+ //text = DoImages(text);
+ //text = DoAnchors(text);
+
+ //// Must come after DoAnchors(), because you can use < and >
+ //// delimiters in inline links like [this]().
+ //text = DoAutoLinks(text);
+
+ //text = EncodeAmpsAndAngles(text);
+ //text = DoItalicsAndBold(text);
+ //text = DoHardBreaks(text);
+
+ //return text;
+ }
+
+ private Block SetextHeaderEvaluator(Match match)
+ {
+ if (match is null)
+ {
+ throw new ArgumentNullException(nameof(match));
+ }
+
+ string header = match.Groups[1].Value;
+ int level = match.Groups[2].Value.StartsWith("=", StringComparison.Ordinal) ? 1 : 2;
+
+ //TODO: Style the paragraph based on the header level
+ return this.CreateHeader(level, this.RunSpanGamut(header.Trim()));
+ }
+
+ private Block TableEvalutor(Match match)
+ {
+ if (match is null)
+ {
+ throw new ArgumentNullException(nameof(match));
+ }
+
+ string wholeTable = match.Groups[1].Value;
+ string header = match.Groups[2].Value.Trim();
+ string style = match.Groups[4].Value.Trim();
+ string row = match.Groups[6].Value.Trim();
+
+ string[] styles = style[1..^1].Split('|');
+ string[] headers = header[1..^1].Split('|');
+ List rowList = row.Split('\n').Select(ritm =>
+ {
+ string trimRitm = ritm.Trim();
+ return trimRitm[1..^1].Split('|');
+ }).ToList();
+
+ int maxColCount =
+ Math.Max(
+ Math.Max(styles.Length, headers.Length),
+ rowList.Select(ritm => ritm.Length).Max()
+ );
+
+ // table style
+ List aligns = new List();
+ foreach (string colStyleTxt in styles)
+ {
+ char firstChar = colStyleTxt.First();
+ char lastChar = colStyleTxt.Last();
+
+ // center
+ if (firstChar == ':' && lastChar == ':')
+ {
+ aligns.Add(TextAlignment.Center);
+ }
+
+ // right
+ else if (lastChar == ':')
+ {
+ aligns.Add(TextAlignment.Right);
+ }
+
+ // left
+ else if (firstChar == ':')
+ {
+ aligns.Add(TextAlignment.Left);
+ }
+
+ // default
+ else
+ {
+ aligns.Add(null);
+ }
+ }
+ while (aligns.Count < maxColCount)
+ {
+ aligns.Add(null);
+ }
+
+ // table
+ Table table = new Table();
+ if (this.TableStyle != null)
+ {
+ table.Style = this.TableStyle;
+ }
+
+ // table columns
+ while (table.Columns.Count < maxColCount)
+ {
+ table.Columns.Add(new TableColumn());
+ }
+
+ // table header
+ TableRowGroup tableHeaderRG = new TableRowGroup();
+ if (this.TableHeaderStyle != null)
+ {
+ tableHeaderRG.Style = this.TableHeaderStyle;
+ }
+
+ TableRow tableHeader = this.CreateTableRow(headers, aligns);
+ tableHeaderRG.Rows.Add(tableHeader);
+ table.RowGroups.Add(tableHeaderRG);
+
+ // row
+ TableRowGroup tableBodyRG = new TableRowGroup();
+ if (this.TableBodyStyle != null)
+ {
+ tableBodyRG.Style = this.TableBodyStyle;
+ }
+ foreach (string[] rowAry in rowList)
+ {
+ TableRow tableBody = this.CreateTableRow(rowAry, aligns);
+ tableBodyRG.Rows.Add(tableBody);
+ }
+ table.RowGroups.Add(tableBodyRG);
+
+ return table;
+ }
+
+ public Block CreateHeader(int level, IEnumerable content)
+ {
+ if (content is null)
+ {
+ throw new ArgumentNullException(nameof(content));
+ }
+
+ Paragraph block = this.Create(content);
+
+ switch (level)
+ {
+ case 1:
+ if (this.Heading1Style != null)
+ {
+ block.Style = this.Heading1Style;
+ }
+ break;
+
+ case 2:
+ if (this.Heading2Style != null)
+ {
+ block.Style = this.Heading2Style;
+ }
+ break;
+
+ case 3:
+ if (this.Heading3Style != null)
+ {
+ block.Style = this.Heading3Style;
+ }
+ break;
+
+ case 4:
+ if (this.Heading4Style != null)
+ {
+ block.Style = this.Heading4Style;
+ }
+ break;
+ }
+
+ return block;
+ }
+
+ public IEnumerable DoTable(string text, Func> defaultHandler)
+ {
+ if (text is null)
+ {
+ throw new ArgumentNullException(nameof(text));
+ }
+
+ return this.Evaluate(text, table, this.TableEvalutor, defaultHandler);
+ }
+
+ public IEnumerable DoText(string text)
+ {
+ if (text is null)
+ {
+ throw new ArgumentNullException(nameof(text));
+ }
+
+ string[] lines = lbrk.Split(text);
+ bool first = true;
+ foreach (string line in lines)
+ {
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ yield return new LineBreak();
+ }
+
+ string t = eoln.Replace(line, " ");
+ yield return new Run(t);
+ }
+ }
+
+ public FlowDocument Transform(string text)
+ {
+ if (text is null)
+ {
+ throw new ArgumentNullException(nameof(text));
+ }
+
+ text = this.Normalize(text);
+ FlowDocument document = this.Create(this.RunBlockGamut(text));
+
+ if (this.DocumentStyle != null)
+ {
+ document.Style = this.DocumentStyle;
+ }
+ else
+ {
+ document.PagePadding = new Thickness(12);
+ }
+
+ return document;
+ }
+ }
+}
+
+#pragma warning restore 1591
\ No newline at end of file
diff --git a/Quartz.IDE/Quartz.IDE.csproj b/Quartz.IDE/Quartz.IDE.csproj
index 6117a95..e138aa5 100644
--- a/Quartz.IDE/Quartz.IDE.csproj
+++ b/Quartz.IDE/Quartz.IDE.csproj
@@ -4,8 +4,100 @@
WinExe
netcoreapp3.1
true
- 1.1.5.3
- 1.1.5.3
+ 1.2.1.364
+ 1.2.1.364
+ 8.0
+ Resources\Images\Quartz.ico
+ true
+ enable
+
+ C:\Users\david\Dropbox\Development\Visual Studio\Quartz\Quartz.IDE\Quartz.IDE.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+ All
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+