Beispiel #1
1
		public ScriptPlayer(String scriptFile, IGlobe globe)
		{
			System.Diagnostics.Debug.Assert(globe != null);
			System.Diagnostics.Debug.Assert(scriptFile != null);
			System.Diagnostics.Debug.Assert(!scriptFile.Equals(String.Empty));

			System.IO.FileInfo fi = new System.IO.FileInfo(scriptFile);
			if (!fi.Exists)
				throw new TimelineException("Specified script does not exist.");

			Script script = new Script(fi);
			System.Collections.IList atElements = script.AtElements;
			if (atElements == null || atElements.Count < 1)
				throw new TimelineException("Script file " + scriptFile
					+ " has no At elements.");

			this.globe = globe;
			this.timesToRepeat = script.RepeatCount;
			this.timelines = new Timelines(atElements);

			this.timer = new System.Timers.Timer(15);
			this.timer.AutoReset = true;
			this.timer.Elapsed += new System.Timers.ElapsedEventHandler(timerTickHandler);

			this.createPlayers();
		}
Beispiel #2
0
        public ScriptPlayer(String scriptFile, IGlobe globe)
        {
            System.Diagnostics.Debug.Assert(globe != null);
            System.Diagnostics.Debug.Assert(scriptFile != null);
            System.Diagnostics.Debug.Assert(!scriptFile.Equals(String.Empty));

            System.IO.FileInfo fi = new System.IO.FileInfo(scriptFile);
            if (!fi.Exists)
            {
                throw new TimelineException("Specified script does not exist.");
            }

            Script script = new Script(fi);

            System.Collections.IList atElements = script.AtElements;
            if (atElements == null || atElements.Count < 1)
            {
                throw new TimelineException("Script file " + scriptFile
                                            + " has no At elements.");
            }

            this.globe         = globe;
            this.timesToRepeat = script.RepeatCount;
            this.timelines     = new Timelines(atElements);

            this.timer           = new System.Timers.Timer(15);
            this.timer.AutoReset = true;
            this.timer.Elapsed  += new System.Timers.ElapsedEventHandler(timerTickHandler);

            this.createPlayers();
        }