Canguro.Commands.View.Selection.pick C# (CSharp) Méthode

pick() private méthode

private pick ( int x, int y ) : object
x int
y int
Résultat object
        private object pick(int x, int y)
        {
            // If mouse has moved, generate empty List to store candidates and throw last list away
            if ((Math.Abs(lastPickX - fx) > PickCycleMoveTolerance ||
                Math.Abs(lastPickY - fy) > PickCycleMoveTolerance) ||
                candidatesPickList == null)
            {
                candidatesPickList = Canguro.View.GraphicViewManager.Instance.PickItem(x, y);
                lastCandidatePicked = -1;
                lastPickX = fx;
                lastPickY = fy;
            }

            // Return next pick (if the list has recently been created, the first element will be returned)
            int unselectIndex = lastCandidatePicked;
            lastCandidatePicked++;
            if (lastCandidatePicked >= candidatesPickList.Count)
                lastCandidatePicked = 0;

            int count;
            if (candidatesPickList != null && ((count = candidatesPickList.Count) > 0))
            {
                // Unselect previously selected Item
                if (unselectIndex >= 0 && count > 1)
                {
                    candidatesPickList[unselectIndex].IsSelected = false;
                    Canguro.Model.Model.Instance.ChangeSelection(candidatesPickList[unselectIndex]);
                }
                return candidatesPickList[lastCandidatePicked];
            }
            else
                return null;
        }

Same methods

Selection::pick ( int x, int y, Controller wf ) : object