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

            InfoUpdate();
            NewUpdate();
            //OpenUpdate();
            PackagingUpdate();
            LoginUpdate();

            if (Visible && doInitActionsInTimer)
            {
                doInitActionsInTimer = false;

                kryptonNavigator1.Focus();
                kryptonNavigator1.Select();
                kryptonTextBoxInfoName.Select(0, 0);
            }
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            //need periodically check for case when component inside _File item was loaded
            UpdateSelectedType();

            UpdateControls();

            //!!!!лучше совсем окно не показывать
            //auto create and close
            if (firstTick && creationData.initSupportAutoCreateAndClose)
            {
                if (tableLayoutPanel1.Controls.Count == 0)
                {
                    if (IsReadyToCreate(out _))
                    {
                        ButtonCreateAndClose_Click(null, null);
                    }
                }
            }

            firstTick = false;
        }
Exemple #3
0
        public bool IsAllowRender()
        {
            if (EngineApp.Instance == null)
            {
                return(false);
            }

            //!!!!new. надо ли. поставлено т.к. валилось в UpdateTransformToolObjects на "foreach( var obj in transformTool.Objects )" в OnPaint, в Tick
            if (!loaded)
            {
                return(false);
            }

            //if( WinFormsAppWorld.DuringWarningOrErrorMessageBox )
            //	return;
            //if( RenderSystem.IsDeviceLostByTestCooperativeLevel() )
            //	return;

            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return(false);
            }

            //!!!! check perf. replace to alternative with flag check for better perf.
            if (!IsPhysicalVisibleCheckBy5Points(this))
            {
                return(false);
            }

            return(true);
        }
        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;
            }
        }
Exemple #5
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            UpdateWindowTitle();
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            //need periodically check for case when component inside _File item was loaded
            UpdateSelectedType();

            UpdateControls();
        }
Exemple #7
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            double updateTime = 0.05;

            {
                var count = EditorForm.Instance.GetObjectsInFocus().Objects.Length;
                if (count > 2000)
                {
                    updateTime = 2.0;
                }
                else if (count > 500)
                {
                    updateTime = 1.0;
                }
                else if (count > 250)
                {
                    updateTime = 0.5;
                }
                else if (count > 100)
                {
                    updateTime = 0.1;
                }
                else
                {
                    updateTime = 0.05;
                }
            }
            if (EngineApp.GetSystemTime() - lastUpdateTime < updateTime)
            {
                return;
            }

            UpdateSelectedPanel();

            lastUpdateTime = EngineApp.GetSystemTime();
        }
Exemple #8
0
        void updateTimer_Tick(object sender, EventArgs e)
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }
            if (!IsHandleCreated)
            {
                return;
            }
            //!!!!надо ли?
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            //!!!!

            if (automaticUpdateFPS == 0)
            {
                UpdateInput();
            }

            ////!!!!
            ////if( WinFormsAppWorld.DuringWarningOrErrorMessageBox )
            ////	return;

            //	if( viewport != null )
            //	UpdateKeysAndMouseButtons();

            ////!!!!
            ////if( automaticUpdateFPS != 0 )
            ////{
            ////	if( !invalidated )//!!!!temp?
            ////	{
            ////		invalidated = true;
            ////		Invalidate();
            ////	}
            ////}

            ////!!!!!так? может проверки какие
            //if( viewport != null && viewport.MouseRelativeMode )
            //	MouseRelativeModeResetPosition();
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            if (kryptonSplitContainer1.Orientation != options.SplitterOrientation)
            {
                kryptonSplitContainer1.Orientation = options.SplitterOrientation;
            }

            //set splitter position from config
            if (splitterDistanceFromConfig != -1)
            {
                kryptonSplitContainer1.SplitterDistance = splitterDistanceFromConfig;
                splitterDistanceFromConfig = -1;
            }
        }