public void Update() { IEnumerable <T> logs = readed; if (logs == null) { return; } var now = DateTime.UtcNow; var nextday = TimeTo.AddDays(1); #pragma warning disable CC0014 // Use ternary operator if (SelectedTimeRange != null) #pragma warning restore CC0014 // Use ternary operator { logs = logs.Where(x => now - x.DateTime <= SelectedTimeRange); } else { logs = logs.Where(x => x.DateTime.ToLocalTime() >= TimeFrom && x.DateTime.ToLocalTime() <= nextday); } foreach (var column in Columns) { logs = logs.Where(column.Selector); } Displayed = logs.ToArray(); }
protected override void AssignParameters(Request BloombergRequest) { if (listOfSecurities != null) { foreach (string security in listOfSecurities) { BloombergRequest.Append("securities", security); } } BloombergRequest.Set("periodicitySelection", Periodicity); BloombergRequest.Set("startDate", TimeFrom.ToString("yyyyMMdd")); BloombergRequest.Set("endDate", TimeTo.ToString("yyyyMMdd")); }
public string GetTimeDisplay() { if (TimeFrom.Date == DateTime.Now.Date) { return(TimeFrom.ToString("HH:mm")); } if (TimeFrom.Year != DateTime.Now.Year) { return(TimeTo.ToString("dd-MM-yyyy HH:mm")); } else { return(TimeTo.ToString("HH:mm")); } }
public override int GetHashCode() { int hashResult = TimeFrom.GetHashCode(); hashResult ^= TimeTo.GetHashCode(); hashResult ^= IsAppointmentOnly.GetHashCode(); if (PredefinedCommentTypes != null) { foreach (CommentType predefinedCommentType in PredefinedCommentTypes) { hashResult ^= predefinedCommentType.GetHashCode(); } } return(hashResult); }
public string GetTimeInterval(DateTime?eveningTime) { var timeFrom = DayShift_TC == DayShifts.Evening && eveningTime.HasValue ? eveningTime.Value : TimeFrom; return(timeFrom.ToShortTimeString() + "-" + TimeTo.ToShortTimeString()); }
public string ToJson() { return($@"{{""job"":""{Job}"",""zone"":""{Zone}"",""aetheryte"":""{Aetheryte}"",""from"":""{TimeFrom.ToString(@"hh\:mm")}"",""to"":""{TimeTo.ToString(@"hh\:mm")}"",""position"":""{Position}"",""name"":""{Name}""}}"); }
public override int GetHashCode() { return((Job + TimeFrom + Zone + Aetheryte + TimeFrom.ToString(@"hh\:mm") + TimeTo.ToString(@"hh\:mm") + Position + Name).GetHashCode()); }