Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Abbreviation.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
4
6{
11 {
12 private readonly string description;
13
20 public Abbreviation(MarkdownDocument Document, IEnumerable<MarkdownElement> ChildElements, string Description)
21 : base(Document, ChildElements)
22 {
23 this.description = Description;
24 }
25
29 public string Description => this.description;
30
35 public override Task Render(IRenderer Output) => Output.Render(this);
36
40 public override bool InlineSpanElement => true;
41
49 public override MarkdownElementChildren Create(IEnumerable<MarkdownElement> Children, MarkdownDocument Document)
50 {
51 return new Abbreviation(Document, Children, this.description);
52 }
53
60 public override bool SameMetaData(MarkdownElement E)
61 {
62 return E is Abbreviation x &&
63 x.description == this.description &&
64 base.SameMetaData(E);
65 }
66
72 public override bool Equals(object obj)
73 {
74 return obj is Abbreviation x &&
75 this.description == x.description &&
76 base.Equals(obj);
77 }
78
83 public override int GetHashCode()
84 {
85 int h1 = base.GetHashCode();
86 int h2 = this.description?.GetHashCode() ?? 0;
87
88 h1 = ((h1 << 5) + h1) ^ h2;
89
90 return h1;
91 }
92
97 public override void IncrementStatistics(MarkdownStatistics Statistics)
98 {
99 Statistics.NrAbbreviations++;
100 }
101 }
102}
Contains a markdown document. This markdown document class supports original markdown,...
Contains some basic statistical information about a Markdown document.
int NrAbbreviations
Number of abbreviations.
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.
override int GetHashCode()
Serves as the default hash function.
Definition: Abbreviation.cs:83
override bool InlineSpanElement
If the element is an inline span element.
Definition: Abbreviation.cs:40
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
Definition: Abbreviation.cs:72
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
Definition: Abbreviation.cs:97
override Task Render(IRenderer Output)
Renders the element.
Abbreviation(MarkdownDocument Document, IEnumerable< MarkdownElement > ChildElements, string Description)
Abbreviation
Definition: Abbreviation.cs:20
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: Abbreviation.cs:49
override bool SameMetaData(MarkdownElement E)
If the current object has same meta-data as E (but not necessarily same content).
Definition: Abbreviation.cs:60
Interface for Markdown renderers.
Definition: IRenderer.cs:12