コード例 #1
0
    protected void InitDefaults()
    {
      // Check if the required service is already present, then no action is required
      bool pathManagerAvailable = ServiceRegistration.Get<Common.PathManager.IPathManager>(false) != null;
      if (pathManagerAvailable && _pathManagerWrapper != null && _loggerWrapper != null)
        return;

      if (_pathManagerWrapper != null && _loggerWrapper != null) 
        return;

      // If running outside of MP2 scope
      if (!pathManagerAvailable)
      {
        ServiceRegistration.Set<Common.Logging.ILogger>(new NoLogger());

        Common.Services.PathManager.PathManager pathManager = new Common.Services.PathManager.PathManager();
        pathManager.InitializeDefaults();

        ServiceRegistration.Set<Common.PathManager.IPathManager>(pathManager);

        Common.Logging.ILogger logger = new Log4NetLogger(pathManager.GetPath(@"<LOG>"));
        logger.Info("MP2IntegrationProvider: Launching in AppDomain {0}...", AppDomain.CurrentDomain.FriendlyName);
      }

      _pathManagerWrapper = new PathManagerWrapper();
      _loggerWrapper = new LoggerWrapper();
    }
コード例 #2
0
    protected void InitDefaults()
    {
      // Check if the required service is already present, then no action is required
      bool pathManagerAvailable = ServiceRegistration.Get<Common.PathManager.IPathManager>(false) != null;
      if (pathManagerAvailable && _pathManagerWrapper != null && _loggerWrapper != null)
        return;

      if (_pathManagerWrapper != null && _loggerWrapper != null)
        return;

      // If running outside of MP2 scope
      if (!pathManagerAvailable)
      {
        ServiceRegistration.Set<Common.Logging.ILogger>(new NoLogger());

        Common.Services.PathManager.PathManager pathManager = new Common.Services.PathManager.PathManager();
        pathManager.InitializeDefaults();

        ServiceRegistration.Set<Common.PathManager.IPathManager>(pathManager);
        Common.Logging.ILogger logger = new Log4NetLogger(pathManager.GetPath(@"<LOG>"));
        ServiceRegistration.Set<Common.Logging.ILogger>(logger);
      }

      var isTve3 = IsTVE3();
      _pathManagerWrapper = new PathManagerWrapper(isTve3);
      _loggerWrapper = new LoggerWrapper();
    }