punker76 / gong-wpf-dragdrop

The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with RelativeInsertPosition enum definition

akaztp opened this issue · comments

Enumeration of RelativeInsertPosition on DropInfo.cs file should be set to powers of 2 since it is a Flags enumeration.
Now is:
[Flags]
public enum RelativeInsertPosition
{
BeforeTargetItem = 0,
AfterTargetItem = 1,
TargetItemCenter = 2
}

which makes "bef" become true on:

RelativeInsertPosition pos = RelativeInsertPosition.AfterTargetItem;
bool bef = pos.HasFlag(RelativeInsertPosition.BeforeTargetItem);

On a local version of 0.1.3.6, I corrected the enumeration to:

[Flags]
public enum RelativeInsertPosition
{
    BeforeTargetItem = 1,
    AfterTargetItem = 2,
    TargetItemCenter = 4
}

And then it worked correctly.

can't find any problem with the current solution

@akaztp Should be fixed with 3b0995c