Example #1
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     try
     {
         this.m_LastMousePosition.X = e.X;
         this.m_LastMousePosition.Y = e.Y;
         Rectangle rectangle = this.CalculateClientRect();
         if ((this.m_ToolTip != null) && this.m_ToolTip.Visible)
         {
             this.m_ToolTip.Visible = false;
         }
         else if (this.m_bEnableTouchScrolling && this.m_bTouchScrolling)
         {
             if ((this.TickCount - this.m_TouchTime1) > 100)
             {
                 this.m_TouchAutoScrollDiffY = 0;
             }
             if (this.m_touchPage)
             {
                 this.m_touchPage = false;
                 if (this.m_TouchAutoScrollDiffX > 0)
                 {
                     TouchGestureEventArgs right = TouchGestureEventArgs.Right;
                     right.Difference = this.m_TouchAutoScrollDiffX;
                     this.OnTouchGesture(right);
                     if (!right.Handled)
                     {
                         if (this.m_touchPagesDirection == Resco.Controls.DetailView.TouchScrollDirection.Inverse)
                         {
                             this.PreviousPage();
                         }
                         else
                         {
                             this.NextPage();
                         }
                     }
                 }
                 else
                 {
                     TouchGestureEventArgs left = TouchGestureEventArgs.Left;
                     left.Difference = this.m_TouchAutoScrollDiffX;
                     this.OnTouchGesture(left);
                     if (!left.Handled)
                     {
                         if (this.m_touchPagesDirection == Resco.Controls.DetailView.TouchScrollDirection.Inverse)
                         {
                             this.NextPage();
                         }
                         else
                         {
                             this.PreviousPage();
                         }
                     }
                 }
             }
             else
             {
                 uint num = (this.TickCount - this.m_TouchTime0) / 50;
                 if (num > 0)
                 {
                     this.m_TouchAutoScrollDiffY = (int) (this.m_TouchAutoScrollDiffY / num);
                 }
                 TouchGestureEventArgs args3 = new TouchGestureEventArgs();
                 args3.Type = TouchGestureType.Gesture;
                 args3.Difference = this.m_TouchAutoScrollDiffY;
                 args3.Direction = (this.m_TouchAutoScrollDiffY > 0) ? Resco.Controls.DetailView.TouchGesture.Down : Resco.Controls.DetailView.TouchGesture.Up;
                 this.OnTouchGesture(args3);
                 if (!args3.Handled)
                 {
                     this.m_TouchScrollingTimer.Enabled = true;
                 }
             }
             this.m_bTouchScrolling = false;
         }
         int yOffset = -this.m_vScroll.Value + rectangle.Y;
         yOffset += (this.PagesLocation == RescoPagesLocation.Bottom) ? 0 : this.PagerHeight;
         int ctrlHeight = base.Height - (((this.PageCount == 0) || (this.PagesLocation == RescoPagesLocation.Top)) ? 0 : this.PagerHeight);
         this.m_ItemCollection.MouseUpDown(yOffset, e, this.UsableWidth, ctrlHeight, false);
     }
     catch (ObjectDisposedException)
     {
     }
 }
Example #2
0
 protected virtual void OnTouchGesture(TouchGestureEventArgs e)
 {
     if (this.TouchGesture != null)
     {
         this.TouchGesture(this, e);
     }
 }
Example #3
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if ((this.m_bEnableTouchScrolling && ((this.Site == null) || !this.Site.DesignMode)) && ((e.Y != this.m_LastMousePosition.Y) || (e.X != this.m_LastMousePosition.X)))
     {
         int num = e.Y - this.m_LastMousePosition.Y;
         int num2 = e.X - this.m_LastMousePosition.X;
         this.m_LastMousePosition.X = e.X;
         this.m_LastMousePosition.Y = e.Y;
         if ((this.m_ToolTip == null) || !this.m_ToolTip.Visible)
         {
             this.m_TouchAutoScrollDiffY += num;
             this.m_TouchAutoScrollDiffX += num2;
             if ((this.TickCount - this.m_TouchTime1) > 100)
             {
                 this.m_TouchAutoScrollDiffX = 0;
                 this.m_TouchAutoScrollDiffY = 0;
                 this.m_TouchTime0 = this.TickCount;
                 this.m_TouchTime1 = this.m_TouchTime0;
             }
             else
             {
                 this.m_TouchTime1 = this.TickCount;
             }
             float width = this.m_dpiFactor.Width;
             float height = this.m_dpiFactor.Height;
             if ((this.m_bTouchScrolling || (Math.Abs(this.m_TouchAutoScrollDiffY) >= ((int) (this.m_touchSensitivity * width)))) || (this.m_bTouchScrolling || (Math.Abs(this.m_TouchAutoScrollDiffX) >= ((int) (this.m_touchSensitivity * height)))))
             {
                 if (Math.Abs(this.m_TouchAutoScrollDiffX) > Math.Abs(this.m_TouchAutoScrollDiffY))
                 {
                     this.m_touchPage = true;
                 }
                 else
                 {
                     this.m_touchPage = false;
                 }
                 this.m_bTouchScrolling = true;
                 if ((this.m_vScroll != null) && !this.m_touchPage)
                 {
                     TouchGestureEventArgs args = new TouchGestureEventArgs();
                     args.Type = TouchGestureType.Scroll;
                     args.Difference = num;
                     args.Direction = (this.m_TouchAutoScrollDiffY > 0) ? Resco.Controls.DetailView.TouchGesture.Down : Resco.Controls.DetailView.TouchGesture.Up;
                     this.OnTouchGesture(args);
                     if (!args.Handled)
                     {
                         int num5 = this.m_vScroll.Value - ((this.m_touchScrollDirection == Resco.Controls.DetailView.TouchScrollDirection.Inverse) ? num : -num);
                         this.m_vScroll.Value = Math.Min(Math.Max(num5, this.m_vScroll.Minimum), this.m_vScroll.Maximum - this.m_vScroll.LargeChange);
                     }
                 }
             }
         }
     }
 }