示例#1
0
        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);
            }
        }
示例#2
0
        /// <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);
        }
示例#3
0
        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));
            }
        }
示例#4
0
        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);
        }
示例#5
0
        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);
            }
        }
示例#6
0
 public EditorChunks(TexturedStamps _StageStamps)
 {
     StageStamps  = _StageStamps;
     EditorStamps = new Stamps();
     AddBlankMap();
 }
示例#7
0
 internal bool Contains(int stamp)
 {
     return(Stamps.Contains(stamp));
 }
示例#8
0
 internal bool RemoveStamp(int stamp)
 {
     return(Stamps.Remove(stamp));
 }
示例#9
0
 internal bool AddStamp(int stamp)
 {
     return(Stamps.Add(stamp));
 }