public double GetWorkTime() { DateTime StampIn = new DateTime(); DateTime StampOut = new DateTime(); TimeSpan Timeperiod = new TimeSpan(); TimeSpan WorkTime = new TimeSpan(); if (Stamps.Count() > 2) { int i = 0; int i2 = 1; while (i2 < Stamps.Count()) { StampIn = Stamps[i].DateAndTime; StampOut = Stamps[i2].DateAndTime; Timeperiod = StampOut - StampIn; WorkTime = WorkTime + Timeperiod; i = i + 2; i2 = i2 + 2; } return(WorkTime.TotalHours); } else { return(TimeOfDay); } }
/// <summary> /// Initializes a new instance of the <see cref="T:CollectorBox"/> class. /// </summary> public TrackingCollectorBox() { stampsProperty = this.Create(() => Stamps, new ObservableCollection <CollectorStamp>()); //Although, logically it has no sense to set TrackItems() here, it's used //for comparison purposes. numStampsProperty = this.Create(() => NumStamps, () => Stamps.TrackItems().Count); }
public void AddStamp(DateTime stamp) { Stamps.Add(new DateTime(stamp.Year, stamp.Month, stamp.Day, stamp.Hour, stamp.Minute, stamp.Second)); // TotalHours will only change for even number of stamps if (0 == Stamps.Count % 2) { OnPropertyChanged(nameof(TotalHours)); } }
public double GetTimeOfDay() { DateTime StampCome = new DateTime(); DateTime StampGo = new DateTime(); TimeSpan TimeOfDay = new TimeSpan(); StampCome = Stamps[0].DateAndTime; StampGo = Stamps[Stamps.Count() - 1].DateAndTime; TimeOfDay = StampGo - StampCome; return(TimeOfDay.TotalHours); }
public string CreateStamp(DUETContext db, dynamic _stamp, dynamic _inspiration) { try { CurrentStamp = new Stamp(db, Id, _stamp, _inspiration); CurrentStamp.Save(db); Stamps.Add(CurrentStamp); return(CurrentStamp.CreateBitmap(db, this)); } catch (Exception exception) { return("Error 2: " + exception.Message); } }
public EditorChunks(TexturedStamps _StageStamps) { StageStamps = _StageStamps; EditorStamps = new Stamps(); AddBlankMap(); }
internal bool Contains(int stamp) { return(Stamps.Contains(stamp)); }
internal bool RemoveStamp(int stamp) { return(Stamps.Remove(stamp)); }
internal bool AddStamp(int stamp) { return(Stamps.Add(stamp)); }