Example #1
0
        public Event_Rep(
            int eventID,
            DateTime startTime,
            DateTime endTime,
            string keyframePath,
            string comment,
            bool loadImage)
        {
            this.eventID       = eventID;
            this.startTime     = startTime;
            this.endTime       = endTime;
            this.eventDuration = endTime - startTime;
            this.comment       = comment;
            this.shortComment  = GetStringStart(comment, 15);
            this.keyframePath  = keyframePath;
            this.borderColour  = DefaultKeyframeBorderColour;

            //format time string for UI
            if (startTime.Hour < 12)
            {
                this.strTime = startTime.ToShortTimeString() + " am";
            }
            else
            {
                this.strTime = startTime.ToShortTimeString() + " pm";
            }
            this.eventLength = Daily_Annotation_Summary.SecondsToString(
                (int)eventDuration.TotalSeconds);

            if (loadImage)
            {
                this.keyframeSource = Image_Rep.GetImgBitmap(keyframePath, false);
            }
        }