Ejemplo n.º 1
0
 private void method_13(object sender, EventArgs e)
 {
     if (this.myGalleryViewer_0 != null)
     {
         Class410.smethod_10(base.ParentForm, this.myGalleryViewer_0);
     }
 }
 // Token: 0x06001ECC RID: 7884 RVA: 0x0000BF85 File Offset: 0x0000A185
 public static void smethod_1(IntPtr hWnd)
 {
     Class410.smethod_3(hWnd);
     Class265.RedrawWindow(hWnd, IntPtr.Zero, IntPtr.Zero, Enum45.flag_0 | Enum45.flag_2 | Enum45.flag_7 | Enum45.flag_8 | Enum45.flag_10);
     Class265.InvalidateRect(hWnd, IntPtr.Zero, true);
     Class265.UpdateWindow(hWnd);
 }
 // Token: 0x0600225D RID: 8797 RVA: 0x00074D50 File Offset: 0x00072F50
 private void btnSelector_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         Class335.smethod_2(WindowSelector.string_2, true);
         if (this.eventHandler_1 != null)
         {
             this.eventHandler_1(this, EventArgs.Empty);
         }
         if (this.class366_0 == null)
         {
             Cursor.Current = Cursors.Cross;
         }
         else
         {
             Cursor.Current = this.class366_0.Cursor;
         }
         this.SelectedWindow = IntPtr.Zero;
         this.method_3();
         if (this.list_0 == null)
         {
             this.list_0 = new List <KeyValuePair <IntPtr, Rectangle> >();
         }
         Class410.smethod_12(this.list_0);
     }
 }
Ejemplo n.º 4
0
 // Token: 0x0600162A RID: 5674 RVA: 0x00035A8C File Offset: 0x00033C8C
 public void method_4()
 {
     if (this.func_0())
     {
         Class410.smethod_23(new HandleRef(this.class115_0.form_0, this.class116_0.intptr_0), FormWindowState.Normal, null);
     }
 }
Ejemplo n.º 5
0
 // Token: 0x06001636 RID: 5686 RVA: 0x00035CA0 File Offset: 0x00033EA0
 public void method_16(object sender, FormClosingEventArgs e)
 {
     this.toonTownParentForm_0.timer_0.Enabled = false;
     if (this.func_1())
     {
         this.action_4();
         Class265.SetParent(this.class116_0.intptr_0, this.intptr_0);
         Enum79 @enum = (Enum79)Class265.smethod_2(this.class116_0.intptr_0, Enum55.const_3);
         @enum &= ~Enum79.flag_2;
         @enum |= (Enum79)2147483648U;
         @enum |= Enum79.flag_19;
         @enum |= Enum79.flag_14;
         @enum |= Enum79.flag_9;
         Class265.smethod_4(this.class116_0.intptr_0, Enum55.const_3, (int)@enum);
         Rectangle       rectangle;
         FormWindowState formWindowState = Class410.smethod_22(new HandleRef(this.toonTownParentForm_0, this.toonTownParentForm_0.Handle), out rectangle);
         if (formWindowState.HasFlag(FormWindowState.Minimized))
         {
             Class410.smethod_23(new HandleRef(this.toonTownParentForm_0, this.class116_0.intptr_0), formWindowState, new Rectangle?(rectangle));
         }
         else
         {
             this.action_6();
             this.action_8(null, rectangle);
             this.action_7();
             Class410.smethod_23(new HandleRef(this.toonTownParentForm_0, this.class116_0.intptr_0), formWindowState, null);
         }
         this.action_5();
     }
     this.class115_0.class141_0.Dispose();
     this.toonTownParentForm_0.Dispose();
     this.class115_0.form_0.Close();
     ToonTownParentForm.hashSet_0.Remove(this.int_0);
 }
        // Token: 0x060023CD RID: 9165 RVA: 0x000790CC File Offset: 0x000772CC
        public static Bitmap smethod_3(IntPtr hWnd, Rectangle rec)
        {
            Rectangle rectangle = Class410.smethod_16(hWnd);

            if (rec.Size.Height + rec.Y > rectangle.Size.Height || rec.Size.Width + rec.X > rectangle.Size.Width)
            {
                throw new ArgumentException(string.Format(Class364.string_1, rec.Size, rec.Location, rectangle.Size));
            }
            rec.X += rectangle.X;
            rec.Y += rectangle.Y;
            return(Class364.smethod_4(Class265.GetDesktopWindow(), rec));
        }
Ejemplo n.º 7
0
 // Token: 0x0600299C RID: 10652 RVA: 0x0009F9D8 File Offset: 0x0009DBD8
 public static void smethod_3(Point p)
 {
     Cursor.Position = p;
     if (!Class265.SetCursorPos(p.X, p.Y))
     {
         new Win32Exception().smethod_0();
         Class316 @class = new Class316();
         Point    p2     = Class410.smethod_13(p);
         if (!Class365.smethod_0(@class.method_5(p2)))
         {
             Class265.mouse_event(Enum129.flag_0 | Enum129.flag_11, (uint)p2.X, (uint)p2.Y, 0U, IntPtr.Zero);
         }
     }
 }
Ejemplo n.º 8
0
 // Token: 0x06001627 RID: 5671 RVA: 0x00035968 File Offset: 0x00033B68
 public void method_1()
 {
     if (this.class115_0.class141_0.ProcessOpen)
     {
         int processId = Class265.GetProcessId(this.class115_0.class141_0.Process.Handle);
         if (processId != 0 && this.int_0 == processId)
         {
             using (Process processById = Process.GetProcessById(processId))
             {
                 Class410.smethod_8(this.toonTownParentForm_0, processById.MainWindowHandle);
             }
         }
     }
 }
        // Token: 0x06001ECB RID: 7883 RVA: 0x00065248 File Offset: 0x00063448
        public static void smethod_0(IntPtr hWnd)
        {
            IntPtr windowDC = Class265.GetWindowDC(hWnd);

            using (Graphics graphics = Graphics.FromHdc(windowDC))
            {
                using (SolidBrush solidBrush = new SolidBrush(Color.FromArgb(100, Color.Red)))
                {
                    graphics.FillRectangle(solidBrush, Class410.smethod_19(hWnd));
                }
            }
            if (Class265.ReleaseDC(hWnd, windowDC) == 0)
            {
                throw new Win32Exception();
            }
            Class410.smethod_4(hWnd);
        }
Ejemplo n.º 10
0
    public void method_5(Stream A_0)
    {
        if (A_0 == null)
        {
            throw new ArgumentNullException();
        }
        Stream stream = null;

        if (!A_0.CanSeek)
        {
            stream = A_0;
            A_0    = new MemoryStream();
        }
        this.stream_0          = A_0;
        this.stream_0.Position = 0x200L;
        this.class522_0        = new Class522();
        this.class917_0        = new Class917(this.stream_0, this.class522_0);
        this.class916_0        = new Class916();
        this.memoryStream_0    = new MemoryStream();
        this.class410_0        = new Class410();
        this.method_6(this.class1089_0, null);
        if (this.memoryStream_0.Length > 0L)
        {
            int num;
            this.class410_0.method_0(0).uint_4 = this.method_8(this.memoryStream_0, true);
            this.class410_0.method_0(0).long_2 = this.memoryStream_0.Length;
            this.class522_0.uint_3             = this.method_7(this.class916_0.method_4(), true, out num);
            this.class522_0.int_7 = num;
        }
        else
        {
            this.class522_0.uint_3 = 0xfffffffe;
        }
        this.class522_0.uint_2 = this.method_8(this.class410_0.method_7(), true);
        this.class917_0.method_8();
        this.stream_0.Position = 0L;
        this.class522_0.method_1(new BinaryWriter(this.stream_0, Encoding.Unicode));
        this.stream_0.Position = this.stream_0.Length;
        if (stream != null)
        {
            A_0.Position = 0L;
            ((MemoryStream)A_0).WriteTo(stream);
            A_0.Close();
            A_0 = stream;
        }
    }
Ejemplo n.º 11
0
        // Token: 0x060014E9 RID: 5353 RVA: 0x0002A0D4 File Offset: 0x000282D4
        protected void method_0()
        {
            Enum17 @enum = (Enum17)Class265.smethod_2(base.Handle, Enum55.const_4);

            if ([email protected](Enum17.flag_7))
            {
                Class265.smethod_4(base.Handle, Enum55.const_4, (int)(@enum | Enum17.flag_7));
            }
            using (Bitmap bitmap = new Bitmap(base.Width, base.Height))
            {
                using (Graphics graphics = Graphics.FromImage(bitmap))
                {
                    this.vmethod_0(graphics);
                }
                Class410.smethod_0(base.Handle, base.Location, base.Size, bitmap);
            }
        }
 // Token: 0x06001794 RID: 6036 RVA: 0x0003DDC4 File Offset: 0x0003BFC4
 private void method_8()
 {
     if (this.class142_0.ToonTownProcess.ProcessOpen)
     {
         Point point;
         try
         {
             Rectangle rec = Class410.smethod_16(this.intptr_0);
             point = new Point(rec.smethod_10() - base.Width / 2, rec.Bottom - base.Height);
         }
         catch (Win32Exception)
         {
             return;
         }
         if (base.Location != point)
         {
             base.Location = point;
         }
     }
 }
Ejemplo n.º 13
0
 // Token: 0x0600163B RID: 5691 RVA: 0x00035E2C File Offset: 0x0003402C
 public void method_21()
 {
     if (this.func_1())
     {
         if (this.toonTownParentForm_0.WindowState != FormWindowState.Minimized)
         {
             Rectangle left = Class410.smethod_15(this.class116_0.intptr_0, this.toonTownParentForm_0.Handle);
             if (left != this.toonTownParentForm_0.ClientRectangle)
             {
                 this.action_9(new IntPtr?(this.toonTownParentForm_0.Handle), this.toonTownParentForm_0.ClientRectangle);
                 return;
             }
         }
     }
     else
     {
         this.action_0();
         this.toonTownParentForm_0.Close();
     }
 }
Ejemplo n.º 14
0
        // Token: 0x0600280B RID: 10251 RVA: 0x00093E4C File Offset: 0x0009204C
        public static Enum107 smethod_0(Class141 toontownWindow, Class150 original_capture, Struct46 bounds, Class104 settings)
        {
            if (original_capture == null)
            {
                return(Enum107.const_2);
            }
            if (bounds.IsSizeEmpty)
            {
                return(Enum107.const_2);
            }
            IntPtr mainWindowHandle = toontownWindow.MainWindowHandle;

            if (!toontownWindow.ProcessOpen)
            {
                return(Enum107.const_2);
            }
            if (original_capture != null && !Struct46.smethod_0(bounds, Struct46.struct46_0))
            {
                Rectangle rec = bounds.method_0(Class410.smethod_16(mainWindowHandle).Size);
                Enum107   result;
                using (Bitmap bitmap = Class364.smethod_3(mainWindowHandle, rec))
                {
                    using (Class125 @class = new Class125(bitmap))
                    {
                        using (Class150 class2 = new Class150(@class))
                        {
                            if (Class150.smethod_1(class2, original_capture, settings.MaxColorRange))
                            {
                                result = Enum107.const_0;
                            }
                            else
                            {
                                result = Enum107.const_1;
                            }
                        }
                    }
                }
                return(result);
            }
            return(Enum107.const_2);
        }
Ejemplo n.º 15
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();
                    }
                }
Ejemplo n.º 16
0
        // Token: 0x0600299D RID: 10653 RVA: 0x0009FA44 File Offset: 0x0009DC44
        public static void smethod_4(IntPtr hWnd, Point p)
        {
            Rectangle rectangle = Class410.smethod_16(hWnd);

            if (p.X < 0)
            {
                p.X = 0;
            }
            if (p.Y < 0)
            {
                p.Y = 0;
            }
            if (p.X > rectangle.Width)
            {
                p.X = rectangle.Width;
            }
            if (p.Y > rectangle.Height)
            {
                p.Y = rectangle.Height;
            }
            p.X += rectangle.X;
            p.Y += rectangle.Y;
            Class465.smethod_3(p);
        }
Ejemplo n.º 17
0
    private void method_9()
    {
        int num = 4;

        this.class410_0 = new Class410();
        BinaryReader reader = new BinaryReader(this.stream_0, Encoding.Unicode);
        uint         num2   = this.class522_0.uint_2;
        Class335     class2 = new Class335();

        while (num2 != 0xfffffffe)
        {
            this.stream_0.Position = Class967.smethod_0(num2, true);
            for (int i = 0; i < 4; i++)
            {
                this.class410_0.method_3(new Class1090(reader));
            }
            class2.Interface34.imethod_1(num2);
            num2 = this.class917_0.method_0(num2);
            if (class2.Interface34.imethod_3(num2))
            {
                throw new InvalidOperationException(BookmarkStart.b("縩䐫䬭ု䄱䀳䐵䴷夹䠻䬽㈿❁⁃晅㭇㹉⍋㱍ㅏ㕑ㅓ癕㹗㍙せ㭝䁟ᅡţͥէᥩ䱫ᩭὯ剱ᙳ፵塷᥹፻౽ꚇꪉ쪋쾍쒏늑秊ﶛ캟톡蒣얥톧즩삫쮭쎯鲱", num));
            }
        }
    }
Ejemplo n.º 18
0
 // Token: 0x06001DE3 RID: 7651 RVA: 0x00060CF0 File Offset: 0x0005EEF0
 private static void smethod_0()
 {
     using (MemoryMappedFile memoryMappedFile = MemoryMappedFile.OpenExisting(Class283.string_13, MemoryMappedFileRights.Read))
     {
         using (MemoryMappedViewStream memoryMappedViewStream = memoryMappedFile.CreateViewStream(0L, (long)Class283.int_0, MemoryMappedFileAccess.Read))
         {
             using (BinaryReader binaryReader = new BinaryReader(memoryMappedViewStream))
             {
                 int  processId = binaryReader.ReadInt32();
                 long value     = binaryReader.ReadInt64();
                 using (Process currentProcess = Process.GetCurrentProcess())
                 {
                     using (Process processById = Process.GetProcessById(processId))
                     {
                         if (!processById.Responding || !Class410.smethod_28(new IntPtr(value), Environment.CommandLine, new IntPtr(currentProcess.Id), 5000U))
                         {
                             DialogBox.smethod_3(Class283.string_11, Class283.string_12);
                         }
                     }
                 }
             }
         }
     }
 }
 public override void Visit(Class410 c) { }
Ejemplo n.º 20
0
 // Token: 0x06001615 RID: 5653 RVA: 0x00035214 File Offset: 0x00033414
 public static ToonTownParentForm smethod_2(Form parent)
 {
     ToonTownParentForm.Class115 @class = new ToonTownParentForm.Class115();
     @class.form_0     = parent;
     @class.class141_0 = new Class141();
     if (ToonTownParentForm.smethod_1(@class.class141_0, @class.form_0))
     {
         Func <bool> func = null;
         ToonTownParentForm.Class116 class2 = new ToonTownParentForm.Class116();
         class2.class115_0 = @class;
         class2.intptr_0   = @class.class141_0.MainWindowHandle;
         Enum79 @enum = (Enum79)Class265.smethod_2(class2.intptr_0, Enum55.const_3);
         if (@enum.HasFlag(Enum79.flag_19) && @enum.HasFlag(Enum79.flag_14) && @enum.HasFlag(Enum79.flag_9))
         {
             ToonTownParentForm.Class117 class3 = new ToonTownParentForm.Class117();
             class3.class116_0 = class2;
             class3.class115_0 = @class;
             class3.int_0      = @class.class141_0.Process.Id;
             ToonTownParentForm.hashSet_0.Add(class3.int_0);
             Rectangle       bounds;
             FormWindowState formWindowState = Class410.smethod_22(new HandleRef(@class.form_0, class2.intptr_0), out bounds);
             @enum &= ~(Enum79.flag_9 | Enum79.flag_10);
             @enum &= ~Enum79.flag_14;
             @enum |= Enum79.flag_2;
             @enum &= ~Enum79.flag_1;
             @enum &= ~Enum79.flag_9;
             Class265.smethod_4(class2.intptr_0, Enum55.const_3, (int)@enum);
             IntPtr handle = Class265.smethod_3(new HandleRef(@class.form_0, class2.intptr_0), Enum104.const_5);
             Icon   icon   = Icon.FromHandle(handle);
             class3.toonTownParentForm_0      = new ToonTownParentForm();
             class3.toonTownParentForm_0.Icon = icon;
             ToonTownParentForm.Class117 class4 = class3;
             if (func == null)
             {
                 func = new Func <bool>(class2.method_0);
             }
             class4.func_0   = func;
             class3.func_1   = new Func <bool>(class3.method_0);
             class3.action_0 = new Action(class3.method_1);
             class3.action_1 = new Action <Action>(class3.method_2);
             class3.action_2 = new Action(class3.method_3);
             class3.action_3 = new Action(class3.method_4);
             class3.action_4 = new Action(class3.method_5);
             class3.action_5 = new Action(class3.method_6);
             class3.action_6 = new Action(class3.method_7);
             class3.action_7 = new Action(class3.method_8);
             class3.action_8 = new Action <IntPtr?, Rectangle>(class3.method_9);
             class3.action_9 = new Action <IntPtr?, Rectangle>(class3.method_10);
             class3.toonTownParentForm_0.OnResizeStarted    += class3.method_11;
             class3.toonTownParentForm_0.OnResizeEnded      += class3.method_12;
             class3.toonTownParentForm_0.GotFocus           += class3.method_13;
             class3.toonTownParentForm_0.WindowStateChanged += class3.method_14;
             @class.class141_0.ProcessExited += class3.method_15;
             if (formWindowState.HasFlag(FormWindowState.Maximized))
             {
                 if (formWindowState.HasFlag(FormWindowState.Minimized))
                 {
                     Class410.smethod_23(new HandleRef(@class.form_0, class2.intptr_0), FormWindowState.Minimized, null);
                 }
                 else
                 {
                     Class410.smethod_23(new HandleRef(@class.form_0, class2.intptr_0), FormWindowState.Normal, null);
                 }
             }
             class3.intptr_0 = Class265.SetParent(class2.intptr_0, class3.toonTownParentForm_0.Handle);
             class3.toonTownParentForm_0.StartPosition = FormStartPosition.Manual;
             class3.toonTownParentForm_0.Bounds        = bounds;
             class3.action_9(new IntPtr?(class3.toonTownParentForm_0.Handle), class3.toonTownParentForm_0.ClientRectangle);
             Class410.smethod_23(new HandleRef(@class.form_0, class3.toonTownParentForm_0.Handle), formWindowState, null);
             class3.toonTownParentForm_0.FormClosing    += class3.method_16;
             class3.toonTownParentForm_0.OnCloseClicked += class3.method_17;
             class3.toonTownParentForm_0.timer_0.Tick   += class3.method_18;
             class3.toonTownParentForm_0.Shown          += class3.method_19;
             class3.toonTownParentForm_0.Show();
             return(class3.toonTownParentForm_0);
         }
         DialogBox.smethod_3("The ToonTown window appears to be full screen and cannot be used. Please change ToonTown to window mode and try again.", "Invalid ToonTown Window");
     }
     else
     {
         @class.class141_0.Dispose();
     }
     return(null);
 }
Ejemplo n.º 21
0
 private void method_17(object sender, EventArgs e)
 {
     Class410.smethod_10(this.myGalleryViewer_0, base.ParentForm);
 }
 // Token: 0x06001791 RID: 6033 RVA: 0x00007468 File Offset: 0x00005668
 protected void method_7()
 {
     Class410.smethod_8(this, this.intptr_0);
 }
Ejemplo n.º 23
0
        // Token: 0x06002370 RID: 9072 RVA: 0x000775A0 File Offset: 0x000757A0
        protected override void OnVisibleChanged(EventArgs e)
        {
            base.OnVisibleChanged(e);
            if (Class500.IsRunningOnMono)
            {
                return;
            }
            if ((base.Visible && this.ShowingAnimation == Enum70.flag_0) || (!base.Visible && this.HidingAnimation == Enum70.flag_0))
            {
                return;
            }
            Enum120 @enum = base.Visible ? Enum120.flag_0 : Enum120.flag_6;
            Enum70  enum2 = base.Visible ? this.ShowingAnimation : this.HidingAnimation;

            if (enum2 == Enum70.flag_9)
            {
                if (SystemInformation.IsMenuAnimationEnabled)
                {
                    if (SystemInformation.IsMenuFadeEnabled)
                    {
                        enum2 = Enum70.flag_7;
                    }
                    else
                    {
                        enum2 = (Enum70.flag_6 | (base.Visible ? Enum70.flag_3 : Enum70.flag_4));
                    }
                }
                else
                {
                    enum2 = Enum70.flag_0;
                }
            }
            if ((enum2 & (Enum70.flag_5 | Enum70.flag_6 | Enum70.flag_7 | Enum70.flag_8)) == Enum70.flag_0)
            {
                return;
            }
            if (this.bool_0)
            {
                if ((enum2 & Enum70.flag_4) != Enum70.flag_0)
                {
                    enum2 = ((enum2 & ~Enum70.flag_4) | Enum70.flag_3);
                }
                else if ((enum2 & Enum70.flag_3) != Enum70.flag_0)
                {
                    enum2 = ((enum2 & ~Enum70.flag_3) | Enum70.flag_4);
                }
            }
            if (this.bool_1)
            {
                if ((enum2 & Enum70.flag_2) != Enum70.flag_0)
                {
                    enum2 = ((enum2 & ~Enum70.flag_2) | Enum70.flag_1);
                }
                else if ((enum2 & Enum70.flag_1) != Enum70.flag_0)
                {
                    enum2 = ((enum2 & ~Enum70.flag_1) | Enum70.flag_2);
                }
            }
            @enum |= (Enum120)((Enum70)1048575 & enum2);
            Class410.smethod_9(this);
            Class410.smethod_11(this, this.AnimationDuration, @enum);
        }
 // Token: 0x06001797 RID: 6039 RVA: 0x000074AE File Offset: 0x000056AE
 protected void method_11(Struct46 bounds)
 {
     this.method_12(Class410.smethod_16(this.intptr_0), bounds);
 }
        // Token: 0x06001796 RID: 6038 RVA: 0x0003DE3C File Offset: 0x0003C03C
        protected void method_10(Struct42 pnt)
        {
            Rectangle window_bounds = Class410.smethod_16(this.intptr_0);

            this.method_13(window_bounds, pnt.method_0(new Point(window_bounds.Width, window_bounds.Height)));
        }
 // Token: 0x0600172D RID: 5933 RVA: 0x0003824C File Offset: 0x0003644C
 protected bool method_10(string message, string question, Struct46 ratio, out Class125 bmp, out Struct46 resulting_ratio)
 {
     bmp             = null;
     resulting_ratio = default(Struct46);
     if (!this.class141_0.ProcessOpen && !this.class141_0.smethod_1(this))
     {
         return(false);
     }
     using (Class499 @class = new Class499(this, true))
     {
         using (DialogBox dialogBox = new DialogBox(question, "Are you ready?", Enum90.const_0, null, false, Enum121.const_1, new Enum39[]
         {
             Enum39.const_0,
             Enum39.const_1
         }))
         {
             @class.method_1(dialogBox, DialogResult.OK);
             DialogResult dialogResult = dialogBox.ShowDialog();
             if (dialogResult != DialogResult.OK)
             {
                 return(false);
             }
             @class.method_4();
             @class.method_6();
         }
         if (this.class141_0.ProcessOpen)
         {
             Class410.smethod_8(this, this.class141_0.MainWindowHandle);
             using (CountDown countDown = new CountDown())
             {
                 @class.method_1(countDown, DialogResult.OK);
                 if (countDown.ShowDialog() == DialogResult.OK)
                 {
                     @class.method_6();
                     @class.method_4();
                     if (this.class141_0.ProcessOpen)
                     {
                         Class410.smethod_8(this, this.class141_0.MainWindowHandle);
                         EventHandler eventHandler        = null;
                         CaptureSetupForm.Class159 class2 = new CaptureSetupForm.Class159();
                         class2.regionSelector_0 = new RegionSelector(this.class141_0.MainWindowHandle);
                         try
                         {
                             @class.method_0(class2.regionSelector_0);
                             Rectangle rectangle = Class410.smethod_16(this.class141_0.MainWindowHandle);
                             class2.regionSelector_0.SelectionBounds      = Rectangle.Empty;
                             class2.regionSelector_0.SelectedRegion       = ratio.method_0(rectangle.Size);
                             class2.regionSelector_0.RegionSelectorType   = Enum124.const_0;
                             class2.regionSelector_0.FullSelect           = false;
                             class2.regionSelector_0.FullSize             = true;
                             class2.regionSelector_0.FullScreenCapture    = true;
                             class2.regionSelector_0.MovableResizeMessage = message + " Press any key to accept or escape to cancel.";
                             Form regionSelector_ = class2.regionSelector_0;
                             if (eventHandler == null)
                             {
                                 eventHandler = new EventHandler(class2.method_0);
                             }
                             regionSelector_.Shown += eventHandler;
                             if (class2.regionSelector_0.ShowDialog() == DialogResult.OK && class2.regionSelector_0.SelectedRegion.smethod_2())
                             {
                                 bmp             = class2.regionSelector_0.SelectedBitmap;
                                 resulting_ratio = Struct46.smethod_3(class2.regionSelector_0.SelectedRegion, new Rectangle(Point.Empty, rectangle.Size));
                                 return(true);
                             }
                         }
                         finally
                         {
                             if (class2.regionSelector_0 != null)
                             {
                                 ((IDisposable)class2.regionSelector_0).Dispose();
                             }
                         }
                     }
                 }
             }
         }
     }
     return(false);
 }
Ejemplo n.º 27
0
        private void method_1()
        {
            Rectangle rectangle = Class410.smethod_16(this.toonTownParentForm_0.Handle);

            this.parTeePuttGuideLine_0.Location = new Point(rectangle.Location.X + (rectangle.Width / 2 - this.parTeePuttGuideLine_0.Width / 2), rectangle.Location.Y + ParTeePutt.struct51_0.method_0(rectangle.Height));
        }
        // 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();
        }
 // Token: 0x0600179A RID: 6042 RVA: 0x000074E7 File Offset: 0x000056E7
 protected void method_14(Point p)
 {
     this.method_13(Class410.smethod_16(this.intptr_0), p);
 }
Ejemplo n.º 30
0
        // Token: 0x060023CC RID: 9164 RVA: 0x000790AC File Offset: 0x000772AC
        public static Bitmap smethod_2(IntPtr hWnd)
        {
            Rectangle rec = Class410.smethod_16(hWnd);

            return(Class364.smethod_4(Class265.GetDesktopWindow(), rec));
        }
 public abstract void Visit(Class410 c);
Ejemplo n.º 32
0
            // Token: 0x06001A3C RID: 6716 RVA: 0x0004D28C File Offset: 0x0004B48C
            public void method_0(object _)
            {
                IntPtr foregroundWindow = Class265.GetForegroundWindow();

                if (foregroundWindow == IntPtr.Zero)
                {
                    return;
                }
                Dictionary <IntPtr, Class205.Class127> dictionary = null;
                Struct21 hotkey = this.eventArgs18_0.State.Hotkey;

                lock (this.class205_0.dictionary_0)
                {
                    if (this.class205_0.dictionary_0.ContainsKey(hotkey))
                    {
                        dictionary = this.class205_0.dictionary_0[hotkey];
                        if (dictionary.ContainsKey(foregroundWindow))
                        {
                            this.class205_0.method_2(dictionary[foregroundWindow], true);
                            return;
                        }
                    }
                    Process process = null;
                    bool    flag2   = false;
                    try
                    {
                        process = Class265.smethod_7(foregroundWindow);
                        if (flag2 = (process.smethod_2().ToLower() == "toontown"))
                        {
                            Class87 @class = this.class205_0.class112_0.Hotkeys[hotkey];
                            Class205.Class206.Class207 class2 = new Class205.Class206.Class207();
                            class2.class206_0 = this;
                            switch (@class.HotkeyType)
                            {
                            case Enum40.const_0:
                                if (@class.StopOtherHotkeys)
                                {
                                    List <Class205.Class127> list = new List <Class205.Class127>();
                                    foreach (KeyValuePair <Struct21, Dictionary <IntPtr, Class205.Class127> > keyValuePair in this.class205_0.dictionary_0)
                                    {
                                        if (Struct21.smethod_1(keyValuePair.Key, hotkey) && keyValuePair.Value.ContainsKey(foregroundWindow))
                                        {
                                            list.Add(keyValuePair.Value[foregroundWindow]);
                                        }
                                    }
                                    foreach (Class205.Class127 hotkey2 in list)
                                    {
                                        this.class205_0.method_2(hotkey2, true);
                                    }
                                }
                                if (dictionary == null)
                                {
                                    this.class205_0.dictionary_0.Add(hotkey, dictionary = new Dictionary <IntPtr, Class205.Class127>());
                                }
                                class2.class127_0 = new Class205.Class127(foregroundWindow, process, @class);
                                dictionary.Add(foregroundWindow, class2.class127_0);
                                process.EnableRaisingEvents = true;
                                process.Exited += class2.method_0;
                                class2.class127_0.Terminated += class2.method_1;
                                if (process.HasExited)
                                {
                                    this.class205_0.method_2(class2.class127_0, false);
                                }
                                else
                                {
                                    class2.class127_0.method_5();
                                }
                                break;

                            case Enum40.const_1:
                            {
                                Process[] array = null;
                                try
                                {
                                    array = Class156.smethod_3("toontown");
                                    if (array.Length > 1)
                                    {
                                        int i = 0;
                                        while (i < array.Length)
                                        {
                                            if (!(array[i].smethod_0() == foregroundWindow))
                                            {
                                                i++;
                                            }
                                            else
                                            {
                                                IntPtr intPtr;
                                                if (i == array.Length - 1)
                                                {
                                                    intPtr = array[0].smethod_0();
                                                }
                                                else
                                                {
                                                    intPtr = array[i + 1].smethod_0();
                                                }
                                                if (intPtr != IntPtr.Zero)
                                                {
                                                    Class410.smethod_8(this.class205_0, intPtr);
                                                    break;
                                                }
                                                break;
                                            }
                                        }
                                    }
                                }
                                finally
                                {
                                    if (array != null)
                                    {
                                        foreach (Process process2 in array)
                                        {
                                            process2.Dispose();
                                        }
                                    }
                                }
                                break;
                            }
                            }
                        }
                    }
                    finally
                    {
                        if (!flag2 && process != null)
                        {
                            process.Dispose();
                        }
                    }
                }
            }