private void handle_figure_state_changed(InteractiveFigure figure, FigureState state) { if (state == FigureState.Closed) { int index = this.FiguresTyped.FindIndex((x) => figure == x); if (index >= 0) { this.FiguresTyped.RemoveAt(index); if (this.ActiveFigureIndex >= index) { this.ActiveFigureIndex = Math.Max(this.ActiveFigureIndex - 1, this.FiguresTyped.Count - 1); } figure.StateChange -= handle_figure_state_changed; } } }
void BaseImperativeFigure_StateChanged(InteractiveFigure arg1, FigureState arg2) { this.State = arg2; }