Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Footnote.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
4
6{
11 {
12 private readonly string key;
13 private bool referenced;
14 private bool tableCellContents;
15 private bool backlinkAdded;
16
23 public Footnote(MarkdownDocument Document, string Key, IEnumerable<MarkdownElement> Children)
24 : base(Document, Children)
25 {
26 this.key = Key;
27 }
28
36 : base(Document, Children)
37 {
38 this.key = Key;
39 }
40
44 public string Key => this.key;
45
50 public bool Referenced
51 {
52 get => this.referenced;
53 set => this.referenced = value;
54 }
55
59 internal bool TableCellContents
60 {
61 get => this.tableCellContents;
62 set => this.tableCellContents = value;
63 }
64
68 public bool BacklinkAdded
69 {
70 get => this.backlinkAdded;
71 set => this.backlinkAdded = value;
72 }
73
78 public override Task Render(IRenderer Output) => Output.Render(this);
79
81 public override string ToString()
82 {
83 return this.key;
84 }
85
89 public override bool InlineSpanElement
90 {
91 get
92 {
93 if (this.HasOneChild)
94 return this.FirstChild.InlineSpanElement;
95 else
96 return false;
97 }
98 }
99
107 public override MarkdownElementChildren Create(IEnumerable<MarkdownElement> Children, MarkdownDocument Document)
108 {
109 return new Footnote(Document, this.key, Children);
110 }
111
118 public override bool SameMetaData(MarkdownElement E)
119 {
120 return E is Footnote x &&
121 x.key == this.key &&
122 base.SameMetaData(E);
123 }
124
130 public override bool Equals(object obj)
131 {
132 return obj is Footnote x &&
133 this.key == x.key &&
134 base.Equals(obj);
135 }
136
141 public override int GetHashCode()
142 {
143 int h1 = base.GetHashCode();
144 int h2 = this.key?.GetHashCode() ?? 0;
145
146 h1 = ((h1 << 5) + h1) ^ h2;
147
148 return h1;
149 }
150
155 public override void IncrementStatistics(MarkdownStatistics Statistics)
156 {
157 Statistics.NrFootnotes++;
158 }
159
160 }
161}
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.
override Task Render(IRenderer Output)
Renders the element.
Footnote(MarkdownDocument Document, string Key, IEnumerable< MarkdownElement > Children)
Footnote reference
Definition: Footnote.cs:23
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: Footnote.cs:107
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
Definition: Footnote.cs:130
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
Definition: Footnote.cs:155
bool Referenced
If the Footnote has been referenced during rendering, and therefore needs to be shown at the end of t...
Definition: Footnote.cs:51
Footnote(MarkdownDocument Document, string Key, params MarkdownElement[] Children)
Footnote reference
Definition: Footnote.cs:35
override int GetHashCode()
Serves as the default hash function.
Definition: Footnote.cs:141
override bool InlineSpanElement
If the element is an inline span element.
Definition: Footnote.cs:90
override bool SameMetaData(MarkdownElement E)
If the current object has same meta-data as E (but not necessarily same content).
Definition: Footnote.cs:118
bool BacklinkAdded
If a backlink has been added to the footnote.
Definition: Footnote.cs:69
Abstract base class for all markdown elements with a variable number of child elements.
override IEnumerable< MarkdownElement > Children
Any children of the element.
bool HasOneChild
If the element has only one child.
MarkdownElement FirstChild
First child, or null if none.
Abstract base class for all markdown elements.
abstract bool InlineSpanElement
If the element is an inline span element.
MarkdownDocument Document
Markdown document.
Interface for Markdown renderers.
Definition: IRenderer.cs:12