x3c41176af7e54b01.cs
上传用户:xlxx0122
上传日期:2015-04-24
资源大小:3904k
文件大小:87k
源码类别:

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin.InternalControls
  2. {
  3.     using Microsoft.Win32;
  4.     using Sunisoft.IrisSkin;
  5.     using System;
  6.     using System.Collections;
  7.     using System.ComponentModel;
  8.     using System.Drawing;
  9.     using System.Drawing.Drawing2D;
  10.     using System.Drawing.Text;
  11.     using System.Runtime.CompilerServices;
  12.     using System.Windows.Forms;
  13.     [ToolboxItem(false)]
  14.     internal class x3c41176af7e54b01 : ContainerControl, IMessageFilter
  15.     {
  16.         protected Form activeChild;
  17.         protected x6fd23f8bad2f3ced animate;
  18.         protected bool animateFirst;
  19.         protected x1f5697535eab37b9 animateStyle;
  20.         protected int animateTime;
  21.         protected const int BoxExpandSides = 2;
  22.         protected const int BoxExpandUpper = 1;
  23.         protected int breadthGap;
  24.         protected const int ButtonLength = 0x10;
  25.         protected const int ChevronIndex = 3;
  26.         protected const int ChevronLength = 12;
  27.         protected x5f4b657f68f87baa chevronStartCommand;
  28.         protected x3c41176af7e54b01 childMenu;
  29.         protected x5d3356d9dffccb60 closeButton;
  30.         protected const int CloseIndex = 2;
  31.         protected bool defaultFont;
  32.         protected bool deselectReset;
  33.         protected xdbfa333b4cd503e0 direction;
  34.         protected bool dismissTransfer;
  35.         protected ArrayList drawCommands;
  36.         protected bool drawUpwards;
  37.         protected bool exitLoop;
  38.         protected bool expandAllTogether;
  39.         protected xc69458cec0f3af75 glyphFading;
  40.         protected bool highlightInfrequent;
  41.         protected bool ignoreMouseMove;
  42.         protected const int LengthGap = 3;
  43.         protected bool manualFocus;
  44.         protected Form mdiContainer;
  45.         protected xd53b20b7b4b2a08a menuCommands;
  46.         protected static ImageList menuImages = x58dd58a96343fde0.LoadBitmapStrip(System.Type.GetType("Sunisoft.IrisSkin.SkinEngine"), "Sunisoft.IrisSkin.ImagesMenuControl.bmp", new Size(0x10, 0x10), new Point(0, 0));
  47.         protected x5d3356d9dffccb60 minButton;
  48.         protected const int MinIndex = 0;
  49.         protected bool mouseOver;
  50.         protected bool multiLine;
  51.         protected IntPtr oldFocus;
  52.         protected const int PendantLength = 0x30;
  53.         protected const int PendantOffset = 3;
  54.         protected bool plainAsBlock;
  55.         protected x902c4aee45bfd906 popupMenu;
  56.         protected bool rememberExpansion;
  57.         protected x5d3356d9dffccb60 restoreButton;
  58.         protected const int RestoreIndex = 1;
  59.         protected int rowHeight;
  60.         protected int rowWidth;
  61.         protected bool selected;
  62.         protected const int SeparatorWidth = 15;
  63.         protected const int ShadowGap = 4;
  64.         protected const int ShadowYOffset = 4;
  65.         protected const int SubMenuBorderAdjust = 2;
  66.         protected static bool supportsLayered = (OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows) != null);
  67.         protected int trackItem;
  68.         protected readonly uint WM_OPERATEMENU = 0x401;
  69.         private x5f4b657f68f87baa[] x4dedac25f8166fb5;
  70.         private x5f4b657f68f87baa x54f4e17b11b07b8c = new x5f4b657f68f87baa("-");
  71.         private SkinEngine xcab6a0e662ada486;
  72.         public event x26569a56dfbc2c6d Deselected;
  73.         public event x26569a56dfbc2c6d Selected;
  74.         public x3c41176af7e54b01(SkinEngine engine)
  75.         {
  76.             this.x54f4e17b11b07b8c.xb2504b89d66feca9 = true;
  77.             this.Engine = engine;
  78.             this.trackItem = -1;
  79.             this.oldFocus = IntPtr.Zero;
  80.             this.minButton = null;
  81.             this.popupMenu = null;
  82.             this.activeChild = null;
  83.             this.closeButton = null;
  84.             this.mdiContainer = null;
  85.             this.restoreButton = null;
  86.             this.chevronStartCommand = null;
  87.             this.animateFirst = true;
  88.             this.exitLoop = false;
  89.             this.selected = false;
  90.             this.multiLine = false;
  91.             this.mouseOver = false;
  92.             this.defaultFont = true;
  93.             this.manualFocus = false;
  94.             this.drawUpwards = false;
  95.             this.plainAsBlock = false;
  96.             this.ignoreMouseMove = false;
  97.             this.deselectReset = true;
  98.             this.expandAllTogether = true;
  99.             this.rememberExpansion = true;
  100.             this.highlightInfrequent = true;
  101.             this.dismissTransfer = false;
  102.             this.direction = xdbfa333b4cd503e0.Horizontal;
  103.             this.menuCommands = new xd53b20b7b4b2a08a();
  104.             this.glyphFading = xc69458cec0f3af75.Default;
  105.             this.Dock = DockStyle.Top;
  106.             this.Cursor = Cursors.Arrow;
  107.             this.animateTime = 100;
  108.             this.animate = x6fd23f8bad2f3ced.System;
  109.             this.animateStyle = x1f5697535eab37b9.System;
  110.             base.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
  111.             base.SetStyle(ControlStyles.Selectable, false);
  112.             this.menuCommands.Cleared += new x66edf89974942dab(this.x4d43bed1b4aede85);
  113.             this.menuCommands.Inserted += new x2f6aff803d60b50c(this.x6b08695ba39cf4ca);
  114.             this.menuCommands.Removed += new x2f6aff803d60b50c(this.x5cb0c63a7cf35b53);
  115.             SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(this.x288bea726e7cd27e);
  116.             if (this.Engine.MenuFont == null)
  117.             {
  118.                 this.x21498b72da0020ba(SystemInformation.MenuFont);
  119.             }
  120.             else
  121.             {
  122.                 this.x21498b72da0020ba(this.Engine.MenuFont);
  123.             }
  124.             base.TabStop = false;
  125.             base.Height = this.rowHeight;
  126.             Application.AddMessageFilter(this);
  127.             this.Engine.CurrentSkinChanged += new SkinChanged(this.x273cbe3cfa28ea94);
  128.         }
  129.         protected override void Dispose(bool disposing)
  130.         {
  131.             if (disposing)
  132.             {
  133.                 SystemEvents.UserPreferenceChanged -= new UserPreferenceChangedEventHandler(this.x288bea726e7cd27e);
  134.                 if (this.mdiContainer != null)
  135.                 {
  136.                     this.mdiContainer.MdiChildActivate -= new EventHandler(this.x23daf02978257d54);
  137.                 }
  138.                 if (this.activeChild != null)
  139.                 {
  140.                     this.activeChild.SizeChanged -= new EventHandler(this.xfbce0f1d6df984cd);
  141.                 }
  142.             }
  143.             base.Dispose(disposing);
  144.         }
  145.         public virtual void OnDeselected(x5f4b657f68f87baa mc)
  146.         {
  147.             if (this.xd42ce0324cbc114a != null)
  148.             {
  149.                 this.xd42ce0324cbc114a(mc);
  150.             }
  151.         }
  152.         protected override void OnEnabledChanged(EventArgs e)
  153.         {
  154.             base.OnEnabledChanged(e);
  155.             if (!base.Enabled && this.selected)
  156.             {
  157.                 if (this.popupMenu != null)
  158.                 {
  159.                     this.popupMenu.Dismiss();
  160.                     this.popupMenu = null;
  161.                 }
  162.                 this.xcb97d93f0d5ce4a8();
  163.                 this.drawUpwards = false;
  164.                 this.xa23d095e6e52c5f3();
  165.             }
  166.             this.x51ce8d251f940283();
  167.             base.Invalidate();
  168.         }
  169.         protected override void OnMouseDown(MouseEventArgs e)
  170.         {
  171.             this.xbcc99f3d02a70fe7(e.X, e.Y);
  172.             base.OnMouseDown(e);
  173.         }
  174.         protected override void OnMouseLeave(EventArgs e)
  175.         {
  176.             this.mouseOver = false;
  177.             if ((!this.manualFocus && (this.trackItem != -1)) && !this.selected)
  178.             {
  179.                 this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
  180.             }
  181.             base.OnMouseLeave(e);
  182.         }
  183.         protected override void OnMouseMove(MouseEventArgs e)
  184.         {
  185.             if (this.ignoreMouseMove)
  186.             {
  187.                 this.ignoreMouseMove = false;
  188.             }
  189.             else
  190.             {
  191.                 this.xdd922e6d558c59d4(e.X, e.Y);
  192.             }
  193.             base.OnMouseMove(e);
  194.         }
  195.         protected override void OnMouseUp(MouseEventArgs e)
  196.         {
  197.             if (((this.trackItem != -1) && this.selected) && (this.popupMenu == null))
  198.             {
  199.                 this.xcb97d93f0d5ce4a8();
  200.                 this.drawUpwards = false;
  201.                 this.x2cc390e9409b0f3f(this.trackItem, true);
  202.                 this.xa23d095e6e52c5f3();
  203.             }
  204.             base.OnMouseUp(e);
  205.         }
  206.         protected override void OnPaint(PaintEventArgs e)
  207.         {
  208.             if ((base.Width != 0) || (base.Height != 0))
  209.             {
  210.                 Rectangle destRect = new Rectangle(0, 0, base.Width, base.Height);
  211.                 Bitmap image = this.Engine.Res.Bitmaps.SKIN2_MENUBAR;
  212.                 using (Bitmap bitmap2 = new Bitmap(base.Width, base.Height))
  213.                 {
  214.                     using (Graphics graphics = Graphics.FromImage(bitmap2))
  215.                     {
  216.                         if (image != null)
  217.                         {
  218.                             graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, x448fd9ab43628c71.DrawImageAttrTileY);
  219.                         }
  220.                         else
  221.                         {
  222.                             if (this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR != this.Engine.Res.Colors.SKIN2_MENUBARENDCOLOR)
  223.                             {
  224.                                 using (LinearGradientBrush brush = new LinearGradientBrush(destRect, this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR, this.Engine.Res.Colors.SKIN2_MENUBARENDCOLOR, LinearGradientMode.Vertical))
  225.                                 {
  226.                                     graphics.FillRectangle(brush, destRect);
  227.                                     goto Label_011C;
  228.                                 }
  229.                             }
  230.                             graphics.FillRectangle(this.Engine.Res.Brushes.SKIN2_MENUBARSTARTCOLOR, destRect);
  231.                         }
  232.                     }
  233.                 Label_011C:
  234.                     e.Graphics.DrawImageUnscaled(bitmap2, 0, 0);
  235.                 }
  236.                 this.x05a10b378cdf8119(e.Graphics);
  237.                 base.OnPaint(e);
  238.             }
  239.         }
  240.         protected override void OnResize(EventArgs e)
  241.         {
  242.             this.x39e008704a72ea56();
  243.             base.Invalidate();
  244.             base.OnResize(e);
  245.         }
  246.         public virtual void OnSelected(x5f4b657f68f87baa mc)
  247.         {
  248.             if (this.xaa7558c320af04eb != null)
  249.             {
  250.                 this.xaa7558c320af04eb(mc);
  251.             }
  252.         }
  253.         protected override void OnSystemColorsChanged(EventArgs e)
  254.         {
  255.             this.x39e008704a72ea56();
  256.             base.Invalidate();
  257.             base.OnSystemColorsChanged(e);
  258.         }
  259.         public bool PreFilterMessage(ref Message msg)
  260.         {
  261.             Form form = base.FindForm();
  262.             if (((form != null) && (form == Form.ActiveForm)) && form.ContainsFocus)
  263.             {
  264.                 switch (((uint) msg.Msg))
  265.                 {
  266.                     case 260:
  267.                     {
  268.                         if (!base.Enabled || (((int) msg.WParam) == 0x12))
  269.                         {
  270.                             break;
  271.                         }
  272.                         Shortcut shortcut2 = (Shortcut) (0x40000 + ((int) msg.WParam));
  273.                         if (!this.x4d7a264852c9d2f3(shortcut2, this.menuCommands))
  274.                         {
  275.                             if (this.x65c1cc54cc8b0e75((char) ((int) msg.WParam)))
  276.                             {
  277.                                 if (!this.manualFocus)
  278.                                 {
  279.                                     this.x60cdc457bc0610f8();
  280.                                 }
  281.                                 return true;
  282.                             }
  283.                             break;
  284.                         }
  285.                         return true;
  286.                     }
  287.                     case 0x105:
  288.                         if (!base.Enabled || (((int) msg.WParam) != 0x12))
  289.                         {
  290.                             break;
  291.                         }
  292.                         if (this.drawCommands.Count > 0)
  293.                         {
  294.                             if (this.trackItem == -1)
  295.                             {
  296.                                 for (int i = 0; i < this.drawCommands.Count; i++)
  297.                                 {
  298.                                     Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[i] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  299.                                     if (!xccebff.Separator && (xccebff.Chevron || xccebff.MenuCommand.Enabled))
  300.                                     {
  301.                                         this.trackItem = this.xa7cbddf1ec7a27e7(-1, i);
  302.                                         break;
  303.                                     }
  304.                                 }
  305.                             }
  306.                             this.x60cdc457bc0610f8();
  307.                         }
  308.                         return true;
  309.                     case 0x100:
  310.                     {
  311.                         if (!base.Enabled)
  312.                         {
  313.                             break;
  314.                         }
  315.                         ushort keyState = x61467fe65a98f20c.GetKeyState(0x10);
  316.                         ushort num2 = x61467fe65a98f20c.GetKeyState(0x11);
  317.                         int wParam = (int) msg.WParam;
  318.                         if ((keyState & 0x8000) != 0)
  319.                         {
  320.                             wParam += 0x10000;
  321.                         }
  322.                         if ((num2 & 0x8000) != 0)
  323.                         {
  324.                             wParam += 0x20000;
  325.                         }
  326.                         Shortcut shortcut = (Shortcut) wParam;
  327.                         return this.x4d7a264852c9d2f3(shortcut, this.menuCommands);
  328.                     }
  329.                 }
  330.             }
  331.             return false;
  332.         }
  333.         protected override void WndProc(ref Message m)
  334.         {
  335.             if (m.Msg == this.WM_OPERATEMENU)
  336.             {
  337.                 this.xa9f9739090793818(ref m);
  338.             }
  339.             else if (m.Msg == 0x87)
  340.             {
  341.                 this.x92bcd6bad6f29e72(ref m);
  342.                 return;
  343.             }
  344.             base.WndProc(ref m);
  345.         }
  346.         protected void x05a10b378cdf8119(Graphics x4b101060f4767186)
  347.         {
  348.             for (int i = 0; i < this.drawCommands.Count; i++)
  349.             {
  350.                 Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[i] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  351.                 this.xb5a5bdae3ba8936b(x4b101060f4767186, xccebff, i == this.trackItem);
  352.             }
  353.         }
  354.         internal void x0760506d6abf77a2(Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xd2a8bb4342ab4ef6, bool xacc37ebdd71fcc44, bool xec106df5fe2fbc8e)
  355.         {
  356.             if (!base.IsDisposed)
  357.             {
  358.                 Point point;
  359.                 Point point2;
  360.                 int num;
  361.                 Rectangle drawRect = xd2a8bb4342ab4ef6.DrawRect;
  362.                 if (this.direction == xdbfa333b4cd503e0.Horizontal)
  363.                 {
  364.                     point = base.PointToScreen(new Point(xd2a8bb4342ab4ef6.DrawRect.Left + 1, (drawRect.Bottom - 3) - 2));
  365.                 }
  366.                 else
  367.                 {
  368.                     point = base.PointToScreen(new Point(xd2a8bb4342ab4ef6.DrawRect.Right - this.breadthGap, (drawRect.Top + 2) - 1));
  369.                 }
  370.                 if (this.direction == xdbfa333b4cd503e0.Horizontal)
  371.                 {
  372.                     point2 = base.PointToScreen(new Point(xd2a8bb4342ab4ef6.DrawRect.Left + 1, ((drawRect.Top + this.breadthGap) + 3) - 1));
  373.                 }
  374.                 else
  375.                 {
  376.                     point2 = base.PointToScreen(new Point(xd2a8bb4342ab4ef6.DrawRect.Right - this.breadthGap, (drawRect.Bottom + 3) + 1));
  377.                 }
  378.                 if (this.direction == xdbfa333b4cd503e0.Horizontal)
  379.                 {
  380.                     num = xd2a8bb4342ab4ef6.DrawRect.Width - 2;
  381.                 }
  382.                 else
  383.                 {
  384.                     num = xd2a8bb4342ab4ef6.DrawRect.Height - 2;
  385.                 }
  386.                 this.popupMenu = new x902c4aee45bfd906(this.Engine);
  387.                 int num2 = 0;
  388.                 x5f4b657f68f87baa xfbffbaa = null;
  389.                 this.popupMenu.RememberExpansion = this.rememberExpansion;
  390.                 this.popupMenu.HighlightInfrequent = this.highlightInfrequent;
  391.                 this.popupMenu.Font = base.Font;
  392.                 this.popupMenu.Animate = this.animate;
  393.                 this.popupMenu.AnimateStyle = this.animateStyle;
  394.                 this.popupMenu.AnimateTime = this.animateTime;
  395.                 if (xd2a8bb4342ab4ef6.Chevron)
  396.                 {
  397.                     xd53b20b7b4b2a08a xdbbbbaa = new xd53b20b7b4b2a08a();
  398.                     bool flag = false;
  399.                     foreach (x5f4b657f68f87baa xfbffbaa2 in this.menuCommands)
  400.                     {
  401.                         if (!flag && (xfbffbaa2 == this.chevronStartCommand))
  402.                         {
  403.                             flag = true;
  404.                         }
  405.                         if (flag)
  406.                         {
  407.                             xdbbbbaa.Add(xfbffbaa2);
  408.                         }
  409.                     }
  410.                     xfbffbaa = this.popupMenu.x6192996f26aa9421(point, point2, this.direction, xdbbbbaa, num, xacc37ebdd71fcc44, this, this.animateFirst, ref num2);
  411.                 }
  412.                 else
  413.                 {
  414.                     xd2a8bb4342ab4ef6.MenuCommand.OnPopupStart();
  415.                     this.popupMenu.ShowInfrequent = xd2a8bb4342ab4ef6.MenuCommand.MenuCommands.ShowInfrequent;
  416.                     xfbffbaa = this.popupMenu.x6192996f26aa9421(point, point2, this.direction, xd2a8bb4342ab4ef6.MenuCommand.MenuCommands, num, xacc37ebdd71fcc44, this, this.animateFirst, ref num2);
  417.                 }
  418.                 this.animateFirst = false;
  419.                 if (this.expandAllTogether && this.x35a6958370d758dd(this.menuCommands))
  420.                 {
  421.                     this.xe8febcf8320c4113(this.menuCommands, true);
  422.                 }
  423.                 if (num2 == 0)
  424.                 {
  425.                     this.mouseOver = false;
  426.                     if (!this.dismissTransfer)
  427.                     {
  428.                         this.xcb97d93f0d5ce4a8();
  429.                         this.drawUpwards = false;
  430.                         if (!base.IsDisposed)
  431.                         {
  432.                             if (xec106df5fe2fbc8e)
  433.                             {
  434.                                 this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
  435.                             }
  436.                             else if (this.trackItem != -1)
  437.                             {
  438.                                 this.x2cc390e9409b0f3f(this.trackItem, true);
  439.                             }
  440.                         }
  441.                     }
  442.                     else
  443.                     {
  444.                         this.dismissTransfer = false;
  445.                     }
  446.                 }
  447.                 if (!xd2a8bb4342ab4ef6.Chevron)
  448.                 {
  449.                     xd2a8bb4342ab4ef6.MenuCommand.OnPopupEnd();
  450.                 }
  451.                 Application.DoEvents();
  452.                 this.popupMenu = null;
  453.                 if (num2 != 0)
  454.                 {
  455.                     if (num2 < 0)
  456.                     {
  457.                         this.x58049cd54e5ca4e3(true);
  458.                     }
  459.                     else
  460.                     {
  461.                         this.x14014e142c6b152c(true);
  462.                     }
  463.                     this.ignoreMouseMove = true;
  464.                 }
  465.                 else if (xfbffbaa != null)
  466.                 {
  467.                     if (this.manualFocus)
  468.                     {
  469.                         this.xa23d095e6e52c5f3();
  470.                     }
  471.                     xfbffbaa.OnClick(EventArgs.Empty);
  472.                 }
  473.             }
  474.         }
  475.         protected void x0b912a2b95b630ba(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  476.         {
  477.             if (this.activeChild != null)
  478.             {
  479.                 this.activeChild.Close();
  480.                 this.x39e008704a72ea56();
  481.                 base.Invalidate();
  482.             }
  483.         }
  484.         internal void x136735fdfe6d04ea(x555516122dcc901e.POINT x0ce73f6cbd7d5515)
  485.         {
  486.             x61467fe65a98f20c.ScreenToClient(base.Handle, ref x0ce73f6cbd7d5515);
  487.             this.xdd922e6d558c59d4(x0ce73f6cbd7d5515.x, x0ce73f6cbd7d5515.y);
  488.         }
  489.         protected void x14014e142c6b152c(bool x651d82357ffa4398)
  490.         {
  491.             if (this.popupMenu == null)
  492.             {
  493.                 int trackItem = this.trackItem;
  494.                 for (int i = 0; i < this.drawCommands.Count; i++)
  495.                 {
  496.                     trackItem++;
  497.                     if (trackItem >= this.drawCommands.Count)
  498.                     {
  499.                         trackItem = 0;
  500.                     }
  501.                     Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  502.                     if ((!xccebff.Separator && (xccebff.Chevron || xccebff.MenuCommand.Enabled)) && (trackItem != this.trackItem))
  503.                     {
  504.                         this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, trackItem);
  505.                         if (this.selected && (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0)))
  506.                         {
  507.                             x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
  508.                             return;
  509.                         }
  510.                         break;
  511.                     }
  512.                 }
  513.             }
  514.         }
  515.         protected void x199464e739d66b0b(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  516.         {
  517.             if (this.activeChild != null)
  518.             {
  519.                 this.activeChild.WindowState = FormWindowState.Minimized;
  520.                 this.x39e008704a72ea56();
  521.                 base.Invalidate();
  522.             }
  523.         }
  524.         private void x1996f82940a97595()
  525.         {
  526.             string text = "";
  527.             bool flag = false;
  528.             if (this.mdiContainer != null)
  529.             {
  530.                 this.x4dedac25f8166fb5 = new x5f4b657f68f87baa[this.mdiContainer.MdiChildren.Length];
  531.                 for (int i = 0; i < this.mdiContainer.MdiChildren.Length; i++)
  532.                 {
  533.                     text = "";
  534.                     flag = false;
  535.                     try
  536.                     {
  537.                         text = this.mdiContainer.MdiChildren[i].Text;
  538.                         flag = this.mdiContainer.MdiChildren[i] == this.mdiContainer.ActiveMdiChild;
  539.                     }
  540.                     catch
  541.                     {
  542.                     }
  543.                     this.x4dedac25f8166fb5[i] = new x5f4b657f68f87baa(string.Format("&{0} {1}", i + 1, text), new EventHandler(this.x43d97dcf909b3bd3));
  544.                     this.x4dedac25f8166fb5[i].Checked = flag;
  545.                     this.x4dedac25f8166fb5[i].xb7d28b7a6d50662f = this.mdiContainer.MdiChildren[i];
  546.                     this.x4dedac25f8166fb5[i].xb2504b89d66feca9 = true;
  547.                 }
  548.             }
  549.             ArrayList list = new ArrayList();
  550.             foreach (x5f4b657f68f87baa xfbffbaa2 in this.MenuCommands)
  551.             {
  552.                 if (xfbffbaa2.MdiList)
  553.                 {
  554.                     this.xa76c42f3062c6f11(xfbffbaa2);
  555.                 }
  556.                 if (xfbffbaa2.MenuCommands.Count > 0)
  557.                 {
  558.                     list.Add(xfbffbaa2);
  559.                 }
  560.             }
  561.             while (list.Count > 0)
  562.             {
  563.                 x5f4b657f68f87baa xfbffbaa = (x5f4b657f68f87baa) list[0];
  564.                 list.RemoveAt(0);
  565.                 foreach (x5f4b657f68f87baa xfbffbaa3 in xfbffbaa.MenuCommands)
  566.                 {
  567.                     if (xfbffbaa3.MdiList)
  568.                     {
  569.                         this.xa76c42f3062c6f11(xfbffbaa3);
  570.                     }
  571.                     if (xfbffbaa3.MenuCommands.Count > 0)
  572.                     {
  573.                         list.Add(xfbffbaa3);
  574.                     }
  575.                 }
  576.             }
  577.         }
  578.         protected void x21498b72da0020ba(System.Drawing.Font x978809f7734a0f16)
  579.         {
  580.             base.Font = x978809f7734a0f16;
  581.             this.breadthGap = (this.Font.Height / 3) + 1;
  582.             this.rowWidth = this.rowHeight = (this.Font.Height + (this.breadthGap * 2)) + 1;
  583.         }
  584.         protected void x23daf02978257d54(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  585.         {
  586.             if (this.activeChild != null)
  587.             {
  588.                 this.activeChild.SizeChanged -= new EventHandler(this.xfbce0f1d6df984cd);
  589.             }
  590.             this.activeChild = this.mdiContainer.ActiveMdiChild;
  591.             if (this.activeChild != null)
  592.             {
  593.                 this.activeChild.SizeChanged += new EventHandler(this.xfbce0f1d6df984cd);
  594.             }
  595.             this.x1996f82940a97595();
  596.             this.x39e008704a72ea56();
  597.             base.Invalidate();
  598.             if (this.MenuCommands.Count == 0)
  599.             {
  600.                 if (this.activeChild != null)
  601.                 {
  602.                     if (this.activeChild.WindowState == FormWindowState.Maximized)
  603.                     {
  604.                         base.Visible = true;
  605.                     }
  606.                     else
  607.                     {
  608.                         base.Visible = false;
  609.                     }
  610.                 }
  611.                 else
  612.                 {
  613.                     base.Visible = false;
  614.                 }
  615.             }
  616.             else
  617.             {
  618.                 base.Visible = true;
  619.             }
  620.         }
  621.         private void x273cbe3cfa28ea94(object xe0292b9ed559da7d, SkinChangedEventArgs xfbf34718e704c6bc)
  622.         {
  623.             if (this.Engine.RealActive)
  624.             {
  625.                 if (this.minButton != null)
  626.                 {
  627.                     this.minButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
  628.                 }
  629.                 if (this.restoreButton != null)
  630.                 {
  631.                     this.restoreButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
  632.                 }
  633.                 if (this.closeButton != null)
  634.                 {
  635.                     this.closeButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
  636.                 }
  637.             }
  638.         }
  639.         protected void x288bea726e7cd27e(object xe0292b9ed559da7d, UserPreferenceChangedEventArgs xfbf34718e704c6bc)
  640.         {
  641.             if (this.defaultFont)
  642.             {
  643.                 if (this.Engine.MenuFont == null)
  644.                 {
  645.                     this.x21498b72da0020ba(SystemInformation.MenuFont);
  646.                 }
  647.                 else
  648.                 {
  649.                     this.x21498b72da0020ba(this.Engine.MenuFont);
  650.                 }
  651.                 this.x39e008704a72ea56();
  652.                 base.Invalidate();
  653.             }
  654.         }
  655.         protected void x2b1f4f4697e5ae02(x5f4b657f68f87baa xccb63ca5f63dc470, x5f4b657f68f87baa.x879a106b0501b9dc x5ca6b6e12a4d9043)
  656.         {
  657.             this.x39e008704a72ea56();
  658.             base.Invalidate();
  659.         }
  660.         protected void x2cc390e9409b0f3f(int x22f50445643d053e, bool x4b9cb2187c13edda)
  661.         {
  662.             using (Graphics graphics = base.CreateGraphics())
  663.             {
  664.                 this.xb5a5bdae3ba8936b(graphics, this.drawCommands[x22f50445643d053e] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f, x4b9cb2187c13edda);
  665.             }
  666.         }
  667.         internal void x2ea07c3ab5d970d4(x555516122dcc901e.POINT x0ce73f6cbd7d5515)
  668.         {
  669.             x61467fe65a98f20c.ScreenToClient(base.Handle, ref x0ce73f6cbd7d5515);
  670.             this.xbcc99f3d02a70fe7(x0ce73f6cbd7d5515.x, x0ce73f6cbd7d5515.y);
  671.         }
  672.         protected void x34de1c54143aa5c7()
  673.         {
  674.             if (((this.popupMenu == null) && (this.trackItem != -1)) && !this.selected)
  675.             {
  676.                 Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  677.                 if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count >= 0))
  678.                 {
  679.                     this.selected = true;
  680.                     this.drawUpwards = false;
  681.                     this.x2cc390e9409b0f3f(this.trackItem, true);
  682.                     if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
  683.                     {
  684.                         x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
  685.                     }
  686.                 }
  687.             }
  688.         }
  689.         protected bool x35a6958370d758dd(xd53b20b7b4b2a08a x20e3b25d6d144908)
  690.         {
  691.             foreach (x5f4b657f68f87baa xfbffbaa in x20e3b25d6d144908)
  692.             {
  693.                 if (xfbffbaa.MenuCommands.ShowInfrequent)
  694.                 {
  695.                     return true;
  696.                 }
  697.                 if (this.x35a6958370d758dd(xfbffbaa.MenuCommands))
  698.                 {
  699.                     return true;
  700.                 }
  701.             }
  702.             return false;
  703.         }
  704.         internal void x39e008704a72ea56()
  705.         {
  706.             try
  707.             {
  708.                 int width;
  709.                 if (this.direction == xdbfa333b4cd503e0.Horizontal)
  710.                 {
  711.                     width = base.Width;
  712.                 }
  713.                 else
  714.                 {
  715.                     width = base.Height;
  716.                 }
  717.                 if (width <= 0)
  718.                 {
  719.                     return;
  720.                 }
  721.                 int num2 = 0;
  722.                 int num3 = 0;
  723.                 this.drawCommands = new ArrayList();
  724.                 int num4 = 6;
  725.                 int height = base.Height;
  726.                 int x = 0;
  727.                 width -= num4 + 12;
  728.                 bool flag = (num2 == 0) && (this.activeChild != null);
  729.                 if ((flag && !this.multiLine) && (this.activeChild.WindowState != FormWindowState.Maximized))
  730.                 {
  731.                     flag = false;
  732.                 }
  733.                 int num6 = 0;
  734.                 int y = 0;
  735.                 int num8 = 0;
  736.                 int num9 = 0;
  737.                 if (flag && (this.minButton != null))
  738.                 {
  739.                     width -= 0x37;
  740.                     bool flag2 = true;
  741.                     int num10 = 1;
  742.                     this.minButton.PopupStyle = flag2;
  743.                     this.restoreButton.PopupStyle = flag2;
  744.                     this.closeButton.PopupStyle = flag2;
  745.                     this.minButton.BorderWidth = num10;
  746.                     this.restoreButton.BorderWidth = num10;
  747.                     this.closeButton.BorderWidth = num10;
  748.                     if (this.direction == xdbfa333b4cd503e0.Horizontal)
  749.                     {
  750.                         num6 = (base.Width - 3) - 0x10;
  751.                         y = 3;
  752.                         num8 = -16;
  753.                     }
  754.                     else
  755.                     {
  756.                         num6 = 3;
  757.                         y = (base.Height - 3) - 0x10;
  758.                         num9 = -16;
  759.                     }
  760.                 }
  761.                 this.chevronStartCommand = null;
  762.                 using (Graphics graphics = base.CreateGraphics())
  763.                 {
  764.                     int num11 = 0;
  765.                     foreach (x5f4b657f68f87baa xfbffbaa in this.menuCommands)
  766.                     {
  767.                         xfbffbaa.OnUpdate(EventArgs.Empty);
  768.                         if (xfbffbaa.Visible)
  769.                         {
  770.                             Rectangle rectangle;
  771.                             int num12 = 0;
  772.                             if (xfbffbaa.Text == "-")
  773.                             {
  774.                                 num12 = 15;
  775.                             }
  776.                             else
  777.                             {
  778.                                 SizeF ef = graphics.MeasureString(xfbffbaa.Text, this.Font);
  779.                                 num12 = (num4 + ((int) ef.Width)) + 1;
  780.                             }
  781.                             if (this.direction == xdbfa333b4cd503e0.Horizontal)
  782.                             {
  783.                                 rectangle = new Rectangle(x, this.rowHeight * num2, num12, this.rowHeight);
  784.                             }
  785.                             else
  786.                             {
  787.                                 rectangle = new Rectangle(this.rowWidth * num2, x, this.rowWidth, num12);
  788.                             }
  789.                             x += num12;
  790.                             num3++;
  791.                             if ((x > width) && (num3 > 1))
  792.                             {
  793.                                 if (this.multiLine)
  794.                                 {
  795.                                     num2++;
  796.                                     num3 = 1;
  797.                                     x = num12;
  798.                                     if (this.direction == xdbfa333b4cd503e0.Horizontal)
  799.                                     {
  800.                                         rectangle.X = 0;
  801.                                         rectangle.Y += this.rowHeight;
  802.                                     }
  803.                                     else
  804.                                     {
  805.                                         rectangle.X += this.rowWidth;
  806.                                         rectangle.Y = 0;
  807.                                     }
  808.                                     if (flag && (num2 == 1))
  809.                                     {
  810.                                         width += 0x33;
  811.                                     }
  812.                                 }
  813.                                 else
  814.                                 {
  815.                                     if (num11 <= this.trackItem)
  816.                                     {
  817.                                         this.x51ce8d251f940283();
  818.                                     }
  819.                                     this.chevronStartCommand = xfbffbaa;
  820.                                     if (this.direction == xdbfa333b4cd503e0.Horizontal)
  821.                                     {
  822.                                         rectangle.Y = 0;
  823.                                         rectangle.Width = num4 + 12;
  824.                                         rectangle.X = base.Width - rectangle.Width;
  825.                                         rectangle.Height = this.rowHeight;
  826.                                         num6 -= rectangle.Width;
  827.                                     }
  828.                                     else
  829.                                     {
  830.                                         rectangle.X = 0;
  831.                                         rectangle.Height = num4 + 12;
  832.                                         rectangle.Y = base.Height - (num4 + 12);
  833.                                         rectangle.Width = this.rowWidth;
  834.                                         y -= rectangle.Height;
  835.                                     }
  836.                                     if ((this.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
  837.                                     {
  838.                                         this.drawCommands.Add(new Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f(new Rectangle(width - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height)));
  839.                                     }
  840.                                     else
  841.                                     {
  842.                                         this.drawCommands.Add(new Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f(rectangle));
  843.                                     }
  844.                                     goto Label_044F;
  845.                                 }
  846.                             }
  847.                             Rectangle selectRect = rectangle;
  848.                             if (this.direction == xdbfa333b4cd503e0.Horizontal)
  849.                             {
  850.                                 selectRect.Height -= 5;
  851.                             }
  852.                             else
  853.                             {
  854.                                 selectRect.Width -= this.breadthGap;
  855.                             }
  856.                             if ((this.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
  857.                             {
  858.                                 this.drawCommands.Add(new Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f(xfbffbaa, new Rectangle(width - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height), new Rectangle(width - selectRect.Right, selectRect.Y, selectRect.Width, selectRect.Height)));
  859.                             }
  860.                             else
  861.                             {
  862.                                 this.drawCommands.Add(new Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f(xfbffbaa, rectangle, selectRect));
  863.                             }
  864.                             num11++;
  865.                         }
  866.                     }
  867.                 }
  868.             Label_044F:
  869.                 if (flag && (this.minButton != null))
  870.                 {
  871.                     if (this.activeChild.WindowState == FormWindowState.Maximized)
  872.                     {
  873.                         if (!this.minButton.Visible)
  874.                         {
  875.                             this.minButton.Show();
  876.                             this.restoreButton.Show();
  877.                             this.closeButton.Show();
  878.                         }
  879.                         this.minButton.Enabled = this.activeChild.MinimizeBox;
  880.                         this.closeButton.Location = new Point(num6, y);
  881.                         num6 += num8;
  882.                         y += num9;
  883.                         this.restoreButton.Location = new Point(num6, y);
  884.                         num6 += num8;
  885.                         y += num9;
  886.                         this.minButton.Location = new Point(num6, y);
  887.                     }
  888.                     else if (this.minButton.Visible)
  889.                     {
  890.                         this.minButton.Hide();
  891.                         this.restoreButton.Hide();
  892.                         this.closeButton.Hide();
  893.                     }
  894.                 }
  895.                 else if ((this.minButton != null) && this.minButton.Visible)
  896.                 {
  897.                     this.minButton.Hide();
  898.                     this.restoreButton.Hide();
  899.                     this.closeButton.Hide();
  900.                 }
  901.                 if (this.direction == xdbfa333b4cd503e0.Horizontal)
  902.                 {
  903.                     int num13 = (num2 + 1) * this.rowHeight;
  904.                     if (base.Height != num13)
  905.                     {
  906.                         base.Height = num13;
  907.                     }
  908.                 }
  909.                 else
  910.                 {
  911.                     int num14 = (num2 + 1) * this.rowWidth;
  912.                     if (base.Width != num14)
  913.                     {
  914.                         base.Width = num14;
  915.                     }
  916.                 }
  917.             }
  918.             catch
  919.             {
  920.             }
  921.         }
  922.         private void x43d97dcf909b3bd3(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  923.         {
  924.             if (xe0292b9ed559da7d is x5f4b657f68f87baa)
  925.             {
  926.                 try
  927.                 {
  928.                     ((x5f4b657f68f87baa) xe0292b9ed559da7d).xb7d28b7a6d50662f.Activate();
  929.                 }
  930.                 catch
  931.                 {
  932.                 }
  933.             }
  934.         }
  935.         protected void x4d43bed1b4aede85()
  936.         {
  937.             this.xcb97d93f0d5ce4a8();
  938.             this.x51ce8d251f940283();
  939.             this.x39e008704a72ea56();
  940.             base.Invalidate();
  941.         }
  942.         protected bool x4d7a264852c9d2f3(Shortcut x10364107371ea04e, xd53b20b7b4b2a08a x20e3b25d6d144908)
  943.         {
  944.             foreach (x5f4b657f68f87baa xfbffbaa in x20e3b25d6d144908)
  945.             {
  946.                 if (xfbffbaa.Enabled && (xfbffbaa.Shortcut == x10364107371ea04e))
  947.                 {
  948.                     xfbffbaa.OnClick(EventArgs.Empty);
  949.                     return true;
  950.                 }
  951.                 if ((xfbffbaa.MenuCommands.Count > 0) && this.x4d7a264852c9d2f3(x10364107371ea04e, xfbffbaa.MenuCommands))
  952.                 {
  953.                     return true;
  954.                 }
  955.             }
  956.             return false;
  957.         }
  958.         protected void x51ce8d251f940283()
  959.         {
  960.             if (this.trackItem != -1)
  961.             {
  962.                 Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  963.                 if (xccebff.MenuCommand != null)
  964.                 {
  965.                     this.OnDeselected(xccebff.MenuCommand);
  966.                 }
  967.                 this.trackItem = -1;
  968.             }
  969.         }
  970.         protected void x58049cd54e5ca4e3(bool x651d82357ffa4398)
  971.         {
  972.             if (this.popupMenu == null)
  973.             {
  974.                 int trackItem = this.trackItem;
  975.                 int num2 = trackItem;
  976.                 for (int i = 0; i < this.drawCommands.Count; i++)
  977.                 {
  978.                     trackItem--;
  979.                     if (trackItem == num2)
  980.                     {
  981.                         return;
  982.                     }
  983.                     if (trackItem < 0)
  984.                     {
  985.                         trackItem = this.drawCommands.Count - 1;
  986.                     }
  987.                     Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  988.                     if ((!xccebff.Separator && (xccebff.Chevron || xccebff.MenuCommand.Enabled)) && (trackItem != this.trackItem))
  989.                     {
  990.                         this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, trackItem);
  991.                         if (this.selected && (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0)))
  992.                         {
  993.                             x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
  994.                             return;
  995.                         }
  996.                         break;
  997.                     }
  998.                 }
  999.             }
  1000.         }
  1001.         protected bool x58b2784e55b43ddd(ref x40255b11ef821fa3.MSG x8a41fbc87a3fb305)
  1002.         {
  1003.             Point point;
  1004.             bool flag = false;
  1005.             uint message = x8a41fbc87a3fb305.message;
  1006.             if (message <= 0x105)
  1007.             {
  1008.                 if (message <= 0xa4)
  1009.                 {
  1010.                     switch (message)
  1011.                     {
  1012.                         case 0xa1:
  1013.                         case 0xa4:
  1014.                             goto Label_009E;
  1015.                     }
  1016.                     return flag;
  1017.                 }
  1018.                 switch (message)
  1019.                 {
  1020.                     case 0x100:
  1021.                     {
  1022.                         ushort keyState = x61467fe65a98f20c.GetKeyState(0x10);
  1023.                         ushort num2 = x61467fe65a98f20c.GetKeyState(0x11);
  1024.                         int wParam = (int) x8a41fbc87a3fb305.wParam;
  1025.                         int num4 = wParam;
  1026.                         if ((keyState & 0x8000) != 0)
  1027.                         {
  1028.                             num4 += 0x10000;
  1029.                         }
  1030.                         if ((num2 & 0x8000) != 0)
  1031.                         {
  1032.                             num4 += 0x20000;
  1033.                         }
  1034.                         if (num4 != 0x1b)
  1035.                         {
  1036.                             switch (num4)
  1037.                             {
  1038.                                 case 0x25:
  1039.                                     if (this.direction == xdbfa333b4cd503e0.Horizontal)
  1040.                                     {
  1041.                                         this.x58049cd54e5ca4e3(false);
  1042.                                     }
  1043.                                     if (this.selected)
  1044.                                     {
  1045.                                         this.ignoreMouseMove = true;
  1046.                                     }
  1047.                                     return true;
  1048.                                 case 0x27:
  1049.                                     if (this.direction == xdbfa333b4cd503e0.Horizontal)
  1050.                                     {
  1051.                                         this.x14014e142c6b152c(false);
  1052.                                     }
  1053.                                     else
  1054.                                     {
  1055.                                         this.x34de1c54143aa5c7();
  1056.                                     }
  1057.                                     if (this.selected)
  1058.                                     {
  1059.                                         this.ignoreMouseMove = true;
  1060.                                     }
  1061.                                     return true;
  1062.                                 case 13:
  1063.                                     this.x830edbe776f7cc9f();
  1064.                                     return true;
  1065.                                 case 40:
  1066.                                     if (this.direction == xdbfa333b4cd503e0.Horizontal)
  1067.                                     {
  1068.                                         this.x34de1c54143aa5c7();
  1069.                                     }
  1070.                                     else
  1071.                                     {
  1072.                                         this.x14014e142c6b152c(false);
  1073.                                     }
  1074.                                     return true;
  1075.                                 case 0x26:
  1076.                                     this.x58049cd54e5ca4e3(false);
  1077.                                     return true;
  1078.                             }
  1079.                             Shortcut shortcut = (Shortcut) num4;
  1080.                             if (!this.x4d7a264852c9d2f3(shortcut, this.menuCommands))
  1081.                             {
  1082.                                 this.x65c1cc54cc8b0e75((char) ((int) x8a41fbc87a3fb305.wParam));
  1083.                                 if (this.selected)
  1084.                                 {
  1085.                                     this.ignoreMouseMove = true;
  1086.                                 }
  1087.                             }
  1088.                             else
  1089.                             {
  1090.                                 this.xa23d095e6e52c5f3();
  1091.                             }
  1092.                             return true;
  1093.                         }
  1094.                         if ((this.trackItem != -1) && (this.popupMenu == null))
  1095.                         {
  1096.                             this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
  1097.                         }
  1098.                         this.xa23d095e6e52c5f3();
  1099.                         return true;
  1100.                     }
  1101.                     case 0x101:
  1102.                         return true;
  1103.                     case 0x102:
  1104.                     case 0x103:
  1105.                         return flag;
  1106.                     case 260:
  1107.                     {
  1108.                         if (((int) x8a41fbc87a3fb305.wParam) == 0x12)
  1109.                         {
  1110.                             return flag;
  1111.                         }
  1112.                         Shortcut shortcut2 = (Shortcut) (0x40000 + ((int) x8a41fbc87a3fb305.wParam));
  1113.                         if (this.x4d7a264852c9d2f3(shortcut2, this.menuCommands))
  1114.                         {
  1115.                             this.xa23d095e6e52c5f3();
  1116.                         }
  1117.                         else
  1118.                         {
  1119.                             this.x65c1cc54cc8b0e75((char) ((int) x8a41fbc87a3fb305.wParam));
  1120.                             if (this.selected)
  1121.                             {
  1122.                                 this.ignoreMouseMove = true;
  1123.                             }
  1124.                         }
  1125.                         return true;
  1126.                     }
  1127.                     case 0x105:
  1128.                         if (((int) x8a41fbc87a3fb305.wParam) != 0x12)
  1129.                         {
  1130.                             return flag;
  1131.                         }
  1132.                         if ((this.trackItem != -1) && (this.popupMenu == null))
  1133.                         {
  1134.                             this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
  1135.                         }
  1136.                         this.xa23d095e6e52c5f3();
  1137.                         return true;
  1138.                     case 0xa7:
  1139.                         goto Label_009E;
  1140.                 }
  1141.                 return flag;
  1142.             }
  1143.             if (message <= 0x204)
  1144.             {
  1145.                 switch (message)
  1146.                 {
  1147.                     case 0x201:
  1148.                     case 0x204:
  1149.                         goto Label_009E;
  1150.                 }
  1151.                 return flag;
  1152.             }
  1153.             if ((message != 0x207) && (message != 0x20b))
  1154.             {
  1155.                 return flag;
  1156.             }
  1157.         Label_009E:
  1158.             point = new Point(((int) x8a41fbc87a3fb305.lParam) & 0xffff, (((int) x8a41fbc87a3fb305.lParam) & -65536) >> 0x10);
  1159.             if (!base.ClientRectangle.Contains(point))
  1160.             {
  1161.                 this.xa23d095e6e52c5f3();
  1162.             }
  1163.             return flag;
  1164.         }
  1165.         protected void x5cb0c63a7cf35b53(int xc0c4c459c6ccbd00, object xbcea506a33cf9111)
  1166.         {
  1167.             this.xcb97d93f0d5ce4a8();
  1168.             this.x51ce8d251f940283();
  1169.             this.x39e008704a72ea56();
  1170.             base.Invalidate();
  1171.         }
  1172.         protected void x60cdc457bc0610f8()
  1173.         {
  1174.             if (!this.manualFocus)
  1175.             {
  1176.                 this.manualFocus = true;
  1177.                 this.animateFirst = true;
  1178.                 Form form = base.FindForm();
  1179.                 form.Deactivate += new EventHandler(this.x92abb6992cd92749);
  1180.                 bool flag = x61467fe65a98f20c.HideCaret(IntPtr.Zero);
  1181.                 x40255b11ef821fa3.MSG msg = new x40255b11ef821fa3.MSG();
  1182.                 this.exitLoop = false;
  1183.                 while (!this.exitLoop)
  1184.                 {
  1185.                     if (x61467fe65a98f20c.WaitMessage())
  1186.                     {
  1187.                         while (!this.exitLoop && x61467fe65a98f20c.PeekMessage(ref msg, 0, 0, 0, 0))
  1188.                         {
  1189.                             if (x61467fe65a98f20c.GetMessage(ref msg, IntPtr.Zero, 0, 0) && !this.x58b2784e55b43ddd(ref msg))
  1190.                             {
  1191.                                 x61467fe65a98f20c.TranslateMessage(ref msg);
  1192.                                 x61467fe65a98f20c.DispatchMessage(ref msg);
  1193.                             }
  1194.                         }
  1195.                     }
  1196.                 }
  1197.                 form.Deactivate -= new EventHandler(this.x92abb6992cd92749);
  1198.                 if (flag)
  1199.                 {
  1200.                     x61467fe65a98f20c.ShowCaret(IntPtr.Zero);
  1201.                 }
  1202.                 this.manualFocus = false;
  1203.             }
  1204.         }
  1205.         protected bool x65c1cc54cc8b0e75(char xba08ce632055a1d9)
  1206.         {
  1207.             if (!this.selected)
  1208.             {
  1209.                 for (int i = 0; i < this.drawCommands.Count; i++)
  1210.                 {
  1211.                     Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[i] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  1212.                     if (((xccebff.MenuCommand != null) && xccebff.MenuCommand.Enabled) && (xccebff.MenuCommand.Visible && (xba08ce632055a1d9 == xccebff.Mnemonic)))
  1213.                     {
  1214.                         this.selected = true;
  1215.                         this.drawUpwards = false;
  1216.                         if (this.trackItem != i)
  1217.                         {
  1218.                             this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, i);
  1219.                         }
  1220.                         else
  1221.                         {
  1222.                             this.x2cc390e9409b0f3f(this.trackItem, true);
  1223.                         }
  1224.                         if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count >= 0))
  1225.                         {
  1226.                             if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
  1227.                             {
  1228.                                 x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
  1229.                             }
  1230.                             return true;
  1231.                         }
  1232.                         xccebff.MenuCommand.OnClick(EventArgs.Empty);
  1233.                         int trackItem = this.trackItem;
  1234.                         this.x51ce8d251f940283();
  1235.                         this.xcb97d93f0d5ce4a8();
  1236.                         this.x2cc390e9409b0f3f(trackItem, false);
  1237.                         this.xa23d095e6e52c5f3();
  1238.                         return false;
  1239.                     }
  1240.                 }
  1241.             }
  1242.             return false;
  1243.         }
  1244.         protected void x6b08695ba39cf4ca(int xc0c4c459c6ccbd00, object xbcea506a33cf9111)
  1245.         {
  1246.             x5f4b657f68f87baa xfbffbaa = xbcea506a33cf9111 as x5f4b657f68f87baa;
  1247.             xfbffbaa.PropertyChanged += new x5f4b657f68f87baa.x5282b9c42ea1abce(this.x2b1f4f4697e5ae02);
  1248.             this.xcb97d93f0d5ce4a8();
  1249.             this.x51ce8d251f940283();
  1250.             this.x39e008704a72ea56();
  1251.             base.Invalidate();
  1252.         }
  1253.         protected void x6b3bc391561e756b(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  1254.         {
  1255.             if (this.activeChild != null)
  1256.             {
  1257.                 this.activeChild.WindowState = FormWindowState.Normal;
  1258.                 this.x39e008704a72ea56();
  1259.                 base.Invalidate();
  1260.             }
  1261.         }
  1262.         protected void x830edbe776f7cc9f()
  1263.         {
  1264.             if ((this.popupMenu == null) && (this.trackItem != -1))
  1265.             {
  1266.                 if (!this.selected)
  1267.                 {
  1268.                     Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  1269.                     if (!xccebff.Chevron && (xccebff.MenuCommand.MenuCommands.Count < 0))
  1270.                     {
  1271.                         xccebff.MenuCommand.OnClick(EventArgs.Empty);
  1272.                         int trackItem = this.trackItem;
  1273.                         this.x51ce8d251f940283();
  1274.                         this.x2cc390e9409b0f3f(trackItem, false);
  1275.                         this.xa23d095e6e52c5f3();
  1276.                     }
  1277.                     else
  1278.                     {
  1279.                         this.selected = true;
  1280.                         this.drawUpwards = false;
  1281.                         this.x2cc390e9409b0f3f(this.trackItem, true);
  1282.                         if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
  1283.                         {
  1284.                             x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
  1285.                         }
  1286.                     }
  1287.                 }
  1288.                 else
  1289.                 {
  1290.                     Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff2 = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  1291.                     xccebff2.MenuCommand.OnClick(EventArgs.Empty);
  1292.                     int num2 = this.trackItem;
  1293.                     this.x51ce8d251f940283();
  1294.                     this.xcb97d93f0d5ce4a8();
  1295.                     this.x2cc390e9409b0f3f(num2, false);
  1296.                     this.xa23d095e6e52c5f3();
  1297.                 }
  1298.             }
  1299.         }
  1300.         private bool x8b3f8f5d533e5ee1()
  1301.         {
  1302.             return (this.BackColor != SystemColors.Control);
  1303.         }
  1304.         protected void x92abb6992cd92749(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  1305.         {
  1306.             this.xa23d095e6e52c5f3();
  1307.         }
  1308.         protected void x92bcd6bad6f29e72(ref Message x6088325dec1baa2a)
  1309.         {
  1310.             x6088325dec1baa2a.Result = (IntPtr) 4L;
  1311.         }
  1312.         protected void x9954cbb39675570d()
  1313.         {
  1314.             this.minButton = new x5d3356d9dffccb60(menuImages, 0);
  1315.             this.restoreButton = new x5d3356d9dffccb60(menuImages, 1);
  1316.             this.closeButton = new x5d3356d9dffccb60(menuImages, 2);
  1317.             this.minButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
  1318.             this.restoreButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
  1319.             this.closeButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
  1320.             this.minButton.Size = new Size(0x10, 0x10);
  1321.             this.restoreButton.Size = new Size(0x10, 0x10);
  1322.             this.closeButton.Size = new Size(0x10, 0x10);
  1323.             this.minButton.Location = new Point(-16, -16);
  1324.             this.restoreButton.Location = new Point(-16, -16);
  1325.             this.closeButton.Location = new Point(-16, -16);
  1326.             this.minButton.Click += new EventHandler(this.x199464e739d66b0b);
  1327.             this.restoreButton.Click += new EventHandler(this.x6b3bc391561e756b);
  1328.             this.closeButton.Click += new EventHandler(this.x0b912a2b95b630ba);
  1329.             base.Controls.AddRange(new Control[] { this.minButton, this.restoreButton, this.closeButton });
  1330.         }
  1331.         protected void xa23d095e6e52c5f3()
  1332.         {
  1333.             if (this.manualFocus)
  1334.             {
  1335.                 this.exitLoop = true;
  1336.             }
  1337.             if (this.trackItem != -1)
  1338.             {
  1339.                 this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
  1340.             }
  1341.         }
  1342.         private void xa76c42f3062c6f11(x5f4b657f68f87baa x61b060a94340c4fc)
  1343.         {
  1344.             for (int i = x61b060a94340c4fc.MenuCommands.Count - 1; i >= 0; i--)
  1345.             {
  1346.                 if (x61b060a94340c4fc.MenuCommands[i].xb2504b89d66feca9)
  1347.                 {
  1348.                     x61b060a94340c4fc.MenuCommands.RemoveAt(i);
  1349.                 }
  1350.             }
  1351.             if (x61b060a94340c4fc.MenuCommands.Count > 0)
  1352.             {
  1353.                 x61b060a94340c4fc.MenuCommands.Add(this.x54f4e17b11b07b8c);
  1354.             }
  1355.             foreach (x5f4b657f68f87baa xfbffbaa in this.x4dedac25f8166fb5)
  1356.             {
  1357.                 x61b060a94340c4fc.MenuCommands.Add(xfbffbaa);
  1358.             }
  1359.         }
  1360.         protected int xa7cbddf1ec7a27e7(int x5360a38cdebd0e93, int x169940ac3300e3e7)
  1361.         {
  1362.             using (Graphics graphics = base.CreateGraphics())
  1363.             {
  1364.                 if (x5360a38cdebd0e93 != -1)
  1365.                 {
  1366.                     Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[x5360a38cdebd0e93] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  1367.                     this.xb5a5bdae3ba8936b(graphics, this.drawCommands[x5360a38cdebd0e93] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f, false);
  1368.                     if (xccebff.MenuCommand != null)
  1369.                     {
  1370.                         this.OnDeselected(xccebff.MenuCommand);
  1371.                     }
  1372.                 }
  1373.                 this.trackItem = x169940ac3300e3e7;
  1374.                 if (this.trackItem != -1)
  1375.                 {
  1376.                     Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff2 = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  1377.                     this.xb5a5bdae3ba8936b(graphics, this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f, true);
  1378.                     if (xccebff2.MenuCommand != null)
  1379.                     {
  1380.                         this.OnSelected(xccebff2.MenuCommand);
  1381.                     }
  1382.                 }
  1383.                 base.Invalidate();
  1384.             }
  1385.             return this.trackItem;
  1386.         }
  1387.         protected void xa9f9739090793818(ref Message x6088325dec1baa2a)
  1388.         {
  1389.             if (this.trackItem != -1)
  1390.             {
  1391.                 Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  1392.                 this.x0760506d6abf77a2(xccebff, x6088325dec1baa2a.LParam != IntPtr.Zero, x6088325dec1baa2a.WParam != IntPtr.Zero);
  1393.             }
  1394.         }
  1395.         internal void xb5a5bdae3ba8936b(Graphics x4b101060f4767186, Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xd2a8bb4342ab4ef6, bool x4b9cb2187c13edda)
  1396.         {
  1397.             Rectangle drawRect = xd2a8bb4342ab4ef6.DrawRect;
  1398.             x5f4b657f68f87baa menuCommand = xd2a8bb4342ab4ef6.MenuCommand;
  1399.             Rectangle rectangle2 = drawRect;
  1400.             rectangle2.Width += 4;
  1401.             rectangle2.Height += 4;
  1402.             if (!xd2a8bb4342ab4ef6.Separator)
  1403.             {
  1404.                 Brush brush;
  1405.                 Rectangle rectangle3;
  1406.                 if (xd2a8bb4342ab4ef6.Chevron)
  1407.                 {
  1408.                     rectangle3 = new Rectangle(drawRect.Left + 3, drawRect.Top + 1, drawRect.Width - 6, drawRect.Height - 2);
  1409.                 }
  1410.                 else
  1411.                 {
  1412.                     rectangle3 = new Rectangle(drawRect.Left + 3, drawRect.Top + 3, drawRect.Width - 6, drawRect.Height - 6);
  1413.                 }
  1414.                 if (xd2a8bb4342ab4ef6.Enabled && x4b9cb2187c13edda)
  1415.                 {
  1416.                     Rectangle rectangle4;
  1417.                     if (this.direction == xdbfa333b4cd503e0.Horizontal)
  1418.                     {
  1419.                         rectangle4 = new Rectangle(rectangle3.Left - 2, rectangle3.Top - 1, rectangle3.Width + 4, rectangle3.Height + 1);
  1420.                     }
  1421.                     else if (!xd2a8bb4342ab4ef6.Chevron)
  1422.                     {
  1423.                         rectangle4 = new Rectangle(rectangle3.Left, rectangle3.Top - 2, rectangle3.Width - 2, rectangle3.Height + 4);
  1424.                     }
  1425.                     else
  1426.                     {
  1427.                         rectangle4 = rectangle3;
  1428.                     }
  1429.                     if (this.selected)
  1430.                     {
  1431.                         brush = this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUCOLOR;
  1432.                         x4b101060f4767186.FillRectangle(brush, rectangle4);
  1433.                         System.Drawing.Color color = System.Drawing.Color.FromArgb(0x40, 0, 0, 0);
  1434.                         System.Drawing.Color color2 = System.Drawing.Color.FromArgb(0x30, 0, 0, 0);
  1435.                         System.Drawing.Color color3 = System.Drawing.Color.FromArgb(0, 0, 0, 0);
  1436.                         int x = rectangle4.Right + 1;
  1437.                         int bottom = rectangle4.Bottom;
  1438.                         if (this.drawUpwards && (this.direction == xdbfa333b4cd503e0.Horizontal))
  1439.                         {
  1440.                             using (Pen pen = new Pen(this.Engine.Res.Colors.SKIN2_TOPSELECTEDMENUBORDERCOLOR))
  1441.                             {
  1442.                                 x4b101060f4767186.DrawRectangle(pen, rectangle4);
  1443.                             }
  1444.                             if (xd2a8bb4342ab4ef6.SubMenu)
  1445.                             {
  1446.                                 Brush brush2;
  1447.                                 Brush brush3;
  1448.                                 Brush brush4;
  1449.                                 Brush brush5;
  1450.                                 int top = rectangle4.Top;
  1451.                                 int left = rectangle4.Left;
  1452.                                 int y = rectangle4.Bottom + 1;
  1453.                                 int num5 = rectangle4.Left + 4;
  1454.                                 int num6 = rectangle4.Width + 1;
  1455.                                 int height = 4;
  1456.                                 if (supportsLayered)
  1457.                                 {
  1458.                                     brush2 = new LinearGradientBrush(new Point(x, 0x270f), new Point(x + 4, 0x270f), color2, color3);
  1459.                                     brush3 = new LinearGradientBrush(new Point(num5 + 4, y - 4), new Point(num5, y + height), color, color3);
  1460.                                     brush5 = new LinearGradientBrush(new Point(((num5 + num6) - 4) - 2, (y - 4) - 2), new Point(num5 + num6, y + height), color, color3);
  1461.                                     brush4 = new LinearGradientBrush(new Point(0x270f, y), new Point(0x270f, y + height), color2, color3);
  1462.                                 }
  1463.                                 else
  1464.                                 {
  1465.                                     brush2 = new SolidBrush(SystemColors.ControlDark);
  1466.                                     brush3 = brush2;
  1467.                                     brush4 = brush2;
  1468.                                     brush5 = brush2;
  1469.                                 }
  1470.                                 x4b101060f4767186.FillRectangle(brush2, new Rectangle(x, top, 4, (bottom - top) + 1));
  1471.                                 x4b101060f4767186.FillRectangle(brush3, num5, y, 4, height);
  1472.                                 x4b101060f4767186.FillRectangle(brush5, (num5 + num6) - 4, y, 4, height);
  1473.                                 x4b101060f4767186.FillRectangle(brush4, num5 + 4, y, num6 - 8, height);
  1474.                                 if (supportsLayered)
  1475.                                 {
  1476.                                     brush2.Dispose();
  1477.                                     brush3.Dispose();
  1478.                                     brush4.Dispose();
  1479.                                     brush5.Dispose();
  1480.                                 }
  1481.                                 else
  1482.                                 {
  1483.                                     brush2.Dispose();
  1484.                                 }
  1485.                             }
  1486.                         }
  1487.                         else
  1488.                         {
  1489.                             using (Pen pen2 = new Pen(this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUBORDERCOLOR))
  1490.                             {
  1491.                                 x4b101060f4767186.DrawRectangle(pen2, rectangle4);
  1492.                             }
  1493.                             if (xd2a8bb4342ab4ef6.SubMenu)
  1494.                             {
  1495.                                 if (this.direction == xdbfa333b4cd503e0.Horizontal)
  1496.                                 {
  1497.                                     Brush brush6;
  1498.                                     x4b101060f4767186.DrawLine(Pens.White, rectangle4.Left, rectangle4.Bottom, rectangle4.Right, rectangle4.Bottom);
  1499.                                     using (Pen pen3 = new Pen(this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUFONTCOLOR))
  1500.                                     {
  1501.                                         x4b101060f4767186.DrawLine(pen3, rectangle4.Left, rectangle4.Bottom, rectangle4.Right, rectangle4.Bottom);
  1502.                                     }
  1503.                                     int num8 = rectangle4.Top + 4;
  1504.                                     if (supportsLayered)
  1505.                                     {
  1506.                                         using (LinearGradientBrush brush7 = new LinearGradientBrush(new Point(x - 4, num8 + 4), new Point(x + 4, num8), color, color3))
  1507.                                         {
  1508.                                             x4b101060f4767186.FillRectangle(brush7, new Rectangle(x, num8, 4, 4));
  1509.                                             num8 += 4;
  1510.                                         }
  1511.                                         brush6 = new LinearGradientBrush(new Point(x, 0x270f), new Point(x + 4, 0x270f), color2, color3);
  1512.                                     }
  1513.                                     else
  1514.                                     {
  1515.                                         brush6 = new SolidBrush(SystemColors.ControlDark);
  1516.                                     }
  1517.                                     x4b101060f4767186.FillRectangle(brush6, new Rectangle(x, num8, 4, bottom - num8));
  1518.                                     brush6.Dispose();
  1519.                                 }
  1520.                                 else
  1521.                                 {
  1522.                                     Brush brush8;
  1523.                                     x4b101060f4767186.DrawLine(Pens.White, rectangle4.Right, rectangle4.Top, rectangle4.Right, rectangle4.Bottom);
  1524.                                     using (Pen pen4 = new Pen(this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUFONTCOLOR))
  1525.                                     {
  1526.                                         x4b101060f4767186.DrawLine(pen4, rectangle4.Right, rectangle4.Top, rectangle4.Right, rectangle4.Bottom);
  1527.                                     }
  1528.                                     int num9 = rectangle4.Left + 4;
  1529.                                     if (supportsLayered)
  1530.                                     {
  1531.                                         using (LinearGradientBrush brush9 = new LinearGradientBrush(new Point(num9 + 4, (bottom + 1) - 4), new Point(num9, (bottom + 1) + 4), color, color3))
  1532.                                         {
  1533.                                             x4b101060f4767186.FillRectangle(brush9, new Rectangle(num9, bottom + 1, 4, 4));
  1534.                                             num9 += 4;
  1535.                                         }
  1536.                                         brush8 = new LinearGradientBrush(new Point(0x270f, bottom + 1), new Point(0x270f, (bottom + 1) + 4), color2, color3);
  1537.                                     }
  1538.                                     else
  1539.                                     {
  1540.                                         brush8 = new SolidBrush(SystemColors.ControlDark);
  1541.                                     }
  1542.                                     x4b101060f4767186.FillRectangle(brush8, new Rectangle(num9, bottom + 1, (bottom - num9) - 4, 4));
  1543.                                     brush8.Dispose();
  1544.                                 }
  1545.                             }
  1546.                         }
  1547.                     }
  1548.                     else
  1549.                     {
  1550.                         x4b101060f4767186.FillRectangle(this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUCOLOR, rectangle4);
  1551.                         using (Pen pen5 = new Pen(this.Engine.Res.Colors.SKIN2_TOPSELECTEDMENUBORDERCOLOR))
  1552.                         {
  1553.                             x4b101060f4767186.DrawRectangle(pen5, rectangle4);
  1554.                         }
  1555.                     }
  1556.                 }
  1557.                 if (xd2a8bb4342ab4ef6.Chevron)
  1558.                 {
  1559.                     int num10 = drawRect.Top;
  1560.                     int num11 = drawRect.X + ((drawRect.Width - 12) / 2);
  1561.                     if (this.selected)
  1562.                     {
  1563.                         num11++;
  1564.                         num10++;
  1565.                     }
  1566.                     x4b101060f4767186.DrawImage(menuImages.Images[3], num11, num10);
  1567.                 }
  1568.                 else
  1569.                 {
  1570.                     StringFormat format = new StringFormat();
  1571.                     format.FormatFlags = StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
  1572.                     format.Alignment = StringAlignment.Center;
  1573.                     format.LineAlignment = StringAlignment.Center;
  1574.                     format.HotkeyPrefix = HotkeyPrefix.Show;
  1575.                     if (this.direction == xdbfa333b4cd503e0.Vertical)
  1576.                     {
  1577.                         format.FormatFlags |= StringFormatFlags.DirectionVertical;
  1578.                     }
  1579.                     if (xd2a8bb4342ab4ef6.Enabled && base.Enabled)
  1580.                     {
  1581.                         if (this.selected && x4b9cb2187c13edda)
  1582.                         {
  1583.                             brush = this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUFONTCOLOR;
  1584.                             x4b101060f4767186.DrawString(menuCommand.Text, this.Font, brush, rectangle3, format);
  1585.                         }
  1586.                         else if (x4b9cb2187c13edda)
  1587.                         {
  1588.                             brush = this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUFONTCOLOR;
  1589.                             x4b101060f4767186.DrawString(menuCommand.Text, this.Font, brush, rectangle3, format);
  1590.                         }
  1591.                         else
  1592.                         {
  1593.                             brush = this.Engine.Res.Brushes.SKIN2_TOPMENUFONTCOLOR;
  1594.                             x4b101060f4767186.DrawString(menuCommand.Text, this.Font, brush, rectangle3, format);
  1595.                         }
  1596.                     }
  1597.                     else
  1598.                     {
  1599.                         Rectangle layoutRectangle = rectangle3;
  1600.                         layoutRectangle.Offset(1, 1);
  1601.                         x4b101060f4767186.DrawString(menuCommand.Text, this.Font, Brushes.White, layoutRectangle, format);
  1602.                         using (SolidBrush brush10 = new SolidBrush(SystemColors.GrayText))
  1603.                         {
  1604.                             x4b101060f4767186.DrawString(menuCommand.Text, this.Font, brush10, rectangle3, format);
  1605.                         }
  1606.                     }
  1607.                 }
  1608.             }
  1609.         }
  1610.         protected void xb73b905145ee3f9f()
  1611.         {
  1612.             this.minButton.Click -= new EventHandler(this.x199464e739d66b0b);
  1613.             this.restoreButton.Click -= new EventHandler(this.x6b3bc391561e756b);
  1614.             this.closeButton.Click -= new EventHandler(this.x0b912a2b95b630ba);
  1615.             x448fd9ab43628c71.RemoveControl(base.Controls, this.minButton);
  1616.             x448fd9ab43628c71.RemoveControl(base.Controls, this.restoreButton);
  1617.             x448fd9ab43628c71.RemoveControl(base.Controls, this.closeButton);
  1618.             this.minButton.Dispose();
  1619.             this.restoreButton.Dispose();
  1620.             this.closeButton.Dispose();
  1621.             this.minButton = null;
  1622.             this.restoreButton = null;
  1623.             this.closeButton = null;
  1624.         }
  1625.         protected void xbcc99f3d02a70fe7(int x75cf7df8c59ffa4d, int xc13ed6de98262a2d)
  1626.         {
  1627.             Point pt = new Point(x75cf7df8c59ffa4d, xc13ed6de98262a2d);
  1628.             for (int i = 0; i < this.drawCommands.Count; i++)
  1629.             {
  1630.                 Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[i] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  1631.                 if (xccebff.SelectRect.Contains(pt) && xccebff.Enabled)
  1632.                 {
  1633.                     if ((xccebff.MenuCommand != null) && (xccebff.MenuCommand.MenuCommands.Count == 0))
  1634.                     {
  1635.                         xccebff.MenuCommand.PerformClick();
  1636.                     }
  1637.                     if (!this.selected)
  1638.                     {
  1639.                         this.selected = true;
  1640.                         this.drawUpwards = false;
  1641.                         if (this.trackItem != i)
  1642.                         {
  1643.                             this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, i);
  1644.                         }
  1645.                         else
  1646.                         {
  1647.                             this.x2cc390e9409b0f3f(this.trackItem, true);
  1648.                         }
  1649.                         if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
  1650.                         {
  1651.                             x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 1, (uint) 0);
  1652.                             return;
  1653.                         }
  1654.                     }
  1655.                     else if ((this.trackItem == i) && (this.popupMenu != null))
  1656.                     {
  1657.                         this.popupMenu.Dismiss();
  1658.                         this.popupMenu = null;
  1659.                         return;
  1660.                     }
  1661.                     break;
  1662.                 }
  1663.             }
  1664.         }
  1665.         protected void xcb97d93f0d5ce4a8()
  1666.         {
  1667.             this.animateFirst = true;
  1668.             this.selected = false;
  1669.             if (this.deselectReset)
  1670.             {
  1671.                 this.xe8febcf8320c4113(this.menuCommands, false);
  1672.             }
  1673.         }
  1674.         internal void xd502a472a14a9c04()
  1675.         {
  1676.             if ((this.trackItem != -1) && this.selected)
  1677.             {
  1678.                 this.drawUpwards = true;
  1679.                 this.x2cc390e9409b0f3f(this.trackItem, true);
  1680.             }
  1681.         }
  1682.         protected void xdd922e6d558c59d4(int x75cf7df8c59ffa4d, int xc13ed6de98262a2d)
  1683.         {
  1684.             if (this.ignoreMouseMove)
  1685.             {
  1686.                 this.ignoreMouseMove = false;
  1687.             }
  1688.             else
  1689.             {
  1690.                 if (!this.mouseOver)
  1691.                 {
  1692.                     x40255b11ef821fa3.TRACKMOUSEEVENTS tme = new x40255b11ef821fa3.TRACKMOUSEEVENTS();
  1693.                     tme.cbSize = 0x10;
  1694.                     tme.dwFlags = 2;
  1695.                     tme.hWnd = base.Handle;
  1696.                     tme.dwHoverTime = 0;
  1697.                     x61467fe65a98f20c.TrackMouseEvent(ref tme);
  1698.                     this.mouseOver = true;
  1699.                 }
  1700.                 Form form = base.FindForm();
  1701.                 if ((form != null) && form.ContainsFocus)
  1702.                 {
  1703.                     Point pt = new Point(x75cf7df8c59ffa4d, xc13ed6de98262a2d);
  1704.                     int num = 0;
  1705.                     num = 0;
  1706.                     while (num < this.drawCommands.Count)
  1707.                     {
  1708.                         Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[num] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
  1709.                         if (xccebff.SelectRect.Contains(pt) && xccebff.Enabled)
  1710.                         {
  1711.                             if (this.trackItem != num)
  1712.                             {
  1713.                                 if (this.selected)
  1714.                                 {
  1715.                                     if (this.popupMenu != null)
  1716.                                     {
  1717.                                         this.dismissTransfer = true;
  1718.                                         this.popupMenu.Dismiss();
  1719.                                         this.drawUpwards = false;
  1720.                                     }
  1721.                                     this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, num);
  1722.                                     if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
  1723.                                     {
  1724.                                         x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 1, (uint) 0);
  1725.                                     }
  1726.                                 }
  1727.                                 else
  1728.                                 {
  1729.                                     this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, num);
  1730.                                 }
  1731.                             }
  1732.                             break;
  1733.                         }
  1734.                         num++;
  1735.                     }
  1736.                     if ((!this.selected && (num == this.drawCommands.Count)) && !this.manualFocus)
  1737.                     {
  1738.                         this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
  1739.                     }
  1740.                 }
  1741.             }
  1742.         }
  1743.         protected void xe8febcf8320c4113(xd53b20b7b4b2a08a x20e3b25d6d144908, bool x789c645a15deb49b)
  1744.         {
  1745.             foreach (x5f4b657f68f87baa xfbffbaa in x20e3b25d6d144908)
  1746.             {
  1747.                 xfbffbaa.MenuCommands.ShowInfrequent = x789c645a15deb49b;
  1748.                 this.xe8febcf8320c4113(xfbffbaa.MenuCommands, x789c645a15deb49b);
  1749.             }
  1750.         }
  1751.         protected void xfbce0f1d6df984cd(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  1752.         {
  1753.             Form tag = null;
  1754.             if (this.childMenu != null)
  1755.             {
  1756.                 foreach (x5f4b657f68f87baa xfbffbaa in this.childMenu.MenuCommands)
  1757.                 {
  1758.                     if (this.MenuCommands.Contains(xfbffbaa))
  1759.                     {
  1760.                         this.MenuCommands.Remove(xfbffbaa);
  1761.                     }
  1762.                 }
  1763.                 if (this.childMenu.Tag is Form)
  1764.                 {
  1765.                     tag = (Form) this.childMenu.Tag;
  1766.                     if (!tag.IsDisposed)
  1767.                     {
  1768.                         tag.Controls.Add(this.childMenu);
  1769.                     }
  1770.                 }
  1771.                 this.childMenu = null;
  1772.             }
  1773.             if (this.activeChild.WindowState == FormWindowState.Maximized)
  1774.             {
  1775.                 foreach (Control control in this.activeChild.Controls)
  1776.                 {
  1777.                     if (control is x3c41176af7e54b01)
  1778.                     {
  1779.                         this.childMenu = (x3c41176af7e54b01) control;
  1780.                         this.childMenu.Tag = this.activeChild;
  1781.                         this.activeChild.Controls.Remove(control);
  1782.                         break;
  1783.                     }
  1784.                     this.childMenu = null;
  1785.                 }
  1786.                 if (this.childMenu != null)
  1787.                 {
  1788.                     foreach (x5f4b657f68f87baa xfbffbaa2 in this.childMenu.MenuCommands)
  1789.                     {
  1790.                         this.MenuCommands.Add(xfbffbaa2);
  1791.                     }
  1792.                 }
  1793.                 this.x39e008704a72ea56();
  1794.                 base.Invalidate();
  1795.             }
  1796.             if (this.MenuCommands.Count == 0)
  1797.             {
  1798.                 if (this.activeChild != null)
  1799.                 {
  1800.                     if (this.activeChild.WindowState == FormWindowState.Maximized)
  1801.                     {
  1802.                         base.Visible = true;
  1803.                     }
  1804.                     else
  1805.                     {
  1806.                         base.Visible = false;
  1807.                     }
  1808.                 }
  1809.                 else
  1810.                 {
  1811.                     base.Visible = false;
  1812.                 }
  1813.             }
  1814.             else
  1815.             {
  1816.                 base.Visible = true;
  1817.             }
  1818.         }
  1819.         public x6fd23f8bad2f3ced Animate
  1820.         {
  1821.             get
  1822.             {
  1823.                 return this.animate;
  1824.             }
  1825.             set
  1826.             {
  1827.                 this.animate = value;
  1828.             }
  1829.         }
  1830.         public x1f5697535eab37b9 AnimateStyle
  1831.         {
  1832.             get
  1833.             {
  1834.                 return this.animateStyle;
  1835.             }
  1836.             set
  1837.             {
  1838.                 this.animateStyle = value;
  1839.             }
  1840.         }
  1841.         public int AnimateTime
  1842.         {
  1843.             get
  1844.             {
  1845.                 return this.animateTime;
  1846.             }
  1847.             set
  1848.             {
  1849.                 this.animateTime = value;
  1850.             }
  1851.         }
  1852.         public bool DeselectReset
  1853.         {
  1854.             get
  1855.             {
  1856.                 return this.deselectReset;
  1857.             }
  1858.             set
  1859.             {
  1860.                 this.deselectReset = value;
  1861.             }
  1862.         }
  1863.         public xdbfa333b4cd503e0 Direction
  1864.         {
  1865.             get
  1866.             {
  1867.                 return this.direction;
  1868.             }
  1869.             set
  1870.             {
  1871.                 if (this.direction != value)
  1872.                 {
  1873.                     this.direction = value;
  1874.                     this.x39e008704a72ea56();
  1875.                     base.Invalidate();
  1876.                 }
  1877.             }
  1878.         }
  1879.         public override DockStyle Dock
  1880.         {
  1881.             get
  1882.             {
  1883.                 return base.Dock;
  1884.             }
  1885.             set
  1886.             {
  1887.                 base.Dock = value;
  1888.                 switch (value)
  1889.                 {
  1890.                     case DockStyle.None:
  1891.                         this.direction = xdbfa333b4cd503e0.Horizontal;
  1892.                         break;
  1893.                     case DockStyle.Top:
  1894.                     case DockStyle.Bottom:
  1895.                         base.Height = 0;
  1896.                         this.direction = xdbfa333b4cd503e0.Horizontal;
  1897.                         break;
  1898.                     case DockStyle.Left:
  1899.                     case DockStyle.Right:
  1900.                         base.Width = 0;
  1901.                         this.direction = xdbfa333b4cd503e0.Vertical;
  1902.                         break;
  1903.                 }
  1904.                 this.x39e008704a72ea56();
  1905.                 base.Invalidate();
  1906.             }
  1907.         }
  1908.         public SkinEngine Engine
  1909.         {
  1910.             get
  1911.             {
  1912.                 return this.xcab6a0e662ada486;
  1913.             }
  1914.             set
  1915.             {
  1916.                 this.xcab6a0e662ada486 = value;
  1917.             }
  1918.         }
  1919.         public bool ExpandAllTogether
  1920.         {
  1921.             get
  1922.             {
  1923.                 return this.expandAllTogether;
  1924.             }
  1925.             set
  1926.             {
  1927.                 this.expandAllTogether = value;
  1928.             }
  1929.         }
  1930.         public override System.Drawing.Font Font
  1931.         {
  1932.             get
  1933.             {
  1934.                 return base.Font;
  1935.             }
  1936.             set
  1937.             {
  1938.                 if (value != base.Font)
  1939.                 {
  1940.                     this.defaultFont = value == SystemInformation.MenuFont;
  1941.                     this.x21498b72da0020ba(value);
  1942.                     this.x39e008704a72ea56();
  1943.                     base.Invalidate();
  1944.                 }
  1945.             }
  1946.         }
  1947.         public xc69458cec0f3af75 GlyphFading
  1948.         {
  1949.             get
  1950.             {
  1951.                 return this.glyphFading;
  1952.             }
  1953.             set
  1954.             {
  1955.                 this.glyphFading = value;
  1956.             }
  1957.         }
  1958.         public bool HighlightInfrequent
  1959.         {
  1960.             get
  1961.             {
  1962.                 return this.highlightInfrequent;
  1963.             }
  1964.             set
  1965.             {
  1966.                 this.highlightInfrequent = value;
  1967.             }
  1968.         }
  1969.         public Form MdiContainer
  1970.         {
  1971.             get
  1972.             {
  1973.                 return this.mdiContainer;
  1974.             }
  1975.             set
  1976.             {
  1977.                 if (this.mdiContainer != value)
  1978.                 {
  1979.                     if (this.mdiContainer != null)
  1980.                     {
  1981.                         this.mdiContainer.MdiChildActivate -= new EventHandler(this.x23daf02978257d54);
  1982.                         this.xb73b905145ee3f9f();
  1983.                     }
  1984.                     this.mdiContainer = value;
  1985.                     if (this.mdiContainer != null)
  1986.                     {
  1987.                         this.x9954cbb39675570d();
  1988.                         this.mdiContainer.MdiChildActivate += new EventHandler(this.x23daf02978257d54);
  1989.                         this.x23daf02978257d54(null, null);
  1990.                     }
  1991.                 }
  1992.             }
  1993.         }
  1994.         public xd53b20b7b4b2a08a MenuCommands
  1995.         {
  1996.             get
  1997.             {
  1998.                 return this.menuCommands;
  1999.             }
  2000.         }
  2001.         public bool MultiLine
  2002.         {
  2003.             get
  2004.             {
  2005.                 return this.multiLine;
  2006.             }
  2007.             set
  2008.             {
  2009.                 if (this.multiLine != value)
  2010.                 {
  2011.                     this.multiLine = value;
  2012.                     this.x39e008704a72ea56();
  2013.                     base.Invalidate();
  2014.                 }
  2015.             }
  2016.         }
  2017.         public bool PlainAsBlock
  2018.         {
  2019.             get
  2020.             {
  2021.                 return this.plainAsBlock;
  2022.             }
  2023.             set
  2024.             {
  2025.                 if (this.plainAsBlock != value)
  2026.                 {
  2027.                     this.plainAsBlock = value;
  2028.                     this.x39e008704a72ea56();
  2029.                     base.Invalidate();
  2030.                 }
  2031.             }
  2032.         }
  2033.         public bool RememberExpansion
  2034.         {
  2035.             get
  2036.             {
  2037.                 return this.rememberExpansion;
  2038.             }
  2039.             set
  2040.             {
  2041.                 this.rememberExpansion = value;
  2042.             }
  2043.         }
  2044.     }
  2045. }