Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EmojiReference.cs
1using System.Threading.Tasks;
4
6{
11 {
12 private readonly EmojiInfo emoji;
13 private readonly int level;
14 private readonly string delimiter;
15
22 : this(Document, Emoji, 1)
23 {
24 }
25
33 : base(Document)
34 {
35 this.emoji = Emoji;
36 this.level = Level;
37 this.delimiter = Level == 1 ? ":" : new string(':', Level);
38 }
39
43 public EmojiInfo Emoji => this.emoji;
44
48 public int Level => this.level;
49
53 public string Delimiter => this.delimiter;
54
59 public override Task Render(IRenderer Output) => Output.Render(this);
60
62 public override string ToString()
63 {
64 return this.delimiter + this.emoji.ShortName + this.delimiter;
65 }
66
70 public override bool OutsideParagraph => true;
71
75 public override bool InlineSpanElement => true;
76
82 public override bool Equals(object obj)
83 {
84 return obj is EmojiReference x &&
85 this.emoji.ShortName == x.emoji.ShortName &&
86 this.level == x.level &&
87 this.delimiter == x.delimiter &&
88 base.Equals(obj);
89 }
90
95 public override int GetHashCode()
96 {
97 int h1 = base.GetHashCode();
98 int h2 = this.emoji.ShortName.GetHashCode();
99
100 h1 = ((h1 << 5) + h1) ^ h2;
101 h2 = this.level.GetHashCode();
102
103 h1 = ((h1 << 5) + h1) ^ h2;
104 h2 = this.delimiter.GetHashCode();
105
106 h1 = ((h1 << 5) + h1) ^ h2;
107
108 return h1;
109 }
110
115 public override void IncrementStatistics(MarkdownStatistics Statistics)
116 {
117 Statistics.NrEmojiReference++;
118 }
119
120 }
121}
Contains information about an emoji.
Contains a markdown document. This markdown document class supports original markdown,...
Contains some basic statistical information about a Markdown document.
int NrEmojiReference
Number of emoji references.
Abstract base class for all markdown elements.
MarkdownDocument Document
Markdown document.
EmojiReference(MarkdownDocument Document, EmojiInfo Emoji, int Level)
Represents an Emoji.
override Task Render(IRenderer Output)
Renders the element.
string Delimiter
Delimiter string used to identify emoji.
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
override bool OutsideParagraph
If element, parsed as a span element, can stand outside of a paragraph if alone in it.
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
override int GetHashCode()
Serves as the default hash function.
EmojiReference(MarkdownDocument Document, EmojiInfo Emoji)
Represents an Emoji.
int Level
Level (number of colons used to define the emoji)
override bool InlineSpanElement
If the element is an inline span element.
Interface for Markdown renderers.
Definition: IRenderer.cs:12