Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ListViewEx.cs
Upload User: xjhday
Upload Date: 2017-12-03
Package Size: 1036k
Code Size: 35k
Category:
GUI Develop
Development Platform:
Visual C++
- namespace DevComponents.DotNetBar.Controls
- {
- using DevComponents.DotNetBar;
- using DevComponents.DotNetBar.Rendering;
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Drawing;
- using System.Runtime.InteropServices;
- using System.Windows.Forms;
- [ToolboxBitmap(typeof(ListViewEx), "Controls.ListViewEx.ico"), ToolboxItem(true)]
- public class ListViewEx : ListView, 0E
- {
- private 0N 2EN;
- private ElementStyle 2EO = new ElementStyle();
- private 0H 2EP;
- private Office2007ListViewColorTable 2EQ;
- private Office2007CheckBoxColorTable 2ER;
- private Size 2ES = new Size(13, 13);
- private Point 2ET = Point.Empty;
- private bool 2EU = true;
- private BaseRenderer 2EV;
- private BaseRenderer 2EW;
- private eRenderMode 2EX = eRenderMode.Global;
- private ColorScheme 2EY;
- public ListViewEx()
- {
- this.2EO.Class = ElementStyleClassKeys.ListViewBorderKey;
- this.2EO.StyleChanged += new EventHandler(this.VK);
- this.2EN = new 0N(this, eScrollBarSkin.Optimized);
- this.OwnerDraw = true;
- this.DoubleBuffered = true;
- this.BorderStyle = System.Windows.Forms.BorderStyle.None;
- }
- protected override void Dispose(bool disposing)
- {
- if (this.2EN != null)
- {
- this.2EN.W0();
- this.2EN = null;
- }
- if (this.2EO != null)
- {
- this.2EO.StyleChanged -= new EventHandler(this.VK);
- }
- base.Dispose(disposing);
- }
- protected virtual ColorScheme GetColorScheme()
- {
- BaseRenderer renderer = this.GetRenderer();
- if (renderer is Office2007Renderer)
- {
- return ((Office2007Renderer) renderer).ColorTable.LegacyColors;
- }
- if (this.2EY == null)
- {
- this.2EY = new ColorScheme(eDotNetBarStyle.Office2007);
- }
- return this.2EY;
- }
- public virtual BaseRenderer GetRenderer()
- {
- if ((this.2EX == eRenderMode.Global) && (GlobalManager.Renderer != null))
- {
- return GlobalManager.Renderer;
- }
- if ((this.2EX == eRenderMode.Custom) && (this.2EW != null))
- {
- return this.2EW;
- }
- if (this.2EV == null)
- {
- this.2EV = new Office2007Renderer();
- }
- return this.2EV;
- }
- protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
- {
- base.OnDrawColumnHeader(e);
- }
- protected override void OnDrawItem(DrawListViewItemEventArgs e)
- {
- if ((((e.State == 0) && (base.View != View.List)) && (((base.View != View.Tile) && (base.View != View.SmallIcon)) && (base.View != View.LargeIcon))) || (base.View == View.Details))
- {
- base.OnDrawItem(e);
- }
- else
- {
- Graphics graphics = e.Graphics;
- Rectangle bounds = e.Bounds;
- if (base.View == View.List)
- {
- bounds = e.Item.GetBounds(ItemBoundsPortion.Label);
- }
- else if (base.View == View.SmallIcon)
- {
- bounds = e.Item.GetBounds(ItemBoundsPortion.Label);
- }
- this.VB(graphics, bounds, e.Item, e.State);
- this.VE(graphics, e.Item, null, e.Item.Font, e.Item.ForeColor, e.State);
- base.OnDrawItem(e);
- }
- }
- protected override void OnDrawSubItem(DrawListViewSubItemEventArgs e)
- {
- Graphics graphics = e.Graphics;
- 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)))
- {
- Rectangle bounds = e.Item.Bounds;
- if ((this.VD(e.Item) || (e.Header.DisplayIndex != e.Header.Index)) && (e.Header.DisplayIndex == 0))
- {
- Rectangle rectangle2 = e.Item.GetBounds(ItemBoundsPortion.Icon);
- int num = Math.Min(e.Header.Width, (rectangle2.Right - bounds.X) + 1);
- bounds.Width -= num;
- bounds.X += num;
- }
- this.VB(graphics, bounds, e.Item, e.ItemState);
- }
- if (e.ColumnIndex == 0)
- {
- if (!base.FullRowSelect || !this.VC(e.ItemState, ListViewItemStates.Selected))
- {
- Rectangle rectangle3 = e.Item.GetBounds(ItemBoundsPortion.Label);
- this.VB(graphics, rectangle3, e.Item, e.ItemState);
- }
- this.VE(graphics, e.Item, e.Header, e.Item.Font, e.Item.ForeColor, e.ItemState);
- }
- else
- {
- if ((base.FullRowSelect && this.VC(e.ItemState, ListViewItemStates.Selected)) && (e.Header.DisplayIndex != e.Header.Index))
- {
- Rectangle rectangle4 = e.Bounds;
- this.VB(graphics, rectangle4, e.Item, e.ItemState);
- }
- if (e.Header.Width > 0)
- {
- this.VG(graphics, e.SubItem, e.Bounds, e.ItemState, base.Columns[e.ColumnIndex], e.Item.BackColor);
- }
- }
- base.OnDrawSubItem(e);
- }
- protected override void OnHandleCreated(EventArgs e)
- {
- this.2EP = new 0H(this);
- base.OnHandleCreated(e);
- }
- protected override void OnHandleDestroyed(EventArgs e)
- {
- if (this.2EP != null)
- {
- this.2EP.ReleaseHandle();
- this.2EP = null;
- }
- base.OnHandleDestroyed(e);
- }
- protected override void OnLostFocus(EventArgs e)
- {
- if ((this.HideSelection && !base.VirtualMode) && (base.SelectedItems.Count > 0))
- {
- foreach (ListViewItem item in base.SelectedItems)
- {
- Rectangle bounds = item.Bounds;
- if (base.View == View.Details)
- {
- bounds.X = 0;
- bounds.Width = base.Width;
- }
- else if (base.View == View.LargeIcon)
- {
- bounds.Inflate(0x20, 0x20);
- }
- base.Invalidate(bounds);
- }
- }
- base.OnLostFocus(e);
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- this.2ET = new Point(e.X, e.Y);
- base.OnMouseDown(e);
- }
- protected override void OnMouseEnter(EventArgs e)
- {
- if (this.2EU)
- {
- this.Refresh();
- this.2EU = false;
- }
- base.OnMouseEnter(e);
- }
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
- if ((base.View == View.Details) && base.FullRowSelect)
- {
- ListViewItem itemAt = base.GetItemAt(5, e.Y);
- ListViewItem item2 = base.GetItemAt(5, this.2ET.Y);
- if ((itemAt != null) && (itemAt == item2))
- {
- itemAt.Selected = true;
- itemAt.Focused = true;
- }
- }
- }
- protected override void OnVisibleChanged(EventArgs e)
- {
- if ((Environment.OSVersion.Version.Major < 6) && base.Visible)
- {
- 88.1D5(base.Handle.ToInt32(), 0x120, 0, 0);
- }
- base.OnVisibleChanged(e);
- }
- public void ResetCachedColorTableReference()
- {
- this.2EQ = null;
- this.2ER = null;
- }
- public void ResetHeaderHandler()
- {
- if (base.IsHandleCreated)
- {
- if (this.2EP != null)
- {
- this.2EP.ReleaseHandle();
- this.2EP = null;
- }
- this.2EP = new 0H(this);
- }
- }
- private void US(ref Message 6AP)
- {
- base.WndProc(ref 6AP);
- }
- private ItemPaintArgs UT(Graphics 6AQ)
- {
- ItemPaintArgs args = new ItemPaintArgs(this as IOwner, this, 6AQ, this.GetColorScheme());
- args.572 = this.GetRenderer();
- args.DesignerSelection = false;
- args.GlassEnabled = !base.DesignMode && 88.5C8;
- return args;
- }
- private void UU(PaintEventArgs 6AR)
- {
- }
- private Point UV(Point 6AS)
- {
- return base.PointToScreen(6AS);
- }
- private void UW(ref Rectangle 6AT)
- {
- }
- private void UX(ref Rectangle 6AU)
- {
- }
- private bool V0()
- {
- return base.Enabled;
- }
- private void V1(bool A_1)
- {
- base.Enabled = A_1;
- }
- private void V6(Graphics 69P, Rectangle 69Q)
- {
- Office2007ListViewColorTable table = this.V7();
- 0Z.04S(69P, 69Q, table.ColumnBackground);
- using (Pen pen = new Pen(table.Border))
- {
- 69P.DrawLine(pen, 69Q.X, 69Q.Bottom - 1, 69Q.Right, 69Q.Bottom - 1);
- }
- }
- private Office2007ListViewColorTable V7()
- {
- if (this.2EQ == null)
- {
- Office2007Renderer renderer = this.GetRenderer() as Office2007Renderer;
- if (renderer != null)
- {
- this.2EQ = renderer.ColorTable.ListViewEx;
- }
- }
- return this.2EQ;
- }
- private Office2007CheckBoxColorTable V8()
- {
- if (this.2ER == null)
- {
- Office2007Renderer renderer = this.GetRenderer() as Office2007Renderer;
- if (renderer != null)
- {
- this.2ER = renderer.ColorTable.CheckBoxItem;
- }
- }
- return this.2ER;
- }
- private void V9(DrawListViewColumnHeaderEventArgs 69R)
- {
- Graphics graphics = 69R.Graphics;
- Rectangle bounds = 69R.Bounds;
- Office2007ListViewColorTable table = this.V7();
- Color start = table.ColumnBackground.Start;
- Color end = table.ColumnBackground.End;
- if (((69R.State & ListViewItemStates.Selected) == ListViewItemStates.Selected) && !end.IsEmpty)
- {
- Color color3 = start;
- start = end;
- end = color3;
- }
- 0Z.04T(graphics, bounds, start, end, table.ColumnBackground.GradientAngle);
- using (Pen pen = new Pen(table.Border))
- {
- graphics.DrawLine(pen, bounds.X, bounds.Bottom - 1, bounds.Right, bounds.Bottom - 1);
- }
- using (Pen pen2 = new Pen(table.ColumnSeparator))
- {
- graphics.DrawLine(pen2, (int) (bounds.Right - 1), (int) (bounds.Y + 3), (int) (bounds.Right - 1), (int) (bounds.Bottom - 4));
- }
- TextFormatFlags flags = TextFormatFlags.WordEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter;
- switch (69R.Header.TextAlign)
- {
- case HorizontalAlignment.Right:
- flags |= TextFormatFlags.Right;
- break;
- case HorizontalAlignment.Center:
- flags |= TextFormatFlags.HorizontalCenter;
- break;
- }
- if ((69R.Header.ImageList != null) && ((69R.Header.ImageIndex >= 0) || ((69R.Header.ImageKey != null) && (69R.Header.ImageKey.Length > 0))))
- {
- Image image = null;
- if (69R.Header.ImageIndex >= 0)
- {
- image = 69R.Header.ImageList.Images[69R.Header.ImageIndex];
- }
- else
- {
- image = 69R.Header.ImageList.Images[69R.Header.ImageKey];
- }
- if (image != null)
- {
- Rectangle rect = new Rectangle(bounds.X + 2, bounds.Y + ((bounds.Height - image.Height) / 2), image.Width, image.Height);
- if (this.RightToLeft == RightToLeft.Yes)
- {
- rect.X = (bounds.Right - rect.Width) - 2;
- bounds.Width -= rect.Width + 2;
- }
- else
- {
- bounds.Width -= rect.Width;
- bounds.X += rect.Width;
- }
- graphics.DrawImage(image, rect);
- }
- }
- this.VA(graphics, 69R.Font, 69R.ForeColor, flags, 69R.Header.Text, bounds);
- }
- private void VA(Graphics 69S, Font 69T, Color 69U, TextFormatFlags 69V, string 69W, Rectangle 69X)
- {
- int width = TextRenderer.MeasureText(" ", 69T).Width;
- 69X.Inflate(-(width / 2), 0);
- TextRenderer.DrawText(69S, 69W, 69T, 69X, 69U, 69V);
- }
- private void VB(Graphics 69Y, Rectangle 69Z, ListViewItem 6A0, ListViewItemStates 6A1)
- {
- if (!6A0.BackColor.IsEmpty)
- {
- using (SolidBrush brush = new SolidBrush(6A0.BackColor))
- {
- 69Y.FillRectangle(brush, 69Z);
- }
- }
- if (this.VC(6A1, ListViewItemStates.Selected))
- {
- Office2007ListViewColorTable table = this.V7();
- 69Z.Height--;
- 69Z.Width--;
- using (Pen pen = new Pen(table.SelectionBorder))
- {
- 69Y.DrawRectangle(pen, 69Z);
- }
- 69Z.Height++;
- 69Z.Width++;
- Rectangle rectangle = new Rectangle(69Z.X, 69Z.Y + 1, 69Z.Width, 69Z.Height - 2);
- 0Z.04S(69Y, rectangle, table.SelectionBackground);
- }
- else if (this.VC(6A1, ListViewItemStates.Hot) && base.HotTracking)
- {
- Office2007Renderer renderer = this.GetRenderer() as Office2007Renderer;
- 32.0OY(69Y, renderer.ColorTable.ButtonItemColors[0].MouseOver, 69Z, 0);
- }
- if (this.VC(6A1, ListViewItemStates.Focused) && ((!this.VC(6A1, ListViewItemStates.Hot) && (base.View != View.LargeIcon)) || this.VC(6A1, ListViewItemStates.Selected)))
- {
- Rectangle bounds = 6A0.Bounds;
- if (((base.View == View.Details) && !base.FullRowSelect) || (base.View == View.List))
- {
- bounds = 6A0.GetBounds(ItemBoundsPortion.Label);
- }
- else if ((base.View == View.Details) && base.FullRowSelect)
- {
- bounds = 69Z;
- }
- else if (base.View == View.SmallIcon)
- {
- bounds = 69Z;
- }
- if (this.VC(6A1, ListViewItemStates.Selected))
- {
- bounds.Y++;
- bounds.Height -= 2;
- }
- this.VH(69Y, bounds, 6A0);
- }
- }
- private bool VC(ListViewItemStates 6A2, ListViewItemStates 6A3)
- {
- return ((6A2 & 6A3) == 6A3);
- }
- private bool VD(ListViewItem 6A4)
- {
- if ((6A4.ImageList == null) || ((6A4.ImageIndex < 0) && (6A4.ImageKey.Length <= 0)))
- {
- return false;
- }
- return true;
- }
- private void VE(Graphics 6A5, ListViewItem 6A6, ColumnHeader 6A7, Font 6A8, Color 6A9, ListViewItemStates 6AA)
- {
- bool flag = this.VD(6A6);
- if (flag && ((6A7 == null) || (6A7.Width > 4)))
- {
- Rectangle rectangle = 6A6.GetBounds(ItemBoundsPortion.Icon);
- int imageIndex = 6A6.ImageIndex;
- if (imageIndex < 0)
- {
- imageIndex = 6A6.ImageList.Images.IndexOfKey(6A6.ImageKey);
- }
- if (((base.View != View.Details) && (base.View != View.List)) && (base.StateImageList != null))
- {
- rectangle.X += base.StateImageList.ImageSize.Width + 3;
- }
- else if (((base.View == View.SmallIcon) && base.CheckBoxes) && (base.Groups.Count == 0))
- {
- rectangle.X += base.SmallImageList.ImageSize.Width;
- }
- else if ((base.View == View.LargeIcon) && ((6A6.ImageList.ImageSize.Width < rectangle.Width) || (6A6.ImageList.ImageSize.Height < rectangle.Height)))
- {
- if (6A6.ImageList.ImageSize.Width < rectangle.Width)
- {
- rectangle.X += (rectangle.Width - 6A6.ImageList.ImageSize.Width) / 2;
- }
- if (6A6.ImageList.ImageSize.Height < rectangle.Height)
- {
- rectangle.Y += (rectangle.Height - 6A6.ImageList.ImageSize.Height) / 2;
- }
- }
- Region clip = null;
- if ((6A7 != null) && (6A7.Width < rectangle.Width))
- {
- Rectangle rect = rectangle;
- rect.Width = 6A7.Width;
- clip = 6A5.Clip;
- 6A5.SetClip(rect);
- }
- if (rectangle.Width > 2)
- {
- 6A5.DrawImage(6A6.ImageList.Images[imageIndex], rectangle.Location);
- }
- if (clip != null)
- {
- 6A5.Clip = clip;
- }
- }
- Rectangle bounds = 6A6.GetBounds(ItemBoundsPortion.Label);
- if (bounds.Width > 2)
- {
- eTextFormat singleLine = eTextFormat.SingleLine;
- if ((base.View == View.Tile) && (6A6.SubItems.Count > 1))
- {
- singleLine = singleLine;
- }
- else
- {
- singleLine |= eTextFormat.VerticalCenter;
- }
- if (base.View == View.LargeIcon)
- {
- singleLine = eTextFormat.EndEllipsis | eTextFormat.WordBreak | eTextFormat.HorizontalCenter;
- }
- else if ((base.View == View.Details) && (6A7 != null))
- {
- if (6A7.TextAlign == HorizontalAlignment.Center)
- {
- singleLine |= eTextFormat.HorizontalCenter;
- }
- else if (6A7.TextAlign == HorizontalAlignment.Right)
- {
- singleLine |= eTextFormat.Right;
- }
- bounds.X += 2;
- }
- else if ((base.View == View.List) || (base.View == View.SmallIcon))
- {
- bounds.X += 2;
- }
- 54.18I(6A5, 6A6.Text, 6A8, 6A9, bounds, singleLine);
- if ((base.View == View.Tile) && (6A6.SubItems.Count > 1))
- {
- Size size = 54.18K(6A5, 6A6.Text, 6A8);
- bounds.Y += size.Height;
- bounds.Height -= size.Height;
- Color foreColor = 6A6.SubItems[1].ForeColor;
- if (!foreColor.IsEmpty && (foreColor != 6A9))
- {
- 6A9 = foreColor;
- }
- else
- {
- 6A9 = SystemColors.ControlDarkDark;
- }
- 54.18I(6A5, 6A6.SubItems[1].Text, 6A8, 6A9, bounds, singleLine);
- }
- }
- if ((((base.View == View.Details) || (base.StateImageList != null)) && ((base.StateImageList != null) && (6A6.StateImageIndex >= 0))) && (6A6.StateImageIndex < base.StateImageList.Images.Count))
- {
- Rectangle rectangle4 = 6A6.GetBounds(ItemBoundsPortion.Icon);
- if ((base.View == View.Details) || (base.View == View.List))
- {
- rectangle4.X -= 0x13;
- }
- else if ((base.View == View.LargeIcon) && (rectangle4.Width > base.StateImageList.ImageSize.Width))
- {
- rectangle4.X += (rectangle4.Width - base.StateImageList.ImageSize.Width) / 2;
- rectangle4.Y++;
- }
- else if ((base.View == View.Tile) && (rectangle4.Height > base.StateImageList.ImageSize.Height))
- {
- rectangle4.Y += (rectangle4.Height - base.StateImageList.ImageSize.Height) / 2;
- rectangle4.X++;
- }
- base.StateImageList.Draw(6A5, rectangle4.Location, 6A6.StateImageIndex);
- }
- if ((base.CheckBoxes && (((base.View == View.Details) || (base.View == View.List)) || ((base.View == View.SmallIcon) || (base.View == View.LargeIcon)))) && (base.StateImageList == null))
- {
- Rectangle rectangle5 = 6A6.GetBounds(ItemBoundsPortion.Icon);
- if (base.View == View.LargeIcon)
- {
- rectangle5.X += ((rectangle5.Width - this.2ES.Width) / 2) - 4;
- }
- else if (base.View == View.List)
- {
- rectangle5.X -= 0x12;
- }
- else if (((base.View == View.SmallIcon) && flag) && (base.Groups.Count > 0))
- {
- rectangle5.X -= 20;
- }
- else if (base.View == View.SmallIcon)
- {
- rectangle5.X -= 3;
- }
- else
- {
- rectangle5.X -= 0x15;
- }
- S s = 46.0UG(null);
- Office2007CheckBoxColorTable table = this.V8();
- Office2007CheckBoxStateColorTable disabled = table.Default;
- if ((6AA & ListViewItemStates.Grayed) != 0)
- {
- disabled = table.Disabled;
- }
- 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);
- }
- }
- private IList VF()
- {
- IList columns = base.Columns;
- if (!base.AllowColumnReorder)
- {
- return columns;
- }
- ArrayList list2 = new ArrayList(base.Columns);
- foreach (ColumnHeader header in columns)
- {
- list2[header.DisplayIndex] = header;
- }
- return list2;
- }
- private void VG(Graphics 6AB, ListViewItem.ListViewSubItem 6AC, Rectangle 6AD, ListViewItemStates 6AE, ColumnHeader 6AF, Color 6AG)
- {
- eTextFormat format;
- if (!this.VC(6AE, ListViewItemStates.Selected))
- {
- Rectangle rect = 6AD;
- if (!6AC.BackColor.IsEmpty)
- {
- using (SolidBrush brush = new SolidBrush(6AC.BackColor))
- {
- 6AB.FillRectangle(brush, rect);
- goto Label_0063;
- }
- }
- if (!6AG.IsEmpty)
- {
- using (SolidBrush brush2 = new SolidBrush(6AG))
- {
- 6AB.FillRectangle(brush2, rect);
- }
- }
- }
- Label_0063:
- format = eTextFormat.WordEllipsis | eTextFormat.SingleLine | eTextFormat.VerticalCenter;
- if (6AF != null)
- {
- if (6AF.TextAlign == HorizontalAlignment.Center)
- {
- format |= eTextFormat.HorizontalCenter;
- }
- else if (6AF.TextAlign == HorizontalAlignment.Right)
- {
- format |= eTextFormat.Right;
- }
- }
- Rectangle rectangle2 = Rectangle.Inflate(6AD, -2, 0);
- 54.18I(6AB, 6AC.Text, 6AC.Font, 6AC.ForeColor, rectangle2, format);
- }
- private void VH(Graphics 6AH, Rectangle 6AI, ListViewItem 6AJ)
- {
- ControlPaint.DrawFocusRectangle(6AH, 6AI, 6AJ.ForeColor, 6AJ.BackColor);
- }
- private Rectangle VI(Rectangle 6AK, bool 6AL, ListViewItem 6AM)
- {
- Rectangle rectangle = 6AK;
- if (base.View == View.Details)
- {
- if (!base.FullRowSelect && (6AM.SubItems.Count > 0))
- {
- ListViewItem.ListViewSubItem item = 6AM.SubItems[0];
- Size size = TextRenderer.MeasureText(item.Text, item.Font);
- rectangle = new Rectangle(6AK.X, 6AK.Y, size.Width, size.Height);
- rectangle.X += 4;
- rectangle.Width++;
- }
- else
- {
- rectangle.X += 4;
- rectangle.Width -= 4;
- }
- if (6AL)
- {
- rectangle.X--;
- }
- }
- return rectangle;
- }
- private ElementStyle VJ()
- {
- this.2EO.0AK(this.GetColorScheme());
- return ElementStyleDisplay.0AQ(this.2EO);
- }
- private void VK(object 6AN, EventArgs 6AO)
- {
- if (C.HL(this))
- {
- 1U.1V v = new 1U.1V(0, 0, base.Width, base.Height);
- 1U.0IG(base.Handle, ref v, IntPtr.Zero, 0x401);
- }
- }
- protected override void WndProc(ref Message m)
- {
- if (this.2EN != null)
- {
- if (this.2EN.W6(ref m))
- {
- base.WndProc(ref m);
- }
- }
- else
- {
- base.WndProc(ref m);
- }
- }
- [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.")]
- public ElementStyle Border
- {
- get
- {
- return this.2EO;
- }
- }
- [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public System.Windows.Forms.BorderStyle BorderStyle
- {
- get
- {
- return base.BorderStyle;
- }
- set
- {
- }
- }
- protected override System.Windows.Forms.CreateParams CreateParams
- {
- get
- {
- System.Windows.Forms.CreateParams createParams = base.CreateParams;
- createParams.ExStyle &= ~(createParams.ExStyle & 0x200);
- return createParams;
- }
- }
- Color 0E.BackColor
- {
- get
- {
- return this.BackColor;
- }
- }
- ElementStyle 0E.BorderStyle
- {
- get
- {
- return this.VJ();
- }
- }
- IntPtr 0E.Handle
- {
- get
- {
- return base.Handle;
- }
- }
- int 0E.Height
- {
- get
- {
- return base.Height;
- }
- }
- bool 0E.IsHandleCreated
- {
- get
- {
- return base.IsHandleCreated;
- }
- }
- int 0E.Width
- {
- get
- {
- return base.Width;
- }
- }
- Color 0E.BackColor
- {
- get
- {
- return this.BackColor;
- }
- }
- ElementStyle 0E.BorderStyle
- {
- get
- {
- return this.VJ();
- }
- }
- IntPtr 0E.Handle
- {
- get
- {
- return base.Handle;
- }
- }
- int 0E.Height
- {
- get
- {
- return base.Height;
- }
- }
- bool 0E.IsHandleCreated
- {
- get
- {
- return base.IsHandleCreated;
- }
- }
- int 0E.Width
- {
- get
- {
- return base.Width;
- }
- }
- [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public bool HideSelection
- {
- get
- {
- return base.HideSelection;
- }
- set
- {
- base.HideSelection = false;
- }
- }
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
- public bool OwnerDraw
- {
- get
- {
- return base.OwnerDraw;
- }
- set
- {
- base.OwnerDraw = value;
- }
- }
- [DefaultValue((string) null), Browsable(false)]
- public BaseRenderer Renderer
- {
- get
- {
- return this.2EW;
- }
- set
- {
- this.2EW = value;
- this.2EQ = null;
- }
- }
- [Browsable(false), DefaultValue(1)]
- public eRenderMode RenderMode
- {
- get
- {
- return this.2EX;
- }
- set
- {
- if (this.2EX != value)
- {
- this.2EX = value;
- this.2EQ = null;
- base.Invalidate(true);
- }
- }
- }
- [StructLayout(LayoutKind.Sequential)]
- private struct 0F
- {
- public IntPtr 2EZ;
- public IntPtr 2F0;
- public int 2F1;
- }
- [StructLayout(LayoutKind.Sequential)]
- private struct 0G
- {
- public ListViewEx.0F 2F2;
- public int 2F3;
- public IntPtr 2F4;
- public 88.8O 2F5;
- public IntPtr 2F6;
- public int 2F7;
- public IntPtr 2F8;
- }
- private class 0H : NativeWindow
- {
- private ListViewEx 2F9;
- private bool 2FA;
- private Point 2FB = Point.Empty;
- public 0H(ListViewEx parent)
- {
- this.2F9 = parent;
- IntPtr handle = new IntPtr(88.1CM(parent.Handle, 0x101f, IntPtr.Zero, IntPtr.Zero));
- if (handle != IntPtr.Zero)
- {
- base.AssignHandle(handle);
- }
- }
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == 15)
- {
- 88.8P p = new 88.8P();
- IntPtr hdc = 88.1CJ(m.HWnd, ref p);
- try
- {
- Graphics targetGraphics = Graphics.FromHdc(hdc);
- try
- {
- 88.8O o = new 88.8O();
- 88.1CS(m.HWnd, ref o);
- Rectangle rect = new Rectangle(0, 0, o.5CA, o.5C9);
- using (BufferedBitmap bitmap = new BufferedBitmap(hdc, rect))
- {
- this.2F9.V6(bitmap.Graphics, rect);
- IList list = this.2F9.VF();
- int x = 0;
- foreach (ColumnHeader header in list)
- {
- Rectangle bounds = new Rectangle(x, 0, header.Width, o.5C9);
- ListViewItemStates showKeyboardCues = ListViewItemStates.ShowKeyboardCues;
- if (this.2FA && bounds.Contains(this.2FB))
- {
- Rectangle rectangle3 = bounds;
- rectangle3.Inflate(-6, 0);
- if (rectangle3.Contains(this.2FB))
- {
- showKeyboardCues |= ListViewItemStates.Selected;
- }
- }
- this.2F9.V9(new DrawListViewColumnHeaderEventArgs(bitmap.Graphics, bounds, header.DisplayIndex, header, showKeyboardCues, SystemColors.ControlText, Color.Empty, this.2F9.Font));
- x += header.Width;
- }
- bitmap.Render(targetGraphics);
- }
- }
- finally
- {
- targetGraphics.Dispose();
- }
- }
- finally
- {
- 88.1CK(m.HWnd, ref p);
- }
- }
- else
- {
- if (m.Msg == 0x201)
- {
- if (this.2F9.HeaderStyle == ColumnHeaderStyle.Clickable)
- {
- this.2FA = true;
- this.2FB = new Point(88.1DI(m.LParam), 88.1DJ(m.LParam));
- 88.1CR(m.HWnd, IntPtr.Zero, IntPtr.Zero, 88.8E.4UR);
- }
- }
- else if (m.Msg == 0x202)
- {
- this.2FA = false;
- this.2FB = Point.Empty;
- }
- else if ((m.Msg == 0x200) && this.2FA)
- {
- this.2FB = new Point(88.1DI(m.LParam), 88.1DJ(m.LParam));
- }
- base.WndProc(ref m);
- }
- }
- }
- }
- }