private void PrepareInstrument(PInstrument type) { Task.Run(() => { switch (type) { case PInstrument.Level: { DrawPrototype = Level.DrawPrototype; SetMenuAct.Invoke("New level", Level.StGetSets(), null, null); } return; case PInstrument.Trend: { DrawPrototype = Trend.DrawFirstPoint; SetMenuAct.Invoke("New trend", Trend.StGetSets(), null, null); Chart.PaintingTrend = PaintingTrend; } return; } }); }