Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
InlineText.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
5
7{
12 {
13 private string value;
14
21 : base(Document)
22 {
23 this.value = Value;
24 }
25
29 public string Value
30 {
31 get => this.value;
32 internal set => this.value = value;
33 }
34
39 public override Task Render(IRenderer Output) => Output.Render(this);
40
42 public override string ToString()
43 {
44 return this.value;
45 }
46
50 public override bool InlineSpanElement => true;
51
57 public override bool Equals(object obj)
58 {
59 return obj is InlineText x &&
60 this.value == x.value &&
61 base.Equals(obj);
62 }
63
68 public override int GetHashCode()
69 {
70 int h1 = base.GetHashCode();
71 int h2 = this.value?.GetHashCode() ?? 0;
72
73 h1 = ((h1 << 5) + h1) ^ h2;
74
75 return h1;
76 }
77
82 public IEnumerable<Atom> Atomize()
83 {
84 LinkedList<Atom> Result = new LinkedList<Atom>();
85
86 foreach (char ch in this.value)
87 Result.AddLast(new InlineTextCharacter(this.Document, this, ch));
88
89 return Result;
90 }
91
99 {
100 return new InlineText(Document, Text);
101 }
102
107 public override void IncrementStatistics(MarkdownStatistics Statistics)
108 {
109 Statistics.NrInlineText++;
110 }
111 }
112}
Contains a markdown document. This markdown document class supports original markdown,...
Contains some basic statistical information about a Markdown document.
Abstract base class for all markdown elements.
MarkdownDocument Document
Markdown document.
override Task Render(IRenderer Output)
Renders the element.
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
Definition: InlineText.cs:57
override bool InlineSpanElement
If the element is an inline span element.
Definition: InlineText.cs:50
override int GetHashCode()
Serves as the default hash function.
Definition: InlineText.cs:68
MarkdownElement Assemble(MarkdownDocument Document, string Text)
Assembles a markdown element from a sequence of atoms.
Definition: InlineText.cs:98
InlineText(MarkdownDocument Document, string Value)
Unformatted text.
Definition: InlineText.cs:20
override void IncrementStatistics(MarkdownStatistics Statistics)
Increments the property or properties in Statistics corresponding to the element.
Definition: InlineText.cs:107
IEnumerable< Atom > Atomize()
Return an enumeration of the editable text as atoms.
Definition: InlineText.cs:82
Interface for elements containing editable text.
Interface for Markdown renderers.
Definition: IRenderer.cs:12