protected override object CreateInstance(Type itemType) { ListViewGroupEx group = (ListViewGroupEx)base.CreateInstance(itemType); group.Name = CreateListViewGroupName((ListViewGroupExCollection)editValue); return(group); }
internal void SetGroupState(ListViewGroupEx group, ListViewGroupState item, bool value) { LVGROUP mgroup = new LVGROUP(ListViewGroupMask.State); mgroup.SetState(item, value); this.CallWhenHandleValid(c => SendMessage(ListViewMessage.SetGroupInfo, group.ID, mgroup)); }
internal void UpdateGroupNative(ListViewGroupEx group, bool invalidate = true) { LVGROUP nGroup = group.AsLVGROUP(); nGroup.SetState(ListViewGroupState.Collapsible, collapsible); this.CallWhenHandleValid(c => { SendMessage(ListViewMessage.SetGroupInfo, group.ID, nGroup); if (invalidate) { base.Invalidate(); } }); }
internal void RemoveGroupFromListView(ListViewGroupEx group) { EnsureDefaultGroup(); foreach (ListViewItem item in group.Items) { if (item.ListView == this) { UpdateItem(new LVITEM(item.Index) { GroupId = I_GROUPIDNONE }); } } RemoveGroupNative(group); UpdateGroupView(); }
internal void InsertGroupInListView(int index, ListViewGroupEx group) { UpdateGroupView(); EnsureDefaultGroup(); InsertGroupNative(index, group); if ((groups.Count == 1) && GroupsEnabled) { this.CallWhenHandleValid(c => { foreach (ListViewItem item in Items) { if (item.Group == null) { var lvItem = new LVITEM(index); lvItem.GroupId = group.ID; User32.SendMessage(Handle, ListViewMessage.SetItem, 0, lvItem); } } }); } }
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException(nameof(destinationType)); } if ((destinationType == typeof(InstanceDescriptor)) && (value is ListViewGroupEx)) { ListViewGroupEx group = (ListViewGroupEx)value; ConstructorInfo constructor = typeof(ListViewGroupEx).GetConstructor(System.Type.EmptyTypes); if (constructor != null) { return(new InstanceDescriptor(constructor, null, false)); } } if ((destinationType == typeof(string)) && (value == null)) { return("None"); } return(base.ConvertTo(context, culture, value, destinationType)); }
internal ListViewGroupState GetGroupState(ListViewGroupEx group, ListViewGroupState stateMask = (ListViewGroupState)0xFF) => (ListViewGroupState)SendMessage(ListViewMessage.GetGroupState, GetGroupId(Groups.IndexOf(group)), new IntPtr((int)stateMask));
private void RemoveGroupNative(ListViewGroupEx group) { this.CallWhenHandleValid(c => SendMessage(ListViewMessage.RemoveGroup, group.ID, IntPtr.Zero)); }
private void InsertGroupNative(int index, ListViewGroupEx group) { this.CallWhenHandleValid(c => this.SendMessage(ListViewMessage.InsertGroup, index, group.AsLVGROUP())); }
public GroupHeaderImageListIndexer(ListViewGroupEx owner) { this.owner = owner; }