public void RemoveElement(bool join = false) { _primitives.RemoveAll(obj => obj.Container != null); if (Connectors.RemoveAll(obj => true) > 0) { DisconnectSiblings(); RemovePowerLines(); } if (Join.Any()) { if (!join) { foreach (var j in Join) { j.RemoveElement(true); } } Join.Clear(); } Variables.Clear(); OverrideFunction = false; Type = ElementType.None; }