示例#1
0
 protected int SetState(GroupState state, GroupState stateMask)
 {
     BrightIdeasSoftware.NativeMethods.LVGROUP2 group = new BrightIdeasSoftware.NativeMethods.LVGROUP2 {
         cbSize    = (uint)Marshal.SizeOf(typeof(BrightIdeasSoftware.NativeMethods.LVGROUP2)),
         mask      = 4,
         state     = (uint)state,
         stateMask = (uint)stateMask
     };
     return(BrightIdeasSoftware.NativeMethods.SetGroupInfo(this.ListView, this.GroupId, group));
 }
示例#2
0
        internal BrightIdeasSoftware.NativeMethods.LVGROUP2 AsNativeGroup(bool withId)
        {
            BrightIdeasSoftware.NativeMethods.LVGROUP2 lvgroup = new BrightIdeasSoftware.NativeMethods.LVGROUP2 {
                cbSize    = (uint)Marshal.SizeOf(typeof(BrightIdeasSoftware.NativeMethods.LVGROUP2)),
                mask      = 13,
                pszHeader = this.Header,
                uAlign    = (uint)this.HeaderAlignment,
                stateMask = (uint)this.StateMask,
                state     = (uint)this.State
            };
            if (withId)
            {
                lvgroup.iGroupId = this.GroupId;
                lvgroup.mask    ^= 0x10;
            }
            if (!string.IsNullOrEmpty(this.Footer))
            {
                lvgroup.pszFooter = this.Footer;
                lvgroup.mask     ^= 2;
            }
            if (!string.IsNullOrEmpty(this.Subtitle))
            {
                lvgroup.pszSubtitle = this.Subtitle;
                lvgroup.mask       ^= 0x100;
            }
            if (!string.IsNullOrEmpty(this.Task))
            {
                lvgroup.pszTask = this.Task;
                lvgroup.mask   ^= 0x200;
            }
            if (!string.IsNullOrEmpty(this.TopDescription))
            {
                lvgroup.pszDescriptionTop = this.TopDescription;
                lvgroup.mask ^= 0x400;
            }
            if (!string.IsNullOrEmpty(this.BottomDescription))
            {
                lvgroup.pszDescriptionBottom = this.BottomDescription;
                lvgroup.mask ^= 0x800;
            }
            int imageIndex = this.GetImageIndex(this.TitleImage);

            if (imageIndex >= 0)
            {
                lvgroup.iTitleImage = imageIndex;
                lvgroup.mask       ^= 0x1000;
            }
            imageIndex = this.GetImageIndex(this.ExtendedImage);
            if (imageIndex >= 0)
            {
                lvgroup.iExtendedImage = imageIndex;
                lvgroup.mask          ^= 0x2000;
            }
            if (!string.IsNullOrEmpty(this.SubsetTitle))
            {
                lvgroup.pszSubsetTitle = this.SubsetTitle;
                lvgroup.mask          ^= 0x8000;
            }
            if (this.VirtualItemCount > 0)
            {
                lvgroup.cItems = this.VirtualItemCount;
                lvgroup.mask  ^= 0x4000;
            }
            return(lvgroup);
        }