Esempio n. 1
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            this.int_5  = e.X;
            this.int_6  = e.Y;
            this.bool_7 = Control1.smethod_3(e.Location, this.rectangleF_0);
            Point location = e.Location;
            int   num      = (this.orientation_0 == Orientation.Horizontal) ? location.X : location.Y;
            int   num2     = this.int_1 >> 1;

            num -= num2;
            float num3 = (float)(this.int_4 - this.int_3) / (float)(((this.orientation_0 == Orientation.Horizontal) ? base.ClientSize.Width : base.ClientSize.Height) - 2 * num2);

            this.int_7 = (int)((float)num * num3 + (float)this.int_3);
            if (base.Capture & e.Button == MouseButtons.Left)
            {
                ScrollEventType type = ScrollEventType.ThumbPosition;
                this.int_2 = this.int_7;
                if (this.int_2 <= this.int_3)
                {
                    this.int_2 = this.int_3;
                    type       = ScrollEventType.First;
                }
                else if (this.int_2 >= this.int_4)
                {
                    this.int_2 = this.int_4;
                    type       = ScrollEventType.Last;
                }
                if (this.scrollEventHandler_0 != null)
                {
                    this.scrollEventHandler_0(this, new ScrollEventArgs(type, this.int_2));
                }
                if (this.eventHandler_0 != null)
                {
                    this.eventHandler_0(this, new EventArgs());
                }
            }
            if (this.int_7 < this.int_3)
            {
                this.int_7 = this.int_3;
            }
            else if (this.int_7 > this.int_4)
            {
                this.int_7 = this.int_4;
            }
            if (this.bool_0)
            {
                this.int_7 = this.int_4 - this.int_7 + this.int_3;
            }
            base.Invalidate();
        }
Esempio n. 2
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     base.Capture = false;
     this.bool_7  = Control1.smethod_3(e.Location, this.rectangleF_0);
     if (this.scrollEventHandler_0 != null)
     {
         this.scrollEventHandler_0(this, new ScrollEventArgs(ScrollEventType.EndScroll, this.int_2));
     }
     if (this.eventHandler_0 != null)
     {
         this.eventHandler_0(this, new EventArgs());
     }
     base.Invalidate();
 }