Esempio n. 1
0
        private void Window_Closed(object sender, EventArgs e)
        {
            Guid?session;

            if (gameVM != null)
            {
                session = (Guid)gameVM.Session;
            }
            else
            {
                session = null;
            }
            WindowClosedEvent?.Invoke(this, new ChatEventArgs()
            {
                contact = _contact,
                Session = session
            });
        }
Esempio n. 2
0
        private void OnCloseWindow(IWindowResult result)
        {
            result.Window.CloseWindowEvent   -= OnCloseWindow;
            result.Window.DestroyWindowEvent -= OnDestroyWindow;

            var index            = _openedWindows.IndexOf(result.Window);
            var overlappedWindow = index > 0 ? _openedWindows.ElementAt(index - 1) : null;

            _openedWindows.Remove(result.Window);

            if (result.Window.IsInactiveOrDeactivated())
            {
                Destroy(result.Window.Canvas.gameObject);
            }
            else
            {
                result.Window.ActivatableStateChangedEvent += OnWindowDeactivateHandler;
            }

            if (overlappedWindow != null && overlappedWindow.IsInactiveOrDeactivated())
            {
                overlappedWindow.Activate();
            }

            _isUnique = false;
            WindowClosedEvent?.Invoke(result);

            _delayedWindows.ToList().ForEach(call =>
            {
                if (_isUnique || call.IsUnique && _openedWindows.Count > 0)
                {
                    return;
                }

                _delayedWindows.Remove(call);

                call.Window.Canvas.gameObject.SetActive(true);
                DoApplyWindow(call.Window, call.IsUnique, call.Overlap);
            });
        }
Esempio n. 3
0
 public static void WindowClosedEventFunction()
 {
     WindowClosedEvent?.Invoke(null, null);//触发事件,执行所有注册过的函数
 }
Esempio n. 4
0
 protected virtual void OnWindowClosedEvent(object sender, WindowEventArgs args)
 {
     WindowClosedEvent?.Invoke(sender, args);
 }