src/Misc/EFTools/XmlCore/Core/Context/ServiceManager.cs
/// <summary>
///     Publishes the given service type, but does not declare an instance yet.  When someone
///     requests the service the PublishServiceCallback will be invoked to create the instance.
///     The callback is only invoked once and after that the instance it returned is cached.
/// </summary>
/// <typeparam name="ServiceType">The type of service to publish.</typeparam>
/// <param name="callback">A callback to be invoked when the service is required.</param>
/// <exception cref="ArgumentNullException">If callback is null.</exception>
/// <exception cref="ArgumentException">If ServiceType has already been published.</exception>
Publishes the given service type, but does not declare an instance yet.  When someone
requests the service the PublishServiceCallback will be invoked to create the instance.
The callback is only invoked once and after that the instance it returned is cached.
Publishes the given service type but does not declare an instance yet . When someone requests the service the PublishServiceCallback will be invoked to create the instance . The callback is only invoked once and after that the instance it returned is cached .
public void Publish<TServiceType>(PublishServiceCallback<TServiceType> callback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }
            var proxy = new PublishProxy<TServiceType>(callback);
            Publish(typeof(TServiceType), proxy.Callback);
        }
public void Publish < TServiceType > ( PublishServiceCallback < TServiceType > callback ) { if ( callback == null ) { throw new ArgumentNullException ( " " ) ; } var proxy = new PublishProxy < TServiceType > ( callback ) ; Publish ( typeof ( TServiceType ) , proxy . Callback ) ; }
Publishes the given service type, but does not declare an instance yet.
Publishes the given service type but does not declare an instance yet .
// Call the standard Subscribe method and use a generic proxy
If callback is null.
If callback is null .
If ServiceType has already been published.
If ServiceType has already been published .
callback
PublishServiceCallback<TServiceType>
A callback to be invoked when the service is required.
A callback to be invoked when the service is required .
typeparam
The type of service to publish.
The type of service to publish .