Esempio n. 1
0
        void engine_ScriptMessageSent(object sender, RoomieThreadEventArgs eventArgs)
        {
            var builder = new StringBuilder();

            lock (this)
            {
                var now = DateTime.Now;
                var timeSinceLastTimestamp = now.Subtract(_lastTimestamp);
                if (timeSinceLastTimestamp >= timeStampInterval)
                {
                    builder.AppendLine();
                    builder.AppendLine(now + ":");
                    _lastTimestamp = now;
                }

                if (_lastThread == null || _lastThread != eventArgs.Thread)
                {
                    builder.AppendLine();//extra line break

                    builder.Append(eventArgs.Thread.Name);
                    builder.Append(":");
                    builder.Append(Environment.NewLine);

                    builder.Append("--------------------");
                    builder.AppendLine();
                }
                builder.Append(eventArgs.Message);
                builder.AppendLine();

                _lastThread = eventArgs.Thread;
            }

            output.Write(builder.ToString());
            output.Flush();
        }
Esempio n. 2
0
        void engine_ScriptMessageSent(object sender, RoomieThreadEventArgs eventArgs)
        {
            var builder = new StringBuilder();
            lock (this)
            {
                var now = DateTime.Now;
                var timeSinceLastTimestamp = now.Subtract(_lastTimestamp);
                if (timeSinceLastTimestamp >= timeStampInterval)
                {
                    builder.AppendLine();
                    builder.AppendLine(now + ":");
                    _lastTimestamp = now;
                }

                if (_lastThread == null || _lastThread != eventArgs.Thread)
                {
                    builder.AppendLine();//extra line break

                    builder.Append(eventArgs.Thread.Name);
                    builder.Append(":");
                    builder.Append(Environment.NewLine);

                    builder.Append("--------------------");
                    builder.AppendLine();

                }
                builder.Append(eventArgs.Message);
                builder.AppendLine();

                _lastThread = eventArgs.Thread;
            }

            output.Write(builder.ToString());
            output.Flush();
        }
Esempio n. 3
0
        internal RoomieCommandInterpreter(RoomieThread parentThread, HierarchicalVariableScope parentScope)
        {
            ParentThread = parentThread;
            Scope        = parentScope.CreateLowerScope();

            CommandQueue = new ScriptCommandList();
            IsBusy       = false;
        }
Esempio n. 4
0
        internal RoomieCommandInterpreter(RoomieThread parentThread, HierarchicalVariableScope parentScope)
        {
            ParentThread = parentThread;
            Scope = parentScope.CreateLowerScope();

            CommandQueue = new ScriptCommandList();
            IsBusy = false;
        }
Esempio n. 5
0
        internal void SimpleOutputText(RoomieThread thread, string message)
        {
            if (ScriptMessageSent == null)
            {
                throw new Exception("nothing is listening to the engine's output messages!");
            }

            ScriptMessageSent(this, new RoomieThreadEventArgs(thread, message));
        }
Esempio n. 6
0
        private static RoomieThread SelectThread(string name, RoomieThread currentThread, IEnumerable<RoomieThread> threads)
        {
            if (name == CurrentThreadName)
            {
                return currentThread;
            }

            return SelectThread(name, threads);
        }
Esempio n. 7
0
        public RoomieEventTextStream(RoomieEngine engine, TextWriter output,  TimeSpan timeStampInterval)
        {
            this.output = output;
            this.timeStampInterval = timeStampInterval;

            _lastTimestamp = DateTime.MinValue;
            _lastThread = null;

            engine.ScriptMessageSent += new RoomieThreadEventHandler(engine_ScriptMessageSent);
        }
Esempio n. 8
0
        public RoomieEventTextStream(RoomieEngine engine, TextWriter output, TimeSpan timeStampInterval)
        {
            this.output            = output;
            this.timeStampInterval = timeStampInterval;

            _lastTimestamp = DateTime.MinValue;
            _lastThread    = null;

            engine.ScriptMessageSent += new RoomieThreadEventHandler(engine_ScriptMessageSent);
        }
Esempio n. 9
0
 public RoomieThreadEventArgs(RoomieThread thread, string message)
     : base()
 {
     this.scriptMessage = new OutputEvent(thread, message);
 }
Esempio n. 10
0
 public RoomieThreadEventArgs(RoomieThread thread, string message)
     : base()
 {
     this.scriptMessage = new OutputEvent(thread, message);
 }
Esempio n. 11
0
 public OutputEvent(RoomieThread thread, string message)
 {
     _timestamp = DateTime.Now;
     _thread = thread;
     _message = message;
 }
Esempio n. 12
0
 public OutputEvent(RoomieThread thread, string message)
 {
     _timestamp = DateTime.Now;
     _thread    = thread;
     _message   = message;
 }
Esempio n. 13
0
        internal void SimpleOutputText(RoomieThread thread, string message)
        {
            if (ScriptMessageSent == null)
            {
                throw new Exception("nothing is listening to the engine's output messages!");
            }

            ScriptMessageSent(this, new RoomieThreadEventArgs(thread, message));
        }