Microsoft.Xna.Framework.GameServiceContainer.RemoveService C# (CSharp) Method

RemoveService() public method

public RemoveService ( Type type ) : void
type Type
return void
        public void RemoveService(Type type)
        {
            if (type == null)
                throw new ArgumentNullException("type");

            services.Remove(type);
        }
        

Usage Example

Esempio n. 1
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_isDisposed)
            {
                if (disposing)
                {
                    // Dispose loaded game components
                    //                    for (int i = 0; i < _components.Count; i++)
                    //                    {
                    //                        var disposable = _components[i] as IDisposable;
                    //                        if (disposable != null)
                    //                            disposable.Dispose();
                    //                    }
                    //                    _components = null;

                    //                    if (_content != null)
                    //                    {
                    //                        _content.Dispose();
                    //                        _content = null;
                    //                    }

                    if (_graphicsDeviceManager != null)
                    {
                        (_graphicsDeviceManager as GraphicsDeviceManager).Dispose();
                        _graphicsDeviceManager = null;
                    }

                    if (Platform != null)
                    {
                        Platform.Activated   -= OnActivated;
                        Platform.Deactivated -= OnDeactivated;
                        _services.RemoveService(typeof(GamePlatform));

                        Platform.Dispose();
                        Platform = null;
                    }

                    //                    ContentTypeReaderManager.ClearTypeCreators();

                    SoundEffect.PlatformShutdown();
                }
#if ANDROID
                Activity = null;
#endif
                _isDisposed = true;
                _instance   = null;
            }
        }