protected override void StartCore(dynamic parameters = null) { if (parameters == null || parameters.ClockedTrailShapes == null) { throw new Exception("Parameter ClockedTrailShapes is required."); } ((List <dynamic>)parameters.ClockedTrailShapes).ForEach(clockedTrailShape => { var tempClockedTrailShape = new ClockedTrailShape(); tempClockedTrailShape.Clock = new TimerClock((double)clockedTrailShape.Interval, args => SetTrailColors(tempClockedTrailShape)); //, 0); tempClockedTrailShape.TrailShape = clockedTrailShape.TrailShape; ClockedTrailShapes.Add(tempClockedTrailShape); }); LoopClock.Start(); ClockedTrailShapes.ForEach(cts => cts.Start()); base.StartCore(null); }
protected override void StopCore(bool force) { ClockedTrailShapes.ForEach(cts => cts.Stop()); LoopClock.Stop(); base.StopCore(force); }