Beispiel #1
0
        public MyRootGraphic(
            int width, int height,
            ITextService textService)
            : base(width, height)
        {
            _textService         = textService;
            _graphicTimerTaskMan = new GraphicsTimerTaskManager(this);
            _defaultTextEditFont = new RequestFont("tahoma", 10);

#if DEBUG
            dbugCurrentGlobalVRoot = this;
            dbug_Init(null, null, null);
#endif

            //create default render box***
            _topWindowRenderBox = new TopWindowRenderBox(this, width, height);
            _topWindowEventRoot = new TopWindowEventRoot(_topWindowRenderBox);
            _gfxTimerTask       = this.SubscribeGraphicsIntervalTask(_normalUpdateTask,
                                                                     TaskIntervalPlan.Animation,
                                                                     20,
                                                                     (s, e) =>
            {
                this.PrepareRender();
                this.FlushAccumGraphics();
            });

            _primaryContainerElement = _topWindowRenderBox;
        }
Beispiel #2
0
        public GraphicsTimerTask SubscribeGraphicsTimerTask(
            object uniqueName,
            TaskIntervalPlan planName,
            int intervalMs,
            EventHandler <GraphicsTimerTaskEventArgs> tickhandler)
        {
            GraphicsTimerTask existingTask;

            if (!registeredTasks.TryGetValue(uniqueName, out existingTask))
            {
                existingTask = new GraphicsTimerTask(this.rootgfx, planName, uniqueName, intervalMs, tickhandler);
                registeredTasks.Add(uniqueName, existingTask);
                switch (planName)
                {
                case TaskIntervalPlan.CaretBlink:
                {
                    caretIntervalTaskList.Add(existingTask);
                }
                break;

                default:
                {
                    fastIntervalTaskList.Add(existingTask);
                }
                break;
                }
            }
            return(existingTask);
        }
 internal static void RegisterCaretBlink(RootGraphic root)
 {
     if (!root.CaretHandleRegistered)
     {
         root.CaretHandleRegistered = true;
         _task = root.SubscribeGraphicsIntervalTask(
             _caretBlinkTask,
             TaskIntervalPlan.CaretBlink,
             20,
             _tickHandler);
     }
 }
Beispiel #4
0
        public override void CloseWinRoot()
        {
            if (_gfxTimerTask != null)
            {
                _gfxTimerTask.RemoveSelf();
                _gfxTimerTask = null;
            }

            if (_gfxTimerTaskMx != null)
            {
                _gfxTimerTaskMx.CloseAllWorkers();
                _gfxTimerTaskMx = null;
            }
        }