2using System.Collections.Generic;
3using System.Threading.Tasks;
12 private readonly List<DocumentInformation> documents =
new List<DocumentInformation>();
13 private readonly
string source;
15 private string firstText =
null;
16 private int nrDocuments = 0;
17 private readonly
bool isDefault;
45 if (!(this.firstText is
null))
46 return this.firstText;
54 return this.firstText;
66 if (this.documents.Count == 0)
69 return this.documents[0];
83 return this.documents.ToArray();
100 this.documents.Add(Info);
103 if (this.nrDocuments == 1)
104 this.type = Info.
Type;
120 if (
string.IsNullOrEmpty(Id))
121 return await this.
Add(Markdown, Id);
127 lock (this.documents)
129 c = this.documents.Count;
130 for (i = 0; i < c; i++)
132 Info2 = this.documents[i];
135 this.documents[i] = Info;
137 if (this.nrDocuments == 1)
138 this.type = Info.
Type;
144 this.documents.Add(Info);
147 if (this.nrDocuments == 1)
148 this.type = Info.
Type;
Information about a document.
DocumentType Type
Document type.
MarkdownDocument Markdown
Markdown document.
static async Task< DocumentInformation > CreateAsync(MarkdownDocument Markdown, string Id)
Information about a document.
Maintains the state of one source.
DocumentInformation[] Documents
Available documents from source.
SourceState(string Source, bool IsDefault)
Maintains the state of one source.
async Task< string > GetFirstText()
First document text.
DocumentInformation FirstDocument
First document.
async Task< DocumentType > Add(MarkdownDocument Markdown, string Id)
Adds a markdown document from the source.
async Task< DocumentType > Update(MarkdownDocument Markdown, string Id)
Updates a markdown document from the source. If not found, it is added.
bool IsDefault
If the content is default content (true), or reported content (false).
Contains a markdown document. This markdown document class supports original markdown,...
Task< string > GenerateMarkdown()
Generates Markdown from the markdown text.
DocumentType
Type of markdown document.