Exemplo n.º 1
0
        protected override void Setup()
        {
            LogManager.SetLoggerFactory(Log4NetLoggerFactory.Instance);
            GlobalContext.Properties["LogFileName"] = ApplicationName;
            XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(BinaryPath, "log4net.config")));

            var builder = new ContainerBuilder();

            Initialize(builder);

            var container = builder.Build();

            _factory             = container.Resolve <PhotonPeerFactory>();
            ConnectionCollection = container.Resolve <PhotonConnectionCollection>();
            _backgroundThreads   = container.Resolve <IEnumerable <IBackgroundThread> >();

            ResolveParameters(container);

            foreach (var backgroundthread in _backgroundThreads)
            {
                backgroundthread.Setup();
                ThreadPool.QueueUserWorkItem(backgroundthread.Run);
            }

            if (ConnectsToMaster)
            {
                ConnectToMaster();
            }
        }
        protected override void Setup()
        {
            LogManager.SetLoggerFactory(Log4NetLoggerFactory.Instance);
            GlobalContext.Properties["LogFileName"] = ApplicationName;
            XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(BinaryPath, "log4net.config")));

            var builder = new ContainerBuilder();

            Initialize(builder);

            var container = builder.Build();

            _factory = container.Resolve<PhotonPeerFactory>();
            ConnectionCollection = container.Resolve<PhotonConnectionCollection>();
            _backgroundThreads = container.Resolve<IEnumerable<IBackgroundThread>>();

            ResolveParameters(container);

            foreach (var backgroundthread in _backgroundThreads)
            {
                backgroundthread.Setup();
                ThreadPool.QueueUserWorkItem(backgroundthread.Run);
            }

            if (ConnectsToMaster)
            {
                ConnectToMaster();
            }
        }