Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
SectionSeparator.cs
1using System.Threading.Tasks;
3
5{
10 {
11 private readonly string row;
12 private readonly int sectionNr;
13 private readonly int nrColumns;
14
23 : base(Document)
24 {
25 this.sectionNr = SectionNr;
26 this.nrColumns = NrColumns;
27 this.row = Row;
28 }
29
33 public int SectionNr => this.sectionNr;
34
38 public int NrColumns => this.nrColumns;
39
43 public string Row => this.row;
44
49 public override Task Render(IRenderer Output) => Output.Render(this);
50
54 public override bool InlineSpanElement => false;
55
62 public override bool SameMetaData(MarkdownElement E)
63 {
64 return E is SectionSeparator x &&
65 this.nrColumns == x.nrColumns &&
66 this.sectionNr == x.sectionNr &&
67 this.row == x.row &&
68 base.SameMetaData(E);
69 }
70
76 public override bool Equals(object obj)
77 {
78 return obj is SectionSeparator x &&
79 this.nrColumns == x.nrColumns &&
80 this.sectionNr == x.sectionNr &&
81 this.row == x.row &&
82 base.Equals(obj);
83 }
84
89 public override int GetHashCode()
90 {
91 int h1 = base.GetHashCode();
92 int h2 = this.row?.GetHashCode() ?? 0;
93
94 h1 = ((h1 << 5) + h1) ^ h2;
95 h2 = this.nrColumns.GetHashCode();
96
97 h1 = ((h1 << 5) + h1) ^ h2;
98 h2 = this.sectionNr.GetHashCode();
99
100 h1 = ((h1 << 5) + h1) ^ h2;
101
102 return h1;
103 }
104
109 public override void IncrementStatistics(MarkdownStatistics Statistics)
110 {
111 Statistics.NrSectionSeparators++;
112 }
113
114 }
115}
Contains a markdown document. This markdown document class supports original markdown,...
Contains some basic statistical information about a Markdown document.
int NrSectionSeparators
Number of section separators.
Abstract base class for block elements.
Definition: BlockElement.cs:7
override bool SameMetaData(MarkdownElement E)
If the current object has same meta-data as E (but not necessarily same content).
override bool InlineSpanElement
If the element is an inline span element.
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
override Task Render(IRenderer Output)
Renders the element.
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
int NrColumns
Number of columns in following section.
override int GetHashCode()
Serves as the default hash function.
SectionSeparator(MarkdownDocument Document, int SectionNr, int NrColumns, string Row)
Section Separator
Abstract base class for all markdown elements.
MarkdownDocument Document
Markdown document.
Interface for Markdown renderers.
Definition: IRenderer.cs:12