Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
FootnoteReference.cs
1using System.Threading.Tasks;
4
6{
11 {
12 private readonly string key;
13 private bool autoExpand;
14
21 : base(Document)
22 {
23 this.key = Key;
24 this.autoExpand = false;
25 }
26
30 public string Key => this.key;
31
36 public bool AutoExpand
37 {
38 get => this.autoExpand;
39 internal set => this.autoExpand = value;
40 }
41
46 public override Task Render(IRenderer Output) => Output.Render(this);
47
49 public override string ToString()
50 {
51 return this.key;
52 }
53
57 public override bool InlineSpanElement
58 {
59 get
60 {
61 if (this.autoExpand && (this.Document?.TryGetFootnote(this.key, out Footnote Footnote) ?? false))
63 else
64 return true;
65 }
66 }
67
73 public override bool Equals(object obj)
74 {
75 return obj is FootnoteReference x &&
76 this.key == x.key &&
77 this.autoExpand == x.autoExpand &&
78 base.Equals(obj);
79 }
80
85 public override int GetHashCode()
86 {
87 int h1 = base.GetHashCode();
88 int h2 = this.key?.GetHashCode() ?? 0;
89 int h3 = this.autoExpand.GetHashCode();
90
91 h1 = ((h1 << 5) + h1) ^ h2;
92 h1 = ((h1 << 5) + h1) ^ h3;
93
94 return h1;
95 }
96
101 public override void IncrementStatistics(MarkdownStatistics Statistics)
102 {
103 Statistics.NrFootnoteReference++;
104 }
105 }
106}
Contains a markdown document. This markdown document class supports original markdown,...
Contains some basic statistical information about a Markdown document.
int NrFootnoteReference
Number of footnote references
override bool InlineSpanElement
If the element is an inline span element.
Definition: Footnote.cs:90
Abstract base class for all markdown elements.
MarkdownDocument Document
Markdown document.
override bool InlineSpanElement
If the element is an inline span element.
override int GetHashCode()
Serves as the default hash function.
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
bool AutoExpand
If the footnote should automatically be expanded when rendered, if format supports auto-expansion.
override Task Render(IRenderer Output)
Renders the element.
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
FootnoteReference(MarkdownDocument Document, string Key)
Footnote reference
Interface for Markdown renderers.
Definition: IRenderer.cs:12