internal LVGROUP GetGroupInfo(int groupIndex, ListViewGroupMask mask) { if (IsHandleCreated) { try { LVGROUP mgroup = new LVGROUP(mask); if (0 != SendMessage(ListViewMessage.GetGroupInfoByIndex, groupIndex, mgroup)) { return(mgroup); } } catch { } } return(null); }
/*public LVGROUP(ListViewGroupEx grp) * { * this.cbSize = Marshal.SizeOf(this); * this.Header = grp.Header; * this.ID = grp.ID; * this.SetAlignment(grp.HeaderAlignment, grp.FooterAlignment); * this.Footer = grp.Footer; * this.DescriptionBottom = grp.DescriptionBottom; * this.DescriptionTop = grp.DescriptionTop; * this.Subtitle = grp.Subtitle; * this.Task = grp.Task; * if (grp.TitleImageIndex > 0) * { * this.iTitleImage = grp.TitleImageIndex; * this.mask |= ListViewGroupMask.TitleImage; * } * ListViewGroupState s, m; * grp.GetSetState(out m, out s); * if (s != ListViewGroupState.Normal) * { * this.stateMask = m; * this.state = s; * this.mask |= ListViewGroupMask.State; * } * }*/ public LVGROUP(ListViewGroupMask mask = ListViewGroupMask.None, string header = null) { cbSize = Marshal.SizeOf(this); this.mask = mask; if (header != null) { this.Header = header; } else if ((mask & ListViewGroupMask.Header) != 0) { InteropUtil.AllocString(ref pszHeader, ref cchHeader); } if ((mask & ListViewGroupMask.Footer) != 0) { InteropUtil.AllocString(ref pszFooter, ref cchFooter); } if ((mask & ListViewGroupMask.Subtitle) != 0) { InteropUtil.AllocString(ref pszSubtitle, ref cchSubtitle); } if ((mask & ListViewGroupMask.Task) != 0) { InteropUtil.AllocString(ref pszTask, ref cchTask); } if ((mask & ListViewGroupMask.DescriptionBottom) != 0) { InteropUtil.AllocString(ref pszDescriptionBottom, ref cchDescriptionBottom); } if ((mask & ListViewGroupMask.DescriptionTop) != 0) { InteropUtil.AllocString(ref pszDescriptionTop, ref cchDescriptionTop); } }
public void SetState(ListViewGroupState state, bool on = true) { this.mask |= ListViewGroupMask.State; this.stateMask |= state; EnumUtil.SetFlags(ref this.state, state, on); }
public void SetAlignment(HorizontalAlignment header, HorizontalAlignment footer) { this.uAlign = (uint)(footer == HorizontalAlignment.Left ? 8 : (footer == HorizontalAlignment.Center ? 0x10 : 0x20)) | (uint)(header == HorizontalAlignment.Left ? 1 : (header == HorizontalAlignment.Center ? 2 : 4)); this.mask |= ListViewGroupMask.Align; }
/*public LVGROUP(ListViewGroupEx grp) { this.cbSize = Marshal.SizeOf(this); this.Header = grp.Header; this.ID = grp.ID; this.SetAlignment(grp.HeaderAlignment, grp.FooterAlignment); this.Footer = grp.Footer; this.DescriptionBottom = grp.DescriptionBottom; this.DescriptionTop = grp.DescriptionTop; this.Subtitle = grp.Subtitle; this.Task = grp.Task; if (grp.TitleImageIndex > 0) { this.iTitleImage = grp.TitleImageIndex; this.mask |= ListViewGroupMask.TitleImage; } ListViewGroupState s, m; grp.GetSetState(out m, out s); if (s != ListViewGroupState.Normal) { this.stateMask = m; this.state = s; this.mask |= ListViewGroupMask.State; } }*/ public LVGROUP(ListViewGroupMask mask = ListViewGroupMask.None, string header = null) { cbSize = Marshal.SizeOf(this); this.mask = mask; if (header != null) this.Header = header; else if ((mask & ListViewGroupMask.Header) != 0) InteropUtil.AllocString(ref pszHeader, ref cchHeader); if ((mask & ListViewGroupMask.Footer) != 0) InteropUtil.AllocString(ref pszFooter, ref cchFooter); if ((mask & ListViewGroupMask.Subtitle) != 0) InteropUtil.AllocString(ref pszSubtitle, ref cchSubtitle); if ((mask & ListViewGroupMask.Task) != 0) InteropUtil.AllocString(ref pszTask, ref cchTask); if ((mask & ListViewGroupMask.DescriptionBottom) != 0) InteropUtil.AllocString(ref pszDescriptionBottom, ref cchDescriptionBottom); if ((mask & ListViewGroupMask.DescriptionTop) != 0) InteropUtil.AllocString(ref pszDescriptionTop, ref cchDescriptionTop); }
public void SetState(ListViewGroupState state, bool on = true) { this.mask |= ListViewGroupMask.State; this.stateMask |= state; this.state |= on ? state : 0; }