private void MakeDrawingActions() { DrawingActions = new List <DrawingAction>(); foreach (var path in Drawing) { // Add action to start drawing the path DrawingActions.Add(new DrawingAction() { Timestamp = path.Timestamp, Action = () => { DrawingZone.StartDrawing(); } }); foreach (var pathStep in path) { // Add action to draw the step point DrawingActions.Add(new DrawingAction() { Timestamp = path.Timestamp + pathStep.Timestamp, Action = () => { DrawingZone.AddPointDrawing(pathStep.NormalizedPosition); DrawingZone.Refresh(); } }); } // Add action to end the drawing DrawingActions.Add(new DrawingAction() { Timestamp = DrawingActions.Last().Timestamp, Action = () => { DrawingZone.StopDrawing(); } }); } }
public DrawingPlayer(List <Path> drawing, DrawingZone drawingZone) { Drawing = drawing; DrawingZone = drawingZone; DrawingZone.TypeDrawZone = TypeDrawZone.Player; MakeDrawingActions(); }
private void AddNewRegion(int index = -1) { ProjectSettingsMain.Zone_FlagVoiceControl = false; DrawingZone drawingZone = new DrawingZone(index); if (drawingZone.ShowDialog() == DialogResult.OK) { if (index == -1) { AddRegionList(); } else { EditRegionList(index); } } ProjectSettingsMain.Zone_FlagVoiceControl = true; }