Beispiel #1
0
        public List <QueuedInput> GetInputQueue()
        {
            QueueLock.WaitOne();
            var r = Queued;

            Queued = new List <QueuedInput>();
            QueueLock.ReleaseMutex();
            return(r);
        }
Beispiel #2
0
        public override void Construct()
        {
            Root.RegisterForUpdate(this);

            OnUpdate = (sender, time) =>
            {
                MessageLock.WaitOne();
                if (NeedsInvalidated)
                {
                    this.Invalidate();
                }
                NeedsInvalidated = false;
                MessageLock.ReleaseMutex();
            };
        }
Beispiel #3
0
        /// <summary>
        /// 释放资源
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private static void OnExit(object sender, EventArgs args)
        {
            // releases the Mutex once ..
            __Mu.ReleaseMutex();

            // releases all resources ..
            __Mu.Close();
        }
Beispiel #4
0
        public override void Construct()
        {
            Root.RegisterForUpdate(this);

            OnUpdate = (sender, time) =>
            {
                MessageLock.WaitOne();
                if (NeedsInvalidated)
                {
                    this.Invalidate();
                }
                NeedsInvalidated = false;
                MessageLock.ReleaseMutex();
            };

            Lines.Add("");

            TextGrid = AddChild(new TextGrid
            {
                AutoLayout = AutoLayout.DockFill,
                Font       = "monofont",
                TextSize   = GameSettings.Default.ConsoleTextSize,
            }) as TextGrid;
        }