Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Sections.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
4
6{
11 {
12 private readonly string initialRow;
13 private readonly int initialNrColumns;
14
22 public Sections(MarkdownDocument Document, int InitialNrColumns, string InitialRow, IEnumerable<MarkdownElement> Children)
23 : base(Document, Children)
24 {
25 this.initialRow = InitialRow;
26 this.initialNrColumns = InitialNrColumns;
27 }
28
32 public int InitialNrColumns => this.initialNrColumns;
33
37 public string InitialRow => this.initialRow;
38
43 public override Task Render(IRenderer Output) => Output.Render(this);
44
48 public override bool InlineSpanElement => false;
49
57 public override MarkdownElementChildren Create(IEnumerable<MarkdownElement> Children, MarkdownDocument Document)
58 {
59 return new Sections(Document, this.initialNrColumns, this.initialRow, Children);
60 }
61
68 public override bool SameMetaData(MarkdownElement E)
69 {
70 return E is Sections x &&
71 x.initialNrColumns == this.initialNrColumns &&
72 x.initialRow == this.initialRow &&
73 base.SameMetaData(E);
74 }
75
81 public override bool Equals(object obj)
82 {
83 return obj is Sections x &&
84 this.initialNrColumns == x.initialNrColumns &&
85 this.initialRow == x.initialRow &&
86 base.Equals(obj);
87 }
88
93 public override int GetHashCode()
94 {
95 int h1 = base.GetHashCode();
96 int h2 = this.initialNrColumns.GetHashCode();
97
98 h1 = ((h1 << 5) + h1) ^ h2;
99 h2 = this.initialRow?.GetHashCode() ?? 0;
100
101 h1 = ((h1 << 5) + h1) ^ h2;
102
103 return h1;
104 }
105
110 public override void IncrementStatistics(MarkdownStatistics Statistics)
111 {
112 Statistics.NrSections++;
113 }
114
115 }
116}
Contains a markdown document. This markdown document class supports original markdown,...
Contains some basic statistical information about a Markdown document.
Abstract base class for block elements with children.
Represents a sequence of sections.
Definition: Sections.cs:11
override MarkdownElementChildren Create(IEnumerable< MarkdownElement > Children, MarkdownDocument Document)
Creates an object of the same type, and meta-data, as the current object, but with content defined by...
Definition: Sections.cs:57
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
Definition: Sections.cs:81
override int GetHashCode()
Serves as the default hash function.
Definition: Sections.cs:93
override bool InlineSpanElement
If the element is an inline span element.
Definition: Sections.cs:48
Sections(MarkdownDocument Document, int InitialNrColumns, string InitialRow, IEnumerable< MarkdownElement > Children)
Represents a sequence of sections.
Definition: Sections.cs:22
override bool SameMetaData(MarkdownElement E)
If the current object has same meta-data as E (but not necessarily same content).
Definition: Sections.cs:68
override Task Render(IRenderer Output)
Renders the element.
int InitialNrColumns
Number of columns for initial section.
Definition: Sections.cs:32
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
Definition: Sections.cs:110
Abstract base class for all markdown elements with a variable number of child elements.
override IEnumerable< MarkdownElement > Children
Any children of the element.
Abstract base class for all markdown elements.
MarkdownDocument Document
Markdown document.
Interface for Markdown renderers.
Definition: IRenderer.cs:12