ListViewEx.cs
Upload User: xjhday
Upload Date: 2017-12-03
Package Size: 1036k
Code Size: 35k
Category:

GUI Develop

Development Platform:

Visual C++

  1. namespace DevComponents.DotNetBar.Controls
  2. {
  3.     using DevComponents.DotNetBar;
  4.     using DevComponents.DotNetBar.Rendering;
  5.     using System;
  6.     using System.Collections;
  7.     using System.ComponentModel;
  8.     using System.Drawing;
  9.     using System.Runtime.InteropServices;
  10.     using System.Windows.Forms;
  11.     [ToolboxBitmap(typeof(ListViewEx), "Controls.ListViewEx.ico"), ToolboxItem(true)]
  12.     public class ListViewEx : ListView, 0E
  13.     {
  14.         private 0N 2EN;
  15.         private ElementStyle 2EO = new ElementStyle();
  16.         private 0H 2EP;
  17.         private Office2007ListViewColorTable 2EQ;
  18.         private Office2007CheckBoxColorTable 2ER;
  19.         private Size 2ES = new Size(13, 13);
  20.         private Point 2ET = Point.Empty;
  21.         private bool 2EU = true;
  22.         private BaseRenderer 2EV;
  23.         private BaseRenderer 2EW;
  24.         private eRenderMode 2EX = eRenderMode.Global;
  25.         private ColorScheme 2EY;
  26.         public ListViewEx()
  27.         {
  28.             this.2EO.Class = ElementStyleClassKeys.ListViewBorderKey;
  29.             this.2EO.StyleChanged += new EventHandler(this.VK);
  30.             this.2EN = new 0N(this, eScrollBarSkin.Optimized);
  31.             this.OwnerDraw = true;
  32.             this.DoubleBuffered = true;
  33.             this.BorderStyle = System.Windows.Forms.BorderStyle.None;
  34.         }
  35.         protected override void Dispose(bool disposing)
  36.         {
  37.             if (this.2EN != null)
  38.             {
  39.                 this.2EN.W0();
  40.                 this.2EN = null;
  41.             }
  42.             if (this.2EO != null)
  43.             {
  44.                 this.2EO.StyleChanged -= new EventHandler(this.VK);
  45.             }
  46.             base.Dispose(disposing);
  47.         }
  48.         protected virtual ColorScheme GetColorScheme()
  49.         {
  50.             BaseRenderer renderer = this.GetRenderer();
  51.             if (renderer is Office2007Renderer)
  52.             {
  53.                 return ((Office2007Renderer) renderer).ColorTable.LegacyColors;
  54.             }
  55.             if (this.2EY == null)
  56.             {
  57.                 this.2EY = new ColorScheme(eDotNetBarStyle.Office2007);
  58.             }
  59.             return this.2EY;
  60.         }
  61.         public virtual BaseRenderer GetRenderer()
  62.         {
  63.             if ((this.2EX == eRenderMode.Global) && (GlobalManager.Renderer != null))
  64.             {
  65.                 return GlobalManager.Renderer;
  66.             }
  67.             if ((this.2EX == eRenderMode.Custom) && (this.2EW != null))
  68.             {
  69.                 return this.2EW;
  70.             }
  71.             if (this.2EV == null)
  72.             {
  73.                 this.2EV = new Office2007Renderer();
  74.             }
  75.             return this.2EV;
  76.         }
  77.         protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
  78.         {
  79.             base.OnDrawColumnHeader(e);
  80.         }
  81.         protected override void OnDrawItem(DrawListViewItemEventArgs e)
  82.         {
  83.             if ((((e.State == 0) && (base.View != View.List)) && (((base.View != View.Tile) && (base.View != View.SmallIcon)) && (base.View != View.LargeIcon))) || (base.View == View.Details))
  84.             {
  85.                 base.OnDrawItem(e);
  86.             }
  87.             else
  88.             {
  89.                 Graphics graphics = e.Graphics;
  90.                 Rectangle bounds = e.Bounds;
  91.                 if (base.View == View.List)
  92.                 {
  93.                     bounds = e.Item.GetBounds(ItemBoundsPortion.Label);
  94.                 }
  95.                 else if (base.View == View.SmallIcon)
  96.                 {
  97.                     bounds = e.Item.GetBounds(ItemBoundsPortion.Label);
  98.                 }
  99.                 this.VB(graphics, bounds, e.Item, e.State);
  100.                 this.VE(graphics, e.Item, null, e.Item.Font, e.Item.ForeColor, e.State);
  101.                 base.OnDrawItem(e);
  102.             }
  103.         }
  104.         protected override void OnDrawSubItem(DrawListViewSubItemEventArgs e)
  105.         {
  106.             Graphics graphics = e.Graphics;
  107.             if (((base.FullRowSelect && this.VC(e.ItemState, ListViewItemStates.Selected)) && (e.Header != null)) && ((e.Header.DisplayIndex == 0) || (((e.Bounds.X <= 0) && (e.Header.DisplayIndex > 0)) && base.Scrollable)))
  108.             {
  109.                 Rectangle bounds = e.Item.Bounds;
  110.                 if ((this.VD(e.Item) || (e.Header.DisplayIndex != e.Header.Index)) && (e.Header.DisplayIndex == 0))
  111.                 {
  112.                     Rectangle rectangle2 = e.Item.GetBounds(ItemBoundsPortion.Icon);
  113.                     int num = Math.Min(e.Header.Width, (rectangle2.Right - bounds.X) + 1);
  114.                     bounds.Width -= num;
  115.                     bounds.X += num;
  116.                 }
  117.                 this.VB(graphics, bounds, e.Item, e.ItemState);
  118.             }
  119.             if (e.ColumnIndex == 0)
  120.             {
  121.                 if (!base.FullRowSelect || !this.VC(e.ItemState, ListViewItemStates.Selected))
  122.                 {
  123.                     Rectangle rectangle3 = e.Item.GetBounds(ItemBoundsPortion.Label);
  124.                     this.VB(graphics, rectangle3, e.Item, e.ItemState);
  125.                 }
  126.                 this.VE(graphics, e.Item, e.Header, e.Item.Font, e.Item.ForeColor, e.ItemState);
  127.             }
  128.             else
  129.             {
  130.                 if ((base.FullRowSelect && this.VC(e.ItemState, ListViewItemStates.Selected)) && (e.Header.DisplayIndex != e.Header.Index))
  131.                 {
  132.                     Rectangle rectangle4 = e.Bounds;
  133.                     this.VB(graphics, rectangle4, e.Item, e.ItemState);
  134.                 }
  135.                 if (e.Header.Width > 0)
  136.                 {
  137.                     this.VG(graphics, e.SubItem, e.Bounds, e.ItemState, base.Columns[e.ColumnIndex], e.Item.BackColor);
  138.                 }
  139.             }
  140.             base.OnDrawSubItem(e);
  141.         }
  142.         protected override void OnHandleCreated(EventArgs e)
  143.         {
  144.             this.2EP = new 0H(this);
  145.             base.OnHandleCreated(e);
  146.         }
  147.         protected override void OnHandleDestroyed(EventArgs e)
  148.         {
  149.             if (this.2EP != null)
  150.             {
  151.                 this.2EP.ReleaseHandle();
  152.                 this.2EP = null;
  153.             }
  154.             base.OnHandleDestroyed(e);
  155.         }
  156.         protected override void OnLostFocus(EventArgs e)
  157.         {
  158.             if ((this.HideSelection && !base.VirtualMode) && (base.SelectedItems.Count > 0))
  159.             {
  160.                 foreach (ListViewItem item in base.SelectedItems)
  161.                 {
  162.                     Rectangle bounds = item.Bounds;
  163.                     if (base.View == View.Details)
  164.                     {
  165.                         bounds.X = 0;
  166.                         bounds.Width = base.Width;
  167.                     }
  168.                     else if (base.View == View.LargeIcon)
  169.                     {
  170.                         bounds.Inflate(0x20, 0x20);
  171.                     }
  172.                     base.Invalidate(bounds);
  173.                 }
  174.             }
  175.             base.OnLostFocus(e);
  176.         }
  177.         protected override void OnMouseDown(MouseEventArgs e)
  178.         {
  179.             this.2ET = new Point(e.X, e.Y);
  180.             base.OnMouseDown(e);
  181.         }
  182.         protected override void OnMouseEnter(EventArgs e)
  183.         {
  184.             if (this.2EU)
  185.             {
  186.                 this.Refresh();
  187.                 this.2EU = false;
  188.             }
  189.             base.OnMouseEnter(e);
  190.         }
  191.         protected override void OnMouseUp(MouseEventArgs e)
  192.         {
  193.             base.OnMouseUp(e);
  194.             if ((base.View == View.Details) && base.FullRowSelect)
  195.             {
  196.                 ListViewItem itemAt = base.GetItemAt(5, e.Y);
  197.                 ListViewItem item2 = base.GetItemAt(5, this.2ET.Y);
  198.                 if ((itemAt != null) && (itemAt == item2))
  199.                 {
  200.                     itemAt.Selected = true;
  201.                     itemAt.Focused = true;
  202.                 }
  203.             }
  204.         }
  205.         protected override void OnVisibleChanged(EventArgs e)
  206.         {
  207.             if ((Environment.OSVersion.Version.Major < 6) && base.Visible)
  208.             {
  209.                 88.1D5(base.Handle.ToInt32(), 0x120, 0, 0);
  210.             }
  211.             base.OnVisibleChanged(e);
  212.         }
  213.         public void ResetCachedColorTableReference()
  214.         {
  215.             this.2EQ = null;
  216.             this.2ER = null;
  217.         }
  218.         public void ResetHeaderHandler()
  219.         {
  220.             if (base.IsHandleCreated)
  221.             {
  222.                 if (this.2EP != null)
  223.                 {
  224.                     this.2EP.ReleaseHandle();
  225.                     this.2EP = null;
  226.                 }
  227.                 this.2EP = new 0H(this);
  228.             }
  229.         }
  230.         private void US(ref Message 6AP)
  231.         {
  232.             base.WndProc(ref 6AP);
  233.         }
  234.         private ItemPaintArgs UT(Graphics 6AQ)
  235.         {
  236.             ItemPaintArgs args = new ItemPaintArgs(this as IOwner, this, 6AQ, this.GetColorScheme());
  237.             args.572 = this.GetRenderer();
  238.             args.DesignerSelection = false;
  239.             args.GlassEnabled = !base.DesignMode && 88.5C8;
  240.             return args;
  241.         }
  242.         private void UU(PaintEventArgs 6AR)
  243.         {
  244.         }
  245.         private Point UV(Point 6AS)
  246.         {
  247.             return base.PointToScreen(6AS);
  248.         }
  249.         private void UW(ref Rectangle 6AT)
  250.         {
  251.         }
  252.         private void UX(ref Rectangle 6AU)
  253.         {
  254.         }
  255.         private bool V0()
  256.         {
  257.             return base.Enabled;
  258.         }
  259.         private void V1(bool A_1)
  260.         {
  261.             base.Enabled = A_1;
  262.         }
  263.         private void V6(Graphics 69P, Rectangle 69Q)
  264.         {
  265.             Office2007ListViewColorTable table = this.V7();
  266.             0Z.04S(69P, 69Q, table.ColumnBackground);
  267.             using (Pen pen = new Pen(table.Border))
  268.             {
  269.                 69P.DrawLine(pen, 69Q.X, 69Q.Bottom - 1, 69Q.Right, 69Q.Bottom - 1);
  270.             }
  271.         }
  272.         private Office2007ListViewColorTable V7()
  273.         {
  274.             if (this.2EQ == null)
  275.             {
  276.                 Office2007Renderer renderer = this.GetRenderer() as Office2007Renderer;
  277.                 if (renderer != null)
  278.                 {
  279.                     this.2EQ = renderer.ColorTable.ListViewEx;
  280.                 }
  281.             }
  282.             return this.2EQ;
  283.         }
  284.         private Office2007CheckBoxColorTable V8()
  285.         {
  286.             if (this.2ER == null)
  287.             {
  288.                 Office2007Renderer renderer = this.GetRenderer() as Office2007Renderer;
  289.                 if (renderer != null)
  290.                 {
  291.                     this.2ER = renderer.ColorTable.CheckBoxItem;
  292.                 }
  293.             }
  294.             return this.2ER;
  295.         }
  296.         private void V9(DrawListViewColumnHeaderEventArgs 69R)
  297.         {
  298.             Graphics graphics = 69R.Graphics;
  299.             Rectangle bounds = 69R.Bounds;
  300.             Office2007ListViewColorTable table = this.V7();
  301.             Color start = table.ColumnBackground.Start;
  302.             Color end = table.ColumnBackground.End;
  303.             if (((69R.State & ListViewItemStates.Selected) == ListViewItemStates.Selected) && !end.IsEmpty)
  304.             {
  305.                 Color color3 = start;
  306.                 start = end;
  307.                 end = color3;
  308.             }
  309.             0Z.04T(graphics, bounds, start, end, table.ColumnBackground.GradientAngle);
  310.             using (Pen pen = new Pen(table.Border))
  311.             {
  312.                 graphics.DrawLine(pen, bounds.X, bounds.Bottom - 1, bounds.Right, bounds.Bottom - 1);
  313.             }
  314.             using (Pen pen2 = new Pen(table.ColumnSeparator))
  315.             {
  316.                 graphics.DrawLine(pen2, (int) (bounds.Right - 1), (int) (bounds.Y + 3), (int) (bounds.Right - 1), (int) (bounds.Bottom - 4));
  317.             }
  318.             TextFormatFlags flags = TextFormatFlags.WordEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter;
  319.             switch (69R.Header.TextAlign)
  320.             {
  321.                 case HorizontalAlignment.Right:
  322.                     flags |= TextFormatFlags.Right;
  323.                     break;
  324.                 case HorizontalAlignment.Center:
  325.                     flags |= TextFormatFlags.HorizontalCenter;
  326.                     break;
  327.             }
  328.             if ((69R.Header.ImageList != null) && ((69R.Header.ImageIndex >= 0) || ((69R.Header.ImageKey != null) && (69R.Header.ImageKey.Length > 0))))
  329.             {
  330.                 Image image = null;
  331.                 if (69R.Header.ImageIndex >= 0)
  332.                 {
  333.                     image = 69R.Header.ImageList.Images[69R.Header.ImageIndex];
  334.                 }
  335.                 else
  336.                 {
  337.                     image = 69R.Header.ImageList.Images[69R.Header.ImageKey];
  338.                 }
  339.                 if (image != null)
  340.                 {
  341.                     Rectangle rect = new Rectangle(bounds.X + 2, bounds.Y + ((bounds.Height - image.Height) / 2), image.Width, image.Height);
  342.                     if (this.RightToLeft == RightToLeft.Yes)
  343.                     {
  344.                         rect.X = (bounds.Right - rect.Width) - 2;
  345.                         bounds.Width -= rect.Width + 2;
  346.                     }
  347.                     else
  348.                     {
  349.                         bounds.Width -= rect.Width;
  350.                         bounds.X += rect.Width;
  351.                     }
  352.                     graphics.DrawImage(image, rect);
  353.                 }
  354.             }
  355.             this.VA(graphics, 69R.Font, 69R.ForeColor, flags, 69R.Header.Text, bounds);
  356.         }
  357.         private void VA(Graphics 69S, Font 69T, Color 69U, TextFormatFlags 69V, string 69W, Rectangle 69X)
  358.         {
  359.             int width = TextRenderer.MeasureText(" ", 69T).Width;
  360.             69X.Inflate(-(width / 2), 0);
  361.             TextRenderer.DrawText(69S, 69W, 69T, 69X, 69U, 69V);
  362.         }
  363.         private void VB(Graphics 69Y, Rectangle 69Z, ListViewItem 6A0, ListViewItemStates 6A1)
  364.         {
  365.             if (!6A0.BackColor.IsEmpty)
  366.             {
  367.                 using (SolidBrush brush = new SolidBrush(6A0.BackColor))
  368.                 {
  369.                     69Y.FillRectangle(brush, 69Z);
  370.                 }
  371.             }
  372.             if (this.VC(6A1, ListViewItemStates.Selected))
  373.             {
  374.                 Office2007ListViewColorTable table = this.V7();
  375.                 69Z.Height--;
  376.                 69Z.Width--;
  377.                 using (Pen pen = new Pen(table.SelectionBorder))
  378.                 {
  379.                     69Y.DrawRectangle(pen, 69Z);
  380.                 }
  381.                 69Z.Height++;
  382.                 69Z.Width++;
  383.                 Rectangle rectangle = new Rectangle(69Z.X, 69Z.Y + 1, 69Z.Width, 69Z.Height - 2);
  384.                 0Z.04S(69Y, rectangle, table.SelectionBackground);
  385.             }
  386.             else if (this.VC(6A1, ListViewItemStates.Hot) && base.HotTracking)
  387.             {
  388.                 Office2007Renderer renderer = this.GetRenderer() as Office2007Renderer;
  389.                 32.0OY(69Y, renderer.ColorTable.ButtonItemColors[0].MouseOver, 69Z, 0);
  390.             }
  391.             if (this.VC(6A1, ListViewItemStates.Focused) && ((!this.VC(6A1, ListViewItemStates.Hot) && (base.View != View.LargeIcon)) || this.VC(6A1, ListViewItemStates.Selected)))
  392.             {
  393.                 Rectangle bounds = 6A0.Bounds;
  394.                 if (((base.View == View.Details) && !base.FullRowSelect) || (base.View == View.List))
  395.                 {
  396.                     bounds = 6A0.GetBounds(ItemBoundsPortion.Label);
  397.                 }
  398.                 else if ((base.View == View.Details) && base.FullRowSelect)
  399.                 {
  400.                     bounds = 69Z;
  401.                 }
  402.                 else if (base.View == View.SmallIcon)
  403.                 {
  404.                     bounds = 69Z;
  405.                 }
  406.                 if (this.VC(6A1, ListViewItemStates.Selected))
  407.                 {
  408.                     bounds.Y++;
  409.                     bounds.Height -= 2;
  410.                 }
  411.                 this.VH(69Y, bounds, 6A0);
  412.             }
  413.         }
  414.         private bool VC(ListViewItemStates 6A2, ListViewItemStates 6A3)
  415.         {
  416.             return ((6A2 & 6A3) == 6A3);
  417.         }
  418.         private bool VD(ListViewItem 6A4)
  419.         {
  420.             if ((6A4.ImageList == null) || ((6A4.ImageIndex < 0) && (6A4.ImageKey.Length <= 0)))
  421.             {
  422.                 return false;
  423.             }
  424.             return true;
  425.         }
  426.         private void VE(Graphics 6A5, ListViewItem 6A6, ColumnHeader 6A7, Font 6A8, Color 6A9, ListViewItemStates 6AA)
  427.         {
  428.             bool flag = this.VD(6A6);
  429.             if (flag && ((6A7 == null) || (6A7.Width > 4)))
  430.             {
  431.                 Rectangle rectangle = 6A6.GetBounds(ItemBoundsPortion.Icon);
  432.                 int imageIndex = 6A6.ImageIndex;
  433.                 if (imageIndex < 0)
  434.                 {
  435.                     imageIndex = 6A6.ImageList.Images.IndexOfKey(6A6.ImageKey);
  436.                 }
  437.                 if (((base.View != View.Details) && (base.View != View.List)) && (base.StateImageList != null))
  438.                 {
  439.                     rectangle.X += base.StateImageList.ImageSize.Width + 3;
  440.                 }
  441.                 else if (((base.View == View.SmallIcon) && base.CheckBoxes) && (base.Groups.Count == 0))
  442.                 {
  443.                     rectangle.X += base.SmallImageList.ImageSize.Width;
  444.                 }
  445.                 else if ((base.View == View.LargeIcon) && ((6A6.ImageList.ImageSize.Width < rectangle.Width) || (6A6.ImageList.ImageSize.Height < rectangle.Height)))
  446.                 {
  447.                     if (6A6.ImageList.ImageSize.Width < rectangle.Width)
  448.                     {
  449.                         rectangle.X += (rectangle.Width - 6A6.ImageList.ImageSize.Width) / 2;
  450.                     }
  451.                     if (6A6.ImageList.ImageSize.Height < rectangle.Height)
  452.                     {
  453.                         rectangle.Y += (rectangle.Height - 6A6.ImageList.ImageSize.Height) / 2;
  454.                     }
  455.                 }
  456.                 Region clip = null;
  457.                 if ((6A7 != null) && (6A7.Width < rectangle.Width))
  458.                 {
  459.                     Rectangle rect = rectangle;
  460.                     rect.Width = 6A7.Width;
  461.                     clip = 6A5.Clip;
  462.                     6A5.SetClip(rect);
  463.                 }
  464.                 if (rectangle.Width > 2)
  465.                 {
  466.                     6A5.DrawImage(6A6.ImageList.Images[imageIndex], rectangle.Location);
  467.                 }
  468.                 if (clip != null)
  469.                 {
  470.                     6A5.Clip = clip;
  471.                 }
  472.             }
  473.             Rectangle bounds = 6A6.GetBounds(ItemBoundsPortion.Label);
  474.             if (bounds.Width > 2)
  475.             {
  476.                 eTextFormat singleLine = eTextFormat.SingleLine;
  477.                 if ((base.View == View.Tile) && (6A6.SubItems.Count > 1))
  478.                 {
  479.                     singleLine = singleLine;
  480.                 }
  481.                 else
  482.                 {
  483.                     singleLine |= eTextFormat.VerticalCenter;
  484.                 }
  485.                 if (base.View == View.LargeIcon)
  486.                 {
  487.                     singleLine = eTextFormat.EndEllipsis | eTextFormat.WordBreak | eTextFormat.HorizontalCenter;
  488.                 }
  489.                 else if ((base.View == View.Details) && (6A7 != null))
  490.                 {
  491.                     if (6A7.TextAlign == HorizontalAlignment.Center)
  492.                     {
  493.                         singleLine |= eTextFormat.HorizontalCenter;
  494.                     }
  495.                     else if (6A7.TextAlign == HorizontalAlignment.Right)
  496.                     {
  497.                         singleLine |= eTextFormat.Right;
  498.                     }
  499.                     bounds.X += 2;
  500.                 }
  501.                 else if ((base.View == View.List) || (base.View == View.SmallIcon))
  502.                 {
  503.                     bounds.X += 2;
  504.                 }
  505.                 54.18I(6A5, 6A6.Text, 6A8, 6A9, bounds, singleLine);
  506.                 if ((base.View == View.Tile) && (6A6.SubItems.Count > 1))
  507.                 {
  508.                     Size size = 54.18K(6A5, 6A6.Text, 6A8);
  509.                     bounds.Y += size.Height;
  510.                     bounds.Height -= size.Height;
  511.                     Color foreColor = 6A6.SubItems[1].ForeColor;
  512.                     if (!foreColor.IsEmpty && (foreColor != 6A9))
  513.                     {
  514.                         6A9 = foreColor;
  515.                     }
  516.                     else
  517.                     {
  518.                         6A9 = SystemColors.ControlDarkDark;
  519.                     }
  520.                     54.18I(6A5, 6A6.SubItems[1].Text, 6A8, 6A9, bounds, singleLine);
  521.                 }
  522.             }
  523.             if ((((base.View == View.Details) || (base.StateImageList != null)) && ((base.StateImageList != null) && (6A6.StateImageIndex >= 0))) && (6A6.StateImageIndex < base.StateImageList.Images.Count))
  524.             {
  525.                 Rectangle rectangle4 = 6A6.GetBounds(ItemBoundsPortion.Icon);
  526.                 if ((base.View == View.Details) || (base.View == View.List))
  527.                 {
  528.                     rectangle4.X -= 0x13;
  529.                 }
  530.                 else if ((base.View == View.LargeIcon) && (rectangle4.Width > base.StateImageList.ImageSize.Width))
  531.                 {
  532.                     rectangle4.X += (rectangle4.Width - base.StateImageList.ImageSize.Width) / 2;
  533.                     rectangle4.Y++;
  534.                 }
  535.                 else if ((base.View == View.Tile) && (rectangle4.Height > base.StateImageList.ImageSize.Height))
  536.                 {
  537.                     rectangle4.Y += (rectangle4.Height - base.StateImageList.ImageSize.Height) / 2;
  538.                     rectangle4.X++;
  539.                 }
  540.                 base.StateImageList.Draw(6A5, rectangle4.Location, 6A6.StateImageIndex);
  541.             }
  542.             if ((base.CheckBoxes && (((base.View == View.Details) || (base.View == View.List)) || ((base.View == View.SmallIcon) || (base.View == View.LargeIcon)))) && (base.StateImageList == null))
  543.             {
  544.                 Rectangle rectangle5 = 6A6.GetBounds(ItemBoundsPortion.Icon);
  545.                 if (base.View == View.LargeIcon)
  546.                 {
  547.                     rectangle5.X += ((rectangle5.Width - this.2ES.Width) / 2) - 4;
  548.                 }
  549.                 else if (base.View == View.List)
  550.                 {
  551.                     rectangle5.X -= 0x12;
  552.                 }
  553.                 else if (((base.View == View.SmallIcon) && flag) && (base.Groups.Count > 0))
  554.                 {
  555.                     rectangle5.X -= 20;
  556.                 }
  557.                 else if (base.View == View.SmallIcon)
  558.                 {
  559.                     rectangle5.X -= 3;
  560.                 }
  561.                 else
  562.                 {
  563.                     rectangle5.X -= 0x15;
  564.                 }
  565.                 S s = 46.0UG(null);
  566.                 Office2007CheckBoxColorTable table = this.V8();
  567.                 Office2007CheckBoxStateColorTable disabled = table.Default;
  568.                 if ((6AA & ListViewItemStates.Grayed) != 0)
  569.                 {
  570.                     disabled = table.Disabled;
  571.                 }
  572.                 s.OL(6A5, new Rectangle(rectangle5.X + 4, rectangle5.Y + ((rectangle5.Height - this.2ES.Height) / 2), this.2ES.Width, this.2ES.Height), disabled, 6A6.Checked ? CheckState.Checked : CheckState.Unchecked);
  573.             }
  574.         }
  575.         private IList VF()
  576.         {
  577.             IList columns = base.Columns;
  578.             if (!base.AllowColumnReorder)
  579.             {
  580.                 return columns;
  581.             }
  582.             ArrayList list2 = new ArrayList(base.Columns);
  583.             foreach (ColumnHeader header in columns)
  584.             {
  585.                 list2[header.DisplayIndex] = header;
  586.             }
  587.             return list2;
  588.         }
  589.         private void VG(Graphics 6AB, ListViewItem.ListViewSubItem 6AC, Rectangle 6AD, ListViewItemStates 6AE, ColumnHeader 6AF, Color 6AG)
  590.         {
  591.             eTextFormat format;
  592.             if (!this.VC(6AE, ListViewItemStates.Selected))
  593.             {
  594.                 Rectangle rect = 6AD;
  595.                 if (!6AC.BackColor.IsEmpty)
  596.                 {
  597.                     using (SolidBrush brush = new SolidBrush(6AC.BackColor))
  598.                     {
  599.                         6AB.FillRectangle(brush, rect);
  600.                         goto Label_0063;
  601.                     }
  602.                 }
  603.                 if (!6AG.IsEmpty)
  604.                 {
  605.                     using (SolidBrush brush2 = new SolidBrush(6AG))
  606.                     {
  607.                         6AB.FillRectangle(brush2, rect);
  608.                     }
  609.                 }
  610.             }
  611.         Label_0063:
  612.             format = eTextFormat.WordEllipsis | eTextFormat.SingleLine | eTextFormat.VerticalCenter;
  613.             if (6AF != null)
  614.             {
  615.                 if (6AF.TextAlign == HorizontalAlignment.Center)
  616.                 {
  617.                     format |= eTextFormat.HorizontalCenter;
  618.                 }
  619.                 else if (6AF.TextAlign == HorizontalAlignment.Right)
  620.                 {
  621.                     format |= eTextFormat.Right;
  622.                 }
  623.             }
  624.             Rectangle rectangle2 = Rectangle.Inflate(6AD, -2, 0);
  625.             54.18I(6AB, 6AC.Text, 6AC.Font, 6AC.ForeColor, rectangle2, format);
  626.         }
  627.         private void VH(Graphics 6AH, Rectangle 6AI, ListViewItem 6AJ)
  628.         {
  629.             ControlPaint.DrawFocusRectangle(6AH, 6AI, 6AJ.ForeColor, 6AJ.BackColor);
  630.         }
  631.         private Rectangle VI(Rectangle 6AK, bool 6AL, ListViewItem 6AM)
  632.         {
  633.             Rectangle rectangle = 6AK;
  634.             if (base.View == View.Details)
  635.             {
  636.                 if (!base.FullRowSelect && (6AM.SubItems.Count > 0))
  637.                 {
  638.                     ListViewItem.ListViewSubItem item = 6AM.SubItems[0];
  639.                     Size size = TextRenderer.MeasureText(item.Text, item.Font);
  640.                     rectangle = new Rectangle(6AK.X, 6AK.Y, size.Width, size.Height);
  641.                     rectangle.X += 4;
  642.                     rectangle.Width++;
  643.                 }
  644.                 else
  645.                 {
  646.                     rectangle.X += 4;
  647.                     rectangle.Width -= 4;
  648.                 }
  649.                 if (6AL)
  650.                 {
  651.                     rectangle.X--;
  652.                 }
  653.             }
  654.             return rectangle;
  655.         }
  656.         private ElementStyle VJ()
  657.         {
  658.             this.2EO.0AK(this.GetColorScheme());
  659.             return ElementStyleDisplay.0AQ(this.2EO);
  660.         }
  661.         private void VK(object 6AN, EventArgs 6AO)
  662.         {
  663.             if (C.HL(this))
  664.             {
  665.                 1U.1V v = new 1U.1V(0, 0, base.Width, base.Height);
  666.                 1U.0IG(base.Handle, ref v, IntPtr.Zero, 0x401);
  667.             }
  668.         }
  669.         protected override void WndProc(ref Message m)
  670.         {
  671.             if (this.2EN != null)
  672.             {
  673.                 if (this.2EN.W6(ref m))
  674.                 {
  675.                     base.WndProc(ref m);
  676.                 }
  677.             }
  678.             else
  679.             {
  680.                 base.WndProc(ref m);
  681.             }
  682.         }
  683.         [Browsable(true), Category("Style"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Description("Specifies the control border style. Default value has Class property set so the system style for the control is used.")]
  684.         public ElementStyle Border
  685.         {
  686.             get
  687.             {
  688.                 return this.2EO;
  689.             }
  690.         }
  691.         [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  692.         public System.Windows.Forms.BorderStyle BorderStyle
  693.         {
  694.             get
  695.             {
  696.                 return base.BorderStyle;
  697.             }
  698.             set
  699.             {
  700.             }
  701.         }
  702.         protected override System.Windows.Forms.CreateParams CreateParams
  703.         {
  704.             get
  705.             {
  706.                 System.Windows.Forms.CreateParams createParams = base.CreateParams;
  707.                 createParams.ExStyle &= ~(createParams.ExStyle & 0x200);
  708.                 return createParams;
  709.             }
  710.         }
  711.         Color 0E.BackColor
  712.         {
  713.             get
  714.             {
  715.                 return this.BackColor;
  716.             }
  717.         }
  718.         ElementStyle 0E.BorderStyle
  719.         {
  720.             get
  721.             {
  722.                 return this.VJ();
  723.             }
  724.         }
  725.         IntPtr 0E.Handle
  726.         {
  727.             get
  728.             {
  729.                 return base.Handle;
  730.             }
  731.         }
  732.         int 0E.Height
  733.         {
  734.             get
  735.             {
  736.                 return base.Height;
  737.             }
  738.         }
  739.         bool 0E.IsHandleCreated
  740.         {
  741.             get
  742.             {
  743.                 return base.IsHandleCreated;
  744.             }
  745.         }
  746.         int 0E.Width
  747.         {
  748.             get
  749.             {
  750.                 return base.Width;
  751.             }
  752.         }
  753.         Color 0E.BackColor
  754.         {
  755.             get
  756.             {
  757.                 return this.BackColor;
  758.             }
  759.         }
  760.         ElementStyle 0E.BorderStyle
  761.         {
  762.             get
  763.             {
  764.                 return this.VJ();
  765.             }
  766.         }
  767.         IntPtr 0E.Handle
  768.         {
  769.             get
  770.             {
  771.                 return base.Handle;
  772.             }
  773.         }
  774.         int 0E.Height
  775.         {
  776.             get
  777.             {
  778.                 return base.Height;
  779.             }
  780.         }
  781.         bool 0E.IsHandleCreated
  782.         {
  783.             get
  784.             {
  785.                 return base.IsHandleCreated;
  786.             }
  787.         }
  788.         int 0E.Width
  789.         {
  790.             get
  791.             {
  792.                 return base.Width;
  793.             }
  794.         }
  795.         [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  796.         public bool HideSelection
  797.         {
  798.             get
  799.             {
  800.                 return base.HideSelection;
  801.             }
  802.             set
  803.             {
  804.                 base.HideSelection = false;
  805.             }
  806.         }
  807.         [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
  808.         public bool OwnerDraw
  809.         {
  810.             get
  811.             {
  812.                 return base.OwnerDraw;
  813.             }
  814.             set
  815.             {
  816.                 base.OwnerDraw = value;
  817.             }
  818.         }
  819.         [DefaultValue((string) null), Browsable(false)]
  820.         public BaseRenderer Renderer
  821.         {
  822.             get
  823.             {
  824.                 return this.2EW;
  825.             }
  826.             set
  827.             {
  828.                 this.2EW = value;
  829.                 this.2EQ = null;
  830.             }
  831.         }
  832.         [Browsable(false), DefaultValue(1)]
  833.         public eRenderMode RenderMode
  834.         {
  835.             get
  836.             {
  837.                 return this.2EX;
  838.             }
  839.             set
  840.             {
  841.                 if (this.2EX != value)
  842.                 {
  843.                     this.2EX = value;
  844.                     this.2EQ = null;
  845.                     base.Invalidate(true);
  846.                 }
  847.             }
  848.         }
  849.         [StructLayout(LayoutKind.Sequential)]
  850.         private struct 0F
  851.         {
  852.             public IntPtr 2EZ;
  853.             public IntPtr 2F0;
  854.             public int 2F1;
  855.         }
  856.         [StructLayout(LayoutKind.Sequential)]
  857.         private struct 0G
  858.         {
  859.             public ListViewEx.0F 2F2;
  860.             public int 2F3;
  861.             public IntPtr 2F4;
  862.             public 88.8O 2F5;
  863.             public IntPtr 2F6;
  864.             public int 2F7;
  865.             public IntPtr 2F8;
  866.         }
  867.         private class 0H : NativeWindow
  868.         {
  869.             private ListViewEx 2F9;
  870.             private bool 2FA;
  871.             private Point 2FB = Point.Empty;
  872.             public 0H(ListViewEx parent)
  873.             {
  874.                 this.2F9 = parent;
  875.                 IntPtr handle = new IntPtr(88.1CM(parent.Handle, 0x101f, IntPtr.Zero, IntPtr.Zero));
  876.                 if (handle != IntPtr.Zero)
  877.                 {
  878.                     base.AssignHandle(handle);
  879.                 }
  880.             }
  881.             protected override void WndProc(ref Message m)
  882.             {
  883.                 if (m.Msg == 15)
  884.                 {
  885.                     88.8P p = new 88.8P();
  886.                     IntPtr hdc = 88.1CJ(m.HWnd, ref p);
  887.                     try
  888.                     {
  889.                         Graphics targetGraphics = Graphics.FromHdc(hdc);
  890.                         try
  891.                         {
  892.                             88.8O o = new 88.8O();
  893.                             88.1CS(m.HWnd, ref o);
  894.                             Rectangle rect = new Rectangle(0, 0, o.5CA, o.5C9);
  895.                             using (BufferedBitmap bitmap = new BufferedBitmap(hdc, rect))
  896.                             {
  897.                                 this.2F9.V6(bitmap.Graphics, rect);
  898.                                 IList list = this.2F9.VF();
  899.                                 int x = 0;
  900.                                 foreach (ColumnHeader header in list)
  901.                                 {
  902.                                     Rectangle bounds = new Rectangle(x, 0, header.Width, o.5C9);
  903.                                     ListViewItemStates showKeyboardCues = ListViewItemStates.ShowKeyboardCues;
  904.                                     if (this.2FA && bounds.Contains(this.2FB))
  905.                                     {
  906.                                         Rectangle rectangle3 = bounds;
  907.                                         rectangle3.Inflate(-6, 0);
  908.                                         if (rectangle3.Contains(this.2FB))
  909.                                         {
  910.                                             showKeyboardCues |= ListViewItemStates.Selected;
  911.                                         }
  912.                                     }
  913.                                     this.2F9.V9(new DrawListViewColumnHeaderEventArgs(bitmap.Graphics, bounds, header.DisplayIndex, header, showKeyboardCues, SystemColors.ControlText, Color.Empty, this.2F9.Font));
  914.                                     x += header.Width;
  915.                                 }
  916.                                 bitmap.Render(targetGraphics);
  917.                             }
  918.                         }
  919.                         finally
  920.                         {
  921.                             targetGraphics.Dispose();
  922.                         }
  923.                     }
  924.                     finally
  925.                     {
  926.                         88.1CK(m.HWnd, ref p);
  927.                     }
  928.                 }
  929.                 else
  930.                 {
  931.                     if (m.Msg == 0x201)
  932.                     {
  933.                         if (this.2F9.HeaderStyle == ColumnHeaderStyle.Clickable)
  934.                         {
  935.                             this.2FA = true;
  936.                             this.2FB = new Point(88.1DI(m.LParam), 88.1DJ(m.LParam));
  937.                             88.1CR(m.HWnd, IntPtr.Zero, IntPtr.Zero, 88.8E.4UR);
  938.                         }
  939.                     }
  940.                     else if (m.Msg == 0x202)
  941.                     {
  942.                         this.2FA = false;
  943.                         this.2FB = Point.Empty;
  944.                     }
  945.                     else if ((m.Msg == 0x200) && this.2FA)
  946.                     {
  947.                         this.2FB = new Point(88.1DI(m.LParam), 88.1DJ(m.LParam));
  948.                     }
  949.                     base.WndProc(ref m);
  950.                 }
  951.             }
  952.         }
  953.     }
  954. }