If your goal is to have the dragged vertex in a different style while pressing the shift key, I slightly changed the dragInteractiveOverlay class in the DraggedPointStyle project to show how to do that. Notice that now we have a new property DraggedControlPointStyleWithShiftKey.
class DragInteractiveOverlay : EditInteractiveOverlay
{
private PointStyle controlPointStyle;
private PointStyle draggedControlPointStyle;
private PointStyle draggedControlPointStyleWithShiftKey;
private bool IsShiftKeyDown = false;
public PointStyle ControlPointStyle
{
get { return controlPointStyle; }
set { controlPointStyle = value; }
}
public PointStyle DraggedControlPointStyle
{
get { return draggedControlPointStyle; }
set { draggedControlPointStyle = value; }
}
public PointStyle DraggedControlPointStyleWithShiftKey
{
get { return draggedControlPointStyleWithShiftKey; }
set { draggedControlPointStyleWithShiftKey = value; }
}
protected override InteractiveResult KeyDownCore(KeyEventInteractionArguments interactionArguments)
{
IsShiftKeyDown = interactionArguments.IsShiftKeyPressed;
return base.KeyDownCore(interactionArguments);
}
protected override InteractiveResult KeyUpCore(KeyEventInteractionArguments interactionArguments)
{
IsShiftKeyDown = interactionArguments.IsShiftKeyPressed;
return base.KeyUpCore(interactionArguments);
}
//Overrides the DrawCore function.
protected override void DrawCore(GeoCanvas canvas)
{
//Draws the Edit Shapes as default.
Collection<SimpleCandidate> labelsInAllLayers = new Collection<SimpleCandidate>();
EditShapesLayer.Open();
EditShapesLayer.Draw(canvas, labelsInAllLayers);
canvas.Flush();
//Draws the control points.
ExistingControlPointsLayer.Open();
Collection<Feature> controlPoints = ExistingControlPointsLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns);
//Loops thru the control points.
foreach (Feature feature in controlPoints)
{
//Looks at the value of "state" to draw the control point as dragged or not.
if (feature.ColumnValues["state"] != "selected")
{
Feature[] features = new Feature[1] { feature };
controlPointStyle.Draw(features, canvas, labelsInAllLayers, labelsInAllLayers);
}
else
{
Feature[] features = new Feature[1] { feature };
if (IsShiftKeyDown == false)
{
draggedControlPointStyle.Draw(features, canvas, labelsInAllLayers, labelsInAllLayers);
}
else
{
draggedControlPointStyleWithShiftKey.Draw(features, canvas, labelsInAllLayers, labelsInAllLayers);
}
}
}
}
}