public void DataLoadLogAdd(string entry) { DataLogEntry t = default(DataLogEntry); if (entry != null) { t.Label = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:HH: mm:ss}", System.DateTime.Now); t.Text = entry; //lock (this) //{ // currentIndex += 1; // if (currentIndex > maxCount) { currentIndex = 0; } //if (DataLoadLog.Count <= maxCount) //{ // Add if not full yet DataLoadLog.Insert(0, t); //} //else //{ // // Replace if full // DataLoadLog[currentIndex] = t; //} //} } }
/// <summary>Builds a data log entry.</summary> /// <param name="argEntryText">The argument entry text.</param> /// <returns> /// <br /> /// </returns> private DataLogEntry BuildDataLogEntry(string argEntryText) { DataLogEntry t = default(DataLogEntry); t.Label = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:HH: mm:ss}", DateTime.Now).Trim(); t.Text = argEntryText.Trim(); return(t); }
private async Task <bool> DataLoadLogAdd(string entry) { await MainThread.InvokeOnMainThreadAsync(() => { DataLogEntry t = default(DataLogEntry); if (!string.IsNullOrEmpty(entry)) { t.Label = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:HH: mm:ss}", System.DateTime.Now); t.Text = entry; DataLoadLog.Insert(0, t); } }); return(true); }