Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Atom.cs
1using System;
2using System.Threading.Tasks;
4
6{
10 public abstract class Atom : MarkdownElement
11 {
12 private readonly IEditableText source;
13 private readonly char character;
14
19 : base(Document)
20 {
21 this.source = Source;
22 this.character = Character;
23 }
24
28 public char Charater => this.character;
29
33 public IEditableText Source => this.source;
34
38 public override bool InlineSpanElement => true;
39
44 public override Task Render(IRenderer Output)
45 {
46 throw new NotSupportedException("Atomic elements must be reassembled before being exported or used for output.");
47 }
48
54 public override bool Equals(object obj)
55 {
56 return obj is Atom x &&
57 this.character == x.character &&
58 base.Equals(obj);
59 }
60
65 public override int GetHashCode()
66 {
67 int h1 = this.character.GetHashCode();
68 int h2 = base.GetHashCode();
69
70 h1 = ((h1 << 5) + h1) ^ h2;
71
72 return h1;
73 }
74
75 }
76}
Contains a markdown document. This markdown document class supports original markdown,...
Represents an atom of editable text (i.e. typed character).
Definition: Atom.cs:11
override bool InlineSpanElement
If the element is an inline span element.
Definition: Atom.cs:38
IEditableText Source
Source
Definition: Atom.cs:33
override Task Render(IRenderer Output)
Renders the element.
Definition: Atom.cs:44
override int GetHashCode()
Serves as the default hash function.
Definition: Atom.cs:65
Atom(MarkdownDocument Document, IEditableText Source, char Character)
Represents an atom of editable text (i.e. typed character).
Definition: Atom.cs:18
override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
Definition: Atom.cs:54
Abstract base class for all markdown elements.
MarkdownDocument Document
Markdown document.
Interface for elements containing editable text.
Interface for Markdown renderers.
Definition: IRenderer.cs:12