private void RemoveComponentImmediate(Component component) { if (component == null) { throw new ArgumentNullException(nameof(component)); } if (component.Deleted) { return; } if (component.Running) { component.Shutdown(); } component.OnRemove(); ComponentRemoved?.Invoke(this, new ComponentEventArgs(component)); DeleteComponent(component); }
private void RemoveComponentDeferred(Component component) { if (component == null) { throw new ArgumentNullException(nameof(component)); } if (component.Deleted) { return; } _deleteList.Add(component); if (component.Running) { component.Shutdown(); } component.OnRemove(); ComponentRemoved?.Invoke(this, new ComponentEventArgs(component)); }