Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/10/11 14:28:48 (12 years ago)
Author:
ascheibe
Message:

#831

  • completed SandboxManager
  • added SandboxApplicationManager for Hive
  • DefaultApplicationManager is now a subclass of the SandboxApplicationManager
  • ApplicationManager now instantiates the LightweightApplicationManager only if it is accessed to avoid calling InitializeLifetimeService(..) in a sandbox
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ApplicationManager.cs

    r5445 r6174  
    2828  /// </summary>
    2929  public static class ApplicationManager {
    30     // the singleton instance is initialized to LightweightApplicationManager as long as no other application manager is registered
    31     private static IApplicationManager appManager = new LightweightApplicationManager();
     30    // the singleton instance is initialized to LightweightApplicationManager as long as no other application manager is registered   
     31    private static IApplicationManager appManager;
     32
    3233    /// <summary>
    3334    /// Gets the application manager singleton.
    3435    /// </summary>
    3536    public static IApplicationManager Manager {
    36       get { return appManager; }
     37      get {
     38        if (appManager == null)
     39          appManager = new LightweightApplicationManager();
     40        return appManager;
     41      }
    3742    }
    3843
     
    4247    /// <param name="manager"></param>
    4348    internal static void RegisterApplicationManager(IApplicationManager manager) {
    44       if (!(appManager is LightweightApplicationManager)) throw new InvalidOperationException("The application manager has already been set.");
     49      if (appManager != null && !(appManager is LightweightApplicationManager)) throw new InvalidOperationException("The application manager has already been set.");
    4550      else {
    4651        appManager = manager;
Note: See TracChangeset for help on using the changeset viewer.