public override void OnWindowClose()
        {
            base.OnWindowClose();

            WindowSystem.GetHistoryTracker().Add(this, HistoryTrackerEventType.WindowClose);

            WindowSystem.GetEvents().Raise(this, WindowEventType.OnWindowClose);

            this.manualShowHideControl = false;
        }
Ejemplo n.º 2
0
        public override void OnDeinit(System.Action callback)
        {
            WindowSystem.GetHistoryTracker().Add(this, HistoryTrackerEventType.Deinit);

            WindowSystem.GetEvents().Raise(this, WindowEventType.OnDeinit);

            WindowSystem.GetEvents().Clear(this);
            this.animation = null;
            WindowSystem.GetHistoryTracker().Clear(this);
            this.animationInputParams.Clear();

            base.OnDeinit(callback);
        }
        public override void DoHideEnd(AppearanceParameters parameters)
        {
            if (this.manualShowHideControl == true)
            {
                return;
            }

            WindowSystem.GetHistoryTracker().Add(this, HistoryTrackerEventType.HideEnd);

            WindowSystem.GetEvents().Raise(this, WindowEventType.OnHideEnd);

            this.DoHideEnd_INTERNAL(parameters);
        }
Ejemplo n.º 4
0
        private void DoHideBegin_INTERNAL(AppearanceParameters parameters)
        {
            if (this.IsStateReadyToHide() == false &&
                parameters.GetForced(defaultValue: false) == false)
            {
                this.RefreshComponentState();
                parameters.Call();
                return;
            }

            this.SetComponentState(WindowObjectState.Hiding);

            WindowSystem.GetEvents().Raise(this, WindowEventType.OnHideBegin);

            var window = this.GetWindow();

            if (window != null)
            {
                var canvas = window.GetCanvas();
                if (canvas != null)
                {
                    canvas.pixelPerfect = false;
                }
            }

            var parametersCallback = parameters.callback;

            System.Action onResult = () => {
                if (window != null)
                {
                    var canvas = window.GetCanvas();
                    if (canvas != null)
                    {
                        WindowSystem.ApplyToSettingsInstance(null, canvas, this.GetWindow());
                    }
                }

                if (parametersCallback != null)
                {
                    parametersCallback.Invoke();
                }
            };

                        #if DEBUGBUILD
            Profiler.BeginSample("WindowComponentBase::OnHideBegin()");
                        #endif

            WindowSystem.RunSafe(this.OnHideBegin);
            WindowSystem.RunSafe(this.OnHideBegin, parameters);

                        #if DEBUGBUILD
            Profiler.EndSample();
                        #endif

            var includeChilds = parameters.GetIncludeChilds(defaultValue: true);
            #region Include Childs
            if (includeChilds == false)
            {
                // without childs
                this.DoHideBeginAnimation_INTERNAL(onResult, parameters);
                return;
            }
            #endregion

            this.RunChilds_INTERNAL(parameters, onResult, this.DoHideBeginAnimation_INTERNAL, (e, p) => e.DoHideBegin(p));

            /*
             * var childsBehaviour = parameters.GetChildsBehaviourMode(this.childsHideMode);
             * if (childsBehaviour == ChildsBehaviourMode.Simultaneously) {
             *
             #region Childs Simultaneously
             *      var counter = 0;
             *      System.Action callback = () => {
             *
             ++counter;
             *              if (counter < 2) return;
             *
             *              onResult.Invoke();
             *
             *      };
             *
             *      this.DoHideBeginAnimation_INTERNAL(callback, parameters);
             *
             *      ME.Utilities.CallInSequence(callback, this.subComponents, (e, c) => {
             *
             *              e.DoHideBegin(parameters.ReplaceCallback(c));
             *
             *      });
             #endregion
             *
             * } else if (childsBehaviour == ChildsBehaviourMode.Consequentially) {
             *
             #region Childs Consequentially
             *      ME.Utilities.CallInSequence(() => {
             *
             *              this.DoHideBeginAnimation_INTERNAL(onResult, parameters);
             *
             *      }, this.subComponents, (e, c) => {
             *
             *              e.DoHideBegin(parameters.ReplaceCallback(c));
             *
             *      }, waitPrevious: true);
             #endregion
             *
             * }*/
        }
Ejemplo n.º 5
0
        private void DoShowEnd_INTERNAL(AppearanceParameters parameters)
        {
            WindowSystem.GetEvents().Raise(this, WindowEventType.OnShowEnd);

            base.DoShowEnd(parameters);
        }
        private void DoHideBegin_INTERNAL(AppearanceParameters parameters)
        {
            if ((this.GetComponentState() == WindowObjectState.Hiding ||
                 this.GetComponentState() == WindowObjectState.Hidden) &&
                parameters.GetForced(defaultValue: false) == false)
            {
                parameters.Call();
                return;
            }

            this.SetComponentState(WindowObjectState.Hiding);

            WindowSystem.GetEvents().Raise(this, WindowEventType.OnHideBegin);

            var parametersCallback = parameters.callback;

            System.Action onResult = () => {
                if (parametersCallback != null)
                {
                    parametersCallback.Invoke();
                }
            };

                        #if DEBUGBUILD
            Profiler.BeginSample("WindowComponentBase::OnHideBegin()");
                        #endif

            WindowSystem.RunSafe(this.OnHideBegin);
            WindowSystem.RunSafe(this.OnHideBegin, parameters);

                        #if DEBUGBUILD
            Profiler.EndSample();
                        #endif

            var includeChilds = parameters.GetIncludeChilds(defaultValue: true);
            #region Include Childs
            if (includeChilds == false)
            {
                // without childs
                this.DoHideBeginAnimation_INTERNAL(onResult, parameters);
                return;
            }
            #endregion

            var childsBehaviour = parameters.GetChildsBehaviourMode(this.childsHideMode);
            if (childsBehaviour == ChildsBehaviourMode.Simultaneously)
            {
                #region Childs Simultaneously
                var           counter  = 0;
                System.Action callback = () => {
                    ++counter;
                    if (counter < 2)
                    {
                        return;
                    }

                    onResult.Invoke();
                };

                this.DoHideBeginAnimation_INTERNAL(callback, parameters);

                ME.Utilities.CallInSequence(callback, this.subComponents, (e, c) => {
                    e.DoHideBegin(parameters.ReplaceCallback(c));
                });
                #endregion
            }
            else if (childsBehaviour == ChildsBehaviourMode.Consequentially)
            {
                #region Childs Consequentially
                ME.Utilities.CallInSequence(() => {
                    this.DoHideBeginAnimation_INTERNAL(onResult, parameters);
                }, this.subComponents, (e, c) => {
                    e.DoHideBegin(parameters.ReplaceCallback(c));
                }, waitPrevious: true);
                #endregion
            }
        }
Ejemplo n.º 7
0
        public static void UnRegisterAction(WindowObject instance, WindowEvent windowEvent, System.Action callback)
        {
            var events = WindowSystem.GetEvents();

            events.UnRegister(instance, windowEvent, callback);
        }
Ejemplo n.º 8
0
        public static void ClearEvents(WindowObject instance)
        {
            var events = WindowSystem.GetEvents();

            events.Clear(instance);
        }
Ejemplo n.º 9
0
        public static void RaiseEvent(WindowObject instance, WindowEvent windowEvent)
        {
            var events = WindowSystem.GetEvents();

            events.Raise(instance, windowEvent);
        }