~dangarner/xibo/client-170alpha

« back to all changes in this revision

Viewing changes to client/dotNET/Logic/ScheduleManager.cs

  • Committer: Dan Garner
  • Date: 2014-09-15 16:58:36 UTC
  • Revision ID: dan@xibo.org.uk-20140915165836-53jxipmlj2zsgqes
[dotnetclient] Logic for sending a screenshot on a timer. Class for immediate send (intended to use from RF).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Xibo - Digitial Signage - http://www.xibo.org.uk
3
 
 * Copyright (C) 2006-2012 Daniel Garner
 
3
 * Copyright (C) 2006-2014 Daniel Garner
4
4
 *
5
5
 * This file is part of Xibo.
6
6
 *
29
29
using System.Diagnostics;
30
30
using XiboClient.Log;
31
31
using System.Threading;
 
32
using XiboClient.Logic;
32
33
 
33
34
/// 17/02/12 Dan Added a static method to get the schedule XML from disk into a string and to write it to the disk
34
35
/// 20/02/12 Dan Tweaked log types on a few trace messages
61
62
        private Collection<LayoutSchedule> _currentSchedule;
62
63
        private bool _refreshSchedule;
63
64
        private CacheManager _cacheManager;
 
65
        private DateTime _lastScreenShotDate;
64
66
 
65
67
        /// <summary>
66
68
        /// Client Info Form
86
88
            // Create an empty layout schedule
87
89
            _layoutSchedule = new Collection<LayoutSchedule>();
88
90
            _currentSchedule = new Collection<LayoutSchedule>();
 
91
 
 
92
            _lastScreenShotDate = DateTime.MinValue;
89
93
        }
90
94
 
91
95
        #endregion
166
170
 
167
171
                        // Update the client info form
168
172
                        _clientInfoForm.ScheduleManagerStatus = LayoutsInSchedule();
 
173
 
 
174
                        // Do we need to take a screenshot?
 
175
                        if (ApplicationSettings.Default.ScreenShotRequestInterval > 0 && DateTime.Now > _lastScreenShotDate.AddMinutes(ApplicationSettings.Default.ScreenShotRequestInterval))
 
176
                        {
 
177
                            // Take a screen shot and send it
 
178
                            ScreenShot.Take();
 
179
 
 
180
                            // Store the date
 
181
                            _lastScreenShotDate = DateTime.Now;
 
182
                        }
169
183
                    }
170
184
                    catch (Exception ex)
171
185
                    {