4using System.Threading.Tasks;
15 private DateTime lastUpdate = DateTime.Now;
16 private readonly DateTime created;
17 private FileStream fs;
18 private readonly
string fileName;
19 private readonly
bool onlySelectedCollections;
20 private readonly Array selectedCollections;
35 this.onlySelectedCollections = OnlySelectedCollections;
36 this.selectedCollections = SelectedCollections;
46 if (this.onlySelectedCollections)
48 int i, c = this.selectedCollections.Length;
49 string[] Result =
new string[c];
51 for (i = 0; i < c; i++)
52 Result[i] = this.selectedCollections.GetValue(i).ToString();
76 if (!(this.fs is
null))
93 return !this.onlySelectedCollections || Array.IndexOf(this.selectedCollections, CollectionName) >= 0;
106 public abstract Task<bool>
End();
220 public abstract Task<string>
StartObject(
string ObjectId,
string TypeName);
234 public abstract Task<bool>
ReportProperty(
string PropertyName,
object PropertyValue);
277 DateTime TP = DateTime.Now;
279 if (ForceUpdate || (TP - this.lastUpdate).TotalSeconds >= 1)
281 this.lastUpdate = TP;
285 return Task.FromResult(
true);
296 StringBuilder sb =
new StringBuilder();
298 sb.Append(
"{\"fileName\":\"");
300 sb.Append(
"\", \"size\": \"");
303 sb.Append(
"\", \"created\": \"");
305 sb.Append(
"\", \"button\": \"");
307 sb.Append(
"\", \"isKey\": ");
308 sb.Append(
FileName.EndsWith(
".key", StringComparison.CurrentCultureIgnoreCase) ?
"true" :
"false");
322 StringBuilder sb =
new StringBuilder();
324 sb.Append(
"{\"fileName\":\"");
Helps with parsing of commong data types.
static string JsonStringEncode(string s)
Encodes a string for inclusion in JSON.
The ClientEvents class allows applications to push information asynchronously to web clients connecte...
static string[] GetTabIDsForLocation(string Location)
Gets the Tab IDs of all tabs that display a particular resource.
static Task< int > PushEvent(string[] TabIDs, string Type, object Data)
Puses an event to a set of Tabs, given their Tab IDs.
Static class managing data export.
static string FormatBytes(double Bytes)
Formats a file size using appropriate unit.
EntryType
Ledger entry type.