protected override object CreateInstance(Type itemType)
        {
            ListViewGroupEx group = (ListViewGroupEx)base.CreateInstance(itemType);

            group.Name = CreateListViewGroupName((ListViewGroupExCollection)editValue);
            return(group);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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();
                                            }
                                     });
        }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
 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);
                 }
             }
         });
     }
 }
Esempio n. 6
0
 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));
 }
Esempio n. 7
0
 internal ListViewGroupState GetGroupState(ListViewGroupEx group, ListViewGroupState stateMask = (ListViewGroupState)0xFF) => (ListViewGroupState)SendMessage(ListViewMessage.GetGroupState, GetGroupId(Groups.IndexOf(group)), new IntPtr((int)stateMask));
Esempio n. 8
0
 private void RemoveGroupNative(ListViewGroupEx group)
 {
     this.CallWhenHandleValid(c => SendMessage(ListViewMessage.RemoveGroup, group.ID, IntPtr.Zero));
 }
Esempio n. 9
0
 private void InsertGroupNative(int index, ListViewGroupEx group)
 {
     this.CallWhenHandleValid(c => this.SendMessage(ListViewMessage.InsertGroup, index, group.AsLVGROUP()));
 }
Esempio n. 10
0
 public GroupHeaderImageListIndexer(ListViewGroupEx owner)
 {
     this.owner = owner;
 }