Microsoft.Xna.Framework.GameServiceContainer.GetService C# (CSharp) Méthode

GetService() public méthode

public GetService ( Type type ) : object
type Type
Résultat object
        public object GetService(Type type)
        {
            if (type == null)
                throw new ArgumentNullException("type");
						
            object service;
            if (services.TryGetValue(type, out service))
                return service;

            return null;
        }

Same methods

GameServiceContainer::GetService ( ) : T

Usage Example

    public void TestServiceConstructor() {
      var services = new GameServiceContainer();

      using (var manager = new InputManager(services)) {
        Assert.IsNotNull(services.GetService(typeof(IInputService)));
      }

      Assert.IsNull(services.GetService(typeof(IInputService)));
    }
All Usage Examples Of Microsoft.Xna.Framework.GameServiceContainer::GetService