Пример #1
0
 public void RemoveChild(UIView view)
 {
     this.childrenToRemove.Add(view);
 }
Пример #2
0
 private void HandleMouseInput()
 {
     for (int i = 0; i < this.children.Count; i++)
     {
         UIView uIView = this.children[this.children.Count - 1 - i];
         if (uIView.Visible && (uIView.Parent == null || uIView.UpdateWhenOutOfBounds || (uIView.InParent() && (uIView.Parent.MouseInside || uIView.Parent.UpdateWhenOutOfBounds) && !uIView.Parent.mouseForChildrenHandled)))
         {
             uIView.HandleMouseInput();
         }
     }
     if (this.MouseInside)
     {
         EventHandler arg_8F_0 = this.onMouseLeave;
         if (this.Parent != null)
         {
             this.Parent.mouseForChildrenHandled = true;
             if (this.OverridesMouse)
             {
                 this.OverWriteGameMouseInput();
             }
         }
         if (this.onHover != null)
         {
             this.onHover(this, new EventArgs());
         }
         if (!this.mousePreviouslyIn && this.onMouseEnter != null)
         {
             this.onMouseEnter(this, new EventArgs());
         }
         if (!UIView.MousePrevLeftButton && UIView.MouseLeftButton)
         {
             this.leftButtonDown = true;
             if (this.onMouseDown != null && !UIView.mouseDownHandled)
             {
                 this.onMouseDown(this, 0);
             }
         }
         if (UIView.MousePrevLeftButton && !UIView.MouseLeftButton)
         {
             if (this.onMouseUp != null && !UIView.mouseUpHandled)
             {
                 this.onMouseUp(this, 0);
             }
             if (this.leftButtonDown && this.onLeftClick != null)
             {
                 this.onLeftClick(this, EventArgs.Empty);
             }
         }
         if (!UIView.MousePrevRightButton && UIView.MouseRightButton)
         {
             this.rightButtonDown = true;
             if (this.onMouseDown != null)
             {
                 this.onMouseDown(this, 1);
             }
         }
         if (UIView.MousePrevRightButton && !UIView.MouseRightButton)
         {
             if (this.onMouseUp != null)
             {
                 this.onMouseUp(this, 1);
             }
             if (this.rightButtonDown && this.onRightClick != null)
             {
                 this.onRightClick(this, EventArgs.Empty);
             }
         }
         this.mousePreviouslyIn = true;
     }
     else
     {
         EventHandler arg_1E5_0 = this.onMouseLeave;
         if (this.mousePreviouslyIn && this.onMouseLeave != null)
         {
             this.onMouseLeave(this, new EventArgs());
         }
         this.mousePreviouslyIn = false;
     }
     if (!UIView.MouseLeftButton)
     {
         this.leftButtonDown = false;
     }
     if (!UIView.MouseRightButton)
     {
         this.rightButtonDown = false;
     }
 }