示例#1
0
        private void Initialize(string message, string title)
        {
            this.Message = message;
            this.Title   = title;

            this.ViewPort       = ViewPortFactory.GetViewPort(this.Message);
            this.displayStarted = DateTime.Now;
        }
示例#2
0
        public override void Reset()
        {
            this.ViewPort = ViewPortFactory.GetViewPort(this.Message);

            if (this.ViewPort is StaticViewPort)
            {
                this.displayStarted = DateTime.Now;
            }
        }
        private void Initialize(string timeFormat, string title)
        {
            this.Title = title;

            this.TimeFormat = timeFormat;

            this.timeToDisplay = null;

            this.ViewPort = ViewPortFactory.GetViewPort(DateTime.Now.ToString(this.TimeFormat));

            this.displayStart = DateTime.Now;
        }
        public TimeDisplayAdapter(string timeFormat, string title)
        {
            this.Title = title;

            this.TimeFormat = timeFormat;

            this.timeToDisplay = null;

            this.ViewPort = ViewPortFactory.GetViewPort(DateTime.Now.ToString(this.TimeFormat));

            this.displayStart = DateTime.Now;
        }
示例#5
0
        private void Initialize(DateTime targetDateTime, string timeSpanFormat, string title)
        {
            this.Target         = targetDateTime;
            this.TimeSpanFormat = timeSpanFormat;
            this.Title          = title;

            this.displayStarted = DateTime.Now;

            var message = this.GetMessage();

            this.ViewPort = ViewPortFactory.GetViewPort(message);
        }
        public override void Draw(HidDevice device, byte brightness)
        {
            if (this.timeToDisplay == null || (DateTime.Now - this.timeToDisplay.Value).Seconds > 0)
            {
                this.timeToDisplay = DateTime.Now;

                var offset = this.ViewPort.Offset;

                this.ViewPort = ViewPortFactory.GetViewPort(this.timeToDisplay.Value.ToString(this.TimeFormat));

                this.ViewPort.Offset = offset;
            }

            this.ViewPort.DisplayString(device, brightness);
        }