예제 #1
0
        private void timer10ms_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            bool cancel = false;

            BeforeTimerUpdate?.Invoke(this, ref cancel);
            if (cancel)
            {
                return;
            }

            //!!!!когда не обновлять?
            PerformUpdate();

            if (doubleBufferCompositedTime.HasValue && (DateTime.Now - doubleBufferCompositedTime.Value).TotalSeconds > 0)
            {
                ControlDoubleBufferComposited.RestoreComposited(this);
                doubleBufferCompositedTime = null;
            }
        }
예제 #2
0
        private void timer50ms_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || EditorUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!EditorUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            bool cancel = false;

            BeforeTimerUpdate?.Invoke(this, ref cancel);
            if (cancel)
            {
                return;
            }

            //!!!!когда не обновлять?
            PerformUpdate();
        }