~dangarner/xibo/108-client

« back to all changes in this revision

Viewing changes to client/dotNET/Schedule.cs

  • Committer: Daniel Garner
  • Date: 2009-12-31 11:16:07 UTC
  • mfrom: (81.1.12 105-client-test)
  • Revision ID: dan@xibo.org.uk-20091231111607-b547kt1lm9jtlczk
MergedĀ lp:~dangarner/xibo/105-client-test

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
using System.Text;
26
26
using System.Windows.Forms;
27
27
using System.Xml;
 
28
using System.Xml.Serialization;
 
29
using System.Diagnostics;
28
30
 
29
31
namespace XiboClient
30
32
{
55
57
        /// Create a schedule
56
58
        /// </summary>
57
59
        /// <param name="scheduleLocation"></param>
58
 
        public Schedule(string scheduleLocation)
 
60
        public Schedule(string scheduleLocation, ref CacheManager cacheManager)
59
61
        {
60
62
            // Save the schedule location
61
63
            this.scheduleLocation = scheduleLocation;
63
65
            // Create a new collection for the layouts in the schedule
64
66
            layoutSchedule = new Collection<LayoutSchedule>();
65
67
            
66
 
            // Create a new cache manager
67
 
            _cacheManager = new CacheManager();
 
68
            // Set cachemanager
 
69
            _cacheManager = cacheManager;
68
70
 
69
71
            // Create a new Xmds service object
70
72
            xmds2 = new XiboClient.xmds.xmds();
119
121
 
120
122
            if (e.Error != null)
121
123
            {
122
 
                //There was an error - what do we do?
123
 
                System.Diagnostics.Trace.WriteLine(e.Error.Message);
 
124
                // There was an error - what do we do?
 
125
                System.Diagnostics.Trace.WriteLine(new LogMessage("Schedule - RequiredFilesCompleted", e.Error.Message), LogType.Error.ToString());
124
126
 
125
127
                // Is it a "not licensed" error
126
128
                if (e.Error.Message == "This display client is not licensed")
158
160
                    xmdsProcessing = false;
159
161
 
160
162
                    // Log and move on
161
 
                    System.Diagnostics.Debug.WriteLine("Error Comparing and Collecting", "Schedule - RequiredFilesCompleted");
162
 
                    System.Diagnostics.Debug.WriteLine(ex.Message, "Schedule - RequiredFilesCompleted");
 
163
                    System.Diagnostics.Trace.WriteLine(new LogMessage("Schedule - RequiredFilesCompleted", "Error Comparing and Collecting: " + ex.Message), LogType.Error.ToString());
163
164
                }
 
165
 
 
166
                _cacheManager.WriteCacheManager();
164
167
            }
165
168
        }
166
169
 
298
301
 
299
302
            if (layoutSchedule.Count == 1 && !forceChange)
300
303
            {
301
 
                //dont bother raising the event, just keep on this until the schedule gets changed
302
 
                return;
 
304
                Debug.WriteLine(new LogMessage("Schedule - NextLayout", "Only 1 layout showing, refreshing it"), LogType.Info.ToString());
303
305
            }
304
306
 
305
307
            System.Diagnostics.Debug.WriteLine(String.Format("Next layout: {0}", layoutSchedule[currentLayout].layoutFile), "Schedule - Next Layout");