Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NumberedItem.cs
1using System.Threading.Tasks;
3
5{
10 {
11 private int number;
12 private readonly bool numberExplicit;
13
22 : base(Document, Child)
23 {
24 this.number = Number;
25 this.numberExplicit = NumberExplicit;
26 }
27
31 public int Number
32 {
33 get => this.number;
34 internal set => this.number = value;
35 }
36
40 public bool NumberExplicit => this.numberExplicit;
41
46 public override Task Render(IRenderer Output) => Output.Render(this);
47
51 public override bool InlineSpanElement => this.Child.InlineSpanElement;
52
61 {
62 return new NumberedItem(Document, this.number, this.numberExplicit, Child);
63 }
64
71 public override bool SameMetaData(MarkdownElement E)
72 {
73 return E is NumberedItem x &&
74 x.number == this.number &&
75 x.numberExplicit == this.numberExplicit &&
76 base.SameMetaData(E);
77 }
78
84 public override bool Equals(object obj)
85 {
86 return obj is NumberedItem x &&
87 this.number == x.number &&
88 this.numberExplicit == x.numberExplicit &&
89 base.Equals(obj);
90 }
91
96 public override int GetHashCode()
97 {
98 int h1 = base.GetHashCode();
99 int h2 = this.number.GetHashCode();
100 int h3 = this.numberExplicit.GetHashCode();
101
102 h1 = ((h1 << 5) + h1) ^ h2;
103 h1 = ((h1 << 5) + h1) ^ h3;
104
105 return h1;
106 }
107
112 public override void IncrementStatistics(MarkdownStatistics Statistics)
113 {
114 Statistics.NrNumberedItems++;
115 Statistics.NrListItems++;
116 }
117
118 }
119}
Contains a markdown document. This markdown document class supports original markdown,...
Contains some basic statistical information about a Markdown document.
int NrNumberedItems
Number of numbered items.
int NrListItems
Number of list items (total).
Abstract base class for block elements with one child.
Represents a numbered item in an ordered list.
Definition: NumberedItem.cs:10
override bool InlineSpanElement
If the element is an inline span element.
Definition: NumberedItem.cs:51
override MarkdownElementSingleChild Create(MarkdownElement Child, MarkdownDocument Document)
Creates an object of the same type, and meta-data, as the current object, but with content defined by...
Definition: NumberedItem.cs:60
bool NumberExplicit
If number is explicitly provided (true) or inferred (false).
Definition: NumberedItem.cs:40
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
Definition: NumberedItem.cs:84
override bool SameMetaData(MarkdownElement E)
If the current object has same meta-data as E (but not necessarily same content).
Definition: NumberedItem.cs:71
NumberedItem(MarkdownDocument Document, int Number, bool NumberExplicit, MarkdownElement Child)
Represents a numbered item in an ordered list.
Definition: NumberedItem.cs:21
override int GetHashCode()
Serves as the default hash function.
Definition: NumberedItem.cs:96
override Task Render(IRenderer Output)
Renders the element.
Abstract base class for all markdown elements.
abstract bool InlineSpanElement
If the element is an inline span element.
MarkdownDocument Document
Markdown document.
Abstract base class for all markdown elements with one child element.
Interface for Markdown renderers.
Definition: IRenderer.cs:12