#region CPL License
/*
Nuclex Framework
Copyright (C) 2002-2010 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
#if ENABLE_SERVICEMANAGER
namespace Nuclex.Support.Services {
partial class ServiceManager {
#region class ForContext
/// Manages the context of the "For" modifier
public class ForContext {
/// Initializes a new "For" context of the service manager
/// Service manager the context operates on
/// Contract that is being modified
internal ForContext(ServiceManager serviceManager, Type contractType) {
this.serviceManager = serviceManager;
this.contractType = contractType;
}
/// Uses the specified implementation for the contract
///
/// Implementation that will be used for the contract
///
public void Use(object contractImplementation) { }
///
/// Uses the provided object as a prototype for the contract implementation
///
///
/// Contract implementation that will be used as a prototype
///
public void UsePrototype(object contractImplementationPrototype) { }
/// Selects the default implementation to use for the contract
///
/// Implementation that will be used as the default for the contract
///
public void UseDefault(Type implementationType) { }
/// Service manager the "For" context operates on
protected ServiceManager serviceManager;
/// Contract that is being modified
protected Type contractType;
}
#endregion // class ForContext
#region class ForContext<>
/// Manages the context of the "For" modifier
public class ForContext : ForContext {
/// Initializes a new "For" context of the service manager
/// Service manager the context operates on
internal ForContext(ServiceManager serviceManager) :
base(serviceManager, typeof(ContractType)) { }
/// Uses the specified implementation for the contract
///
/// Implementation that will be used for the contract
///
public void Use(ContractType implementation) { }
///
/// Uses the provided object as a prototype for the contract implementation
///
///
/// Type of the implementation that will be used as a prototype
///
///
/// Contract implementation that will be used as a prototype
///
public void UsePrototype(PrototypeType contractImplementationPrototype)
where PrototypeType : ContractType, ICloneable { }
/// Selects the default implementation to use for the contract
///
/// Implementation that will be used as the default for the contract
///
public void UseDefault()
where ImplementationType : ContractType { }
}
#endregion // class ForContext<>
}
} // namespace Nuclex.Support.Services
#endif // ENABLE_SERVICEMANAGER