async Task ExecuteLoadItemsCommand() { if (IsBusy || !IsLoggedIn) { return; } IsBusy = true; try { Datapoints.Clear(); var items = await DataStore.GetItemsAsync(true); foreach (var item in items) { var _item = new Datapoint() { Category = item.Category, TextFromAudio = item.TextFromAudio ?? "!null!", Datetime = item.Datetime }; Datapoints.Add(_item); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
/// <summary> /// Returns true if ItemHistoryDTO instances are equal /// </summary> /// <param name="input">Instance of ItemHistoryDTO to be compared</param> /// <returns>Boolean</returns> public bool Equals(ItemHistoryDTO input) { if (input == null) { return(false); } return (( Name == input.Name || (Name != null && Name.Equals(input.Name)) ) && ( Totalrecords == input.Totalrecords || (Totalrecords != null && Totalrecords.Equals(input.Totalrecords)) ) && ( Datapoints == input.Datapoints || (Datapoints != null && Datapoints.Equals(input.Datapoints)) ) && ( Data == input.Data || Data != null && Data.SequenceEqual(input.Data) )); }
public SearchItemDTO(string uniqueid, string alias, bool required, string[] datapoints, string raw) { this.UniqueID = uniqueid; this.Required = required; this.Datapoints = datapoints; this.Raw = raw; int missingcount = Datapoints.Where(x => string.IsNullOrEmpty(x)).Count(); int totalcount = Datapoints.Count(); this.PctMissing = (((double)missingcount) / ((double)totalcount)) * 100;; this.Alias = alias; }
public bool Equals(Series input) { if (input == null) { return(false); } return (( Datapoints == input.Datapoints || (Datapoints != null && Datapoints.SequenceEqual(input.Datapoints)) ) && ( Target == input.Target || (Target != null && Target.Equals(input.Target)) )); }
public void Update(Series?other) { if (other is null) { return; } if (!Datapoints.DeepEqualsList(other.Datapoints)) { Datapoints = other.Datapoints; OnPropertyChanged(nameof(Datapoints)); } if (Target != other.Target) { Target = other.Target; OnPropertyChanged(nameof(Target)); } }
public void UpdateFromXMLAPI(IEnumerable <XMLAPI.StateList.Datapoint> list) { foreach (var cgi_dp in list) { string type = Datapoint.MapDatapointType(cgi_dp, this); Datapoint dp = null; if (Datapoints.TryGetValue(type, out dp)) { dp.UpdateFromXMLAPI(cgi_dp); } else { dp = new Datapoint(cgi_dp, this); Datapoints.Add(type, dp); } } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (Totalrecords != null) { hashCode = hashCode * 59 + Totalrecords.GetHashCode(); } if (Datapoints != null) { hashCode = hashCode * 59 + Datapoints.GetHashCode(); } if (Data != null) { hashCode = hashCode * 59 + Data.GetHashCode(); } return(hashCode); } }
public bool DeepEquals(Series?other) { return(other is not null && Datapoints.DeepEqualsList(other.Datapoints) && Target == other.Target); }