AutoClicker.AutoClicker.UpdateLocation C# (CSharp) Method

UpdateLocation() public method

public UpdateLocation ( LocationType LocationType, int X, int Y, int Width, int Height ) : void
LocationType LocationType
X int
Y int
Width int
Height int
return void
        public void UpdateLocation(LocationType LocationType, int X, int Y, int Width, int Height)
        {
            tmpLocationType = LocationType;
            tmpX = X;
            tmpY = Y;
            tmpWidth = Width;
            tmpHeight = Height;

            locationUpdated = true;
        }

Usage Example

Ejemplo n.º 1
0
        private void LocationHandler(object sender, EventArgs e)
        {
            AutoClicker.LocationType locationType;
            int x      = -1;
            int y      = -1;
            int width  = -1;
            int height = -1;

            if (rdbLocationFixed.Checked)
            {
                locationType = AutoClicker.LocationType.Fixed;
                x            = (int)numFixedX.Value;
                y            = (int)numFixedY.Value;
            }
            else if (rdbLocationMouse.Checked)
            {
                locationType = AutoClicker.LocationType.Cursor;
            }
            else if (rdbLocationRandom.Checked)
            {
                locationType = AutoClicker.LocationType.Random;
            }
            else
            {
                locationType = AutoClicker.LocationType.RandomRange;
                x            = (int)numRandomX.Value;
                y            = (int)numRandomY.Value;
                width        = (int)numRandomWidth.Value;
                height       = (int)numRandomHeight.Value;
            }

            // Toggle visibility of controls.
            if (locationType == AutoClicker.LocationType.Fixed)
            {
                numFixedX.Enabled = true;
                numFixedY.Enabled = true;
            }
            else
            {
                numFixedX.Enabled = false;
                numFixedY.Enabled = false;
            }

            if (locationType == AutoClicker.LocationType.RandomRange)
            {
                numRandomX.Enabled      = true;
                numRandomY.Enabled      = true;
                numRandomWidth.Enabled  = true;
                numRandomHeight.Enabled = true;
                btnSelect.Enabled       = true;
            }
            else
            {
                numRandomX.Enabled      = false;
                numRandomY.Enabled      = false;
                numRandomWidth.Enabled  = false;
                numRandomHeight.Enabled = false;
                btnSelect.Enabled       = false;
            }

            clicker.UpdateLocation(locationType, x, y, width, height);
        }
All Usage Examples Of AutoClicker.AutoClicker::UpdateLocation