protected override void OnStartDrag(object sender, PInputEventArgs e) { base.OnStartDrag (sender, e); draggedNode = e.PickedNode; draggedNode.MoveToFront(); nodeStartPosition = draggedNode.Offset; }
/// <summary> /// Hilite the specified slide - or unhilite all slides if hiliteIndex is -1. /// </summary> private void HiliteSlide(int newHiliteIndex) { PNode newSlide = null; if (newHiliteIndex >= 0) { newSlide = slides[newHiliteIndex]; } if (newSlide != hiliteSlide) { // First unhilite previously hilited slide if ((hiliteSlide != null) && (hiliteSlide != focusSlide)) { // If this slide is currently animating, then kill that animation int index = (int)hiliteSlide.Tag; if (slideActivities[index] != null) { slideActivities[index].Terminate(); slideActivities[index] = null; } (hiliteSlide as PMultiSizeImage).ShowThumb = true; (hiliteSlide as PMultiSizeImage).Hilite = false; PTransformActivity activity = hiliteSlide.AnimateToMatrix(GetUnfocusedMatrix(hiliteSlide, (int)hiliteSlide.Tag), SLIDEBAR_ANIMATION_TIME_MILLIS); // Put the slide in order when the animation finishes activity.ActivityFinished = new ActivityFinishedDelegate(HiliteActivityFinished); hiliteSlide = null; } // Then hilite new slide (as long is it isn't the currently focused slide) if (newSlide != focusSlide) { hiliteSlide = newSlide; if (hiliteSlide != null) { PMatrix matrix = GetUnfocusedMatrix(hiliteSlide, (int)hiliteSlide.Tag); matrix.ScaleBy(1.3f, (hiliteSlide.Bounds.Width / 2), hiliteSlide.Bounds.Height); (hiliteSlide as PMultiSizeImage).Hilite = true; hiliteSlide.MoveToFront(); currentPosition.MoveToFront(); slideActivities[newHiliteIndex] = hiliteSlide.AnimateToMatrix(matrix, SLIDEBAR_ANIMATION_TIME_MILLIS); } } } }