コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }