예제 #1
0
                // Token: 0x0600163D RID: 5693 RVA: 0x00035EC0 File Offset: 0x000340C0
                public void method_0()
                {
                    Rectangle rectangle;

                    if (this.nullable_0 != null && this.class117_0.func_1())
                    {
                        rectangle = Class410.smethod_15(this.class116_0.intptr_0, this.nullable_0.Value);
                    }
                    else
                    {
                        if (!this.class117_0.func_0())
                        {
                            return;
                        }
                        rectangle = Class410.smethod_14(this.class116_0.intptr_0);
                    }
                    bool flag  = rectangle.Size != this.rectangle_0.Size;
                    bool flag2 = rectangle.Location != this.rectangle_0.Location;

                    if (flag)
                    {
                        if (flag2)
                        {
                            if (!Class265.SetWindowPos(this.class116_0.intptr_0, Class265.intptr_3, this.rectangle_0.X, this.rectangle_0.Y, this.rectangle_0.Width, this.rectangle_0.Height, (Enum31)0U))
                            {
                                throw new Win32Exception();
                            }
                        }
                        else if (!Class265.SetWindowPos(this.class116_0.intptr_0, Class265.intptr_3, 0, 0, this.rectangle_0.Width, this.rectangle_0.Height, Enum31.flag_7))
                        {
                            throw new Win32Exception();
                        }
                    }
                    else if (flag2 && !Class265.SetWindowPos(this.class116_0.intptr_0, Class265.intptr_3, this.rectangle_0.X, this.rectangle_0.Y, 0, 0, Enum31.flag_12))
                    {
                        throw new Win32Exception();
                    }
                }
        // Token: 0x060015E7 RID: 5607 RVA: 0x00032490 File Offset: 0x00030690
        private void RegionSelector_Load(object sender, EventArgs e)
        {
            this.RegionSelectorControl.BackgroundOverlayColor      = Color.FromArgb(180, Color.Black);
            this.RegionSelectorControl.BorderColor                 = Color.FromArgb(255, Color.Red);
            this.RegionSelectorControl.WindowRegionOverlayColor    = Color.FromArgb(90, 255, 128, 64);
            this.RegionSelectorControl.CloseMessageTextColor       = Color.FromArgb(200, Color.Red);
            this.RegionSelectorControl.CloseMessageBorderTextColor = Color.FromArgb(200, Color.Black);
            this.RegionSelectorControl.SelectorType                = this.RegionSelectorType;
            this.RegionSelectorControl.FullScreen = this.FullScreenCapture;
            if (this.bool_0 && !this.class141_0.ProcessOpen)
            {
                this.method_0();
                return;
            }
            IntPtr mainWindowHandle = this.class141_0.MainWindowHandle;

            if (this.FullScreenCapture)
            {
                try
                {
                    this.RegionSelectorControl.ScreenCapture = (this.bitmap_0 = Class364.smethod_0());
                }
                catch (Exception ex)
                {
                    ex.smethod_0();
                    this.method_0();
                    return;
                }
                if (!this.bool_0)
                {
                    if (this.FullSize)
                    {
                        this.RegionSelectorControl.SelectionBounds = new Rectangle(Point.Empty, SystemInformation.VirtualScreen.Size);
                    }
                    else
                    {
                        this.RegionSelectorControl.SelectionBounds = this.SelectionBounds;
                    }
                    if (this.FullSelect)
                    {
                        this.RegionSelectorControl.SelectedRegion = new Rectangle(Point.Empty, this.RegionSelectorControl.SelectionBounds.Size).smethod_1(this.RegionSelectorControl.SelectionBounds);
                    }
                    else
                    {
                        this.RegionSelectorControl.SelectedRegion = this.SelectedRegion.smethod_1(this.RegionSelectorControl.SelectionBounds);
                    }
                }
                else
                {
                    try
                    {
                        this.rectangle_0 = Class410.smethod_16(mainWindowHandle);
                    }
                    catch (Exception ex2)
                    {
                        ex2.smethod_0();
                        this.method_0();
                        return;
                    }
                    if (SystemInformation.VirtualScreen.X < 0)
                    {
                        this.rectangle_0.X = this.rectangle_0.X - SystemInformation.VirtualScreen.X;
                    }
                    if (SystemInformation.VirtualScreen.Y < 0)
                    {
                        this.rectangle_0.Y = this.rectangle_0.Y - SystemInformation.VirtualScreen.Y;
                    }
                    if (this.FullSize)
                    {
                        this.RegionSelectorControl.SelectionBounds = this.rectangle_0;
                    }
                    else
                    {
                        this.RegionSelectorControl.SelectionBounds = new Rectangle(this.SelectionBounds.Location.smethod_10(this.rectangle_0.Location), this.SelectionBounds.Size);
                    }
                    if (this.FullSelect)
                    {
                        this.RegionSelectorControl.SelectedRegion = this.RegionSelectorControl.SelectionBounds;
                    }
                    else
                    {
                        this.RegionSelectorControl.SelectedRegion = new Rectangle(this.SelectedRegion.Location.smethod_10(this.rectangle_0.Location), this.SelectedRegion.Size).smethod_1(this.RegionSelectorControl.SelectionBounds);
                    }
                }
                base.FormBorderStyle = FormBorderStyle.None;
                base.Location        = SystemInformation.VirtualScreen.Location;
                base.Size            = SystemInformation.VirtualScreen.Size;
            }
            else if (!this.bool_0)
            {
                if (this.FullSize)
                {
                    try
                    {
                        this.RegionSelectorControl.ScreenCapture = (this.bitmap_0 = Class364.smethod_0());
                    }
                    catch (Exception ex3)
                    {
                        ex3.smethod_0();
                        this.method_0();
                        return;
                    }
                    this.RegionSelectorControl.SelectionBounds = this.SelectionBounds;
                    base.Size = SystemInformation.VirtualScreen.Size;
                }
                else
                {
                    try
                    {
                        this.RegionSelectorControl.ScreenCapture = (this.bitmap_0 = Class364.smethod_1(this.SelectionBounds.smethod_8()));
                    }
                    catch (Exception ex4)
                    {
                        ex4.smethod_0();
                        this.method_0();
                        return;
                    }
                    this.RegionSelectorControl.SelectionBounds = new Rectangle(Point.Empty, this.SelectionBounds.Size);
                    base.Size = this.SelectionBounds.Size;
                }
                if (this.FullSelect)
                {
                    this.RegionSelectorControl.SelectedRegion = new Rectangle(Point.Empty, this.RegionSelectorControl.SelectionBounds.Size);
                }
                else
                {
                    this.RegionSelectorControl.SelectedRegion = new Rectangle(this.SelectedRegion.Location.smethod_11(this.SelectionBounds.Location), this.SelectedRegion.Size).smethod_1(this.RegionSelectorControl.SelectionBounds);
                }
                base.FormBorderStyle = FormBorderStyle.Fixed3D;
                base.CenterToScreen();
            }
            else
            {
                if (this.FullSize)
                {
                    try
                    {
                        this.RegionSelectorControl.ScreenCapture   = (this.bitmap_0 = Class364.smethod_2(mainWindowHandle));
                        this.RegionSelectorControl.SelectionBounds = new Rectangle(Point.Empty, Class410.smethod_18(mainWindowHandle));
                    }
                    catch (Exception ex5)
                    {
                        ex5.smethod_0();
                        this.method_0();
                        return;
                    }
                    base.Size            = this.RegionSelectorControl.SelectionBounds.Size;
                    base.FormBorderStyle = FormBorderStyle.Fixed3D;
                    try
                    {
                        base.Location = Class410.smethod_14(mainWindowHandle).Location;
                        goto IL_60F;
                    }
                    catch (Exception ex6)
                    {
                        ex6.smethod_0();
                        this.method_0();
                        return;
                    }
                }
                try
                {
                    this.RegionSelectorControl.ScreenCapture = (this.bitmap_0 = Class364.smethod_3(mainWindowHandle, this.SelectionBounds));
                }
                catch (Exception ex7)
                {
                    ex7.smethod_0();
                    this.method_0();
                    return;
                }
                this.RegionSelectorControl.SelectionBounds = new Rectangle(Point.Empty, this.SelectionBounds.Size);
                base.Size            = this.SelectionBounds.Size;
                base.FormBorderStyle = FormBorderStyle.Fixed3D;
                try
                {
                    base.Location = Class410.smethod_14(mainWindowHandle).Location.smethod_10(this.SelectionBounds.Location);
                }
                catch (Exception ex8)
                {
                    ex8.smethod_0();
                    this.method_0();
                    return;
                }
IL_60F:
                if (this.FullSelect)
                {
                    this.RegionSelectorControl.SelectedRegion = new Rectangle(Point.Empty, this.RegionSelectorControl.SelectionBounds.Size);
                }
                else
                {
                    this.RegionSelectorControl.SelectedRegion = new Rectangle(this.SelectedRegion.Location.smethod_11(this.SelectionBounds.Location), this.SelectedRegion.Size);
                }
            }
            base.TopMost = true;
            base.BringToFront();
            base.Activate();
            switch (this.RegionSelectorType)
            {
            case Enum124.const_0:
                this.toolTip_0.SetToolTip(this.RegionSelectorControl, this.MovableResizeMessage);
                break;

            case Enum124.const_1:
                this.toolTip_0.SetToolTip(this.RegionSelectorControl, this.MovableMessage);
                break;

            case Enum124.const_2:
                this.toolTip_0.SetToolTip(this.RegionSelectorControl, this.LockedMessage);
                break;
            }
            this.RegionSelectorControl.Focus();
        }