コード例 #1
0
 public UnhandledExceptionLogger()
 {
     if (_loggingInstance == null)
     {
         _loggingInstance = AppLogger.Initialize();
     }
 }
コード例 #2
0
ファイル: ClientForm.cs プロジェクト: LuchunPen/TeamPainter
        private void InitializeNetwork()
        {
            _logger = new TextLogger(rtbLog);
            AppLogger.Initialize(_logger);
            NetLogger.Initialize(_logger);
            NetProtocol.Initialize(new Protocol_12());

            _netClient = new TeamPainterNetClient();

            _netClient.ConnectEvent    += OnClientConnectHandler;
            _netClient.DisconnectEvent += OnClientDisconnectHandler;
            _traffic = new TrafficCounter(100, 0);

            InitializeCommands();
        }
コード例 #3
0
        public DefaultRegistry()
        {
            Scan(
                scan => {
                scan.TheCallingAssembly();
                //Add new projects here using AssemblyName
                //scan.Assembly("CMCErmsServices");
                scan.Assembly("BusinessLogic");
                scan.Assembly("DataAccess");
                scan.Assembly("Shared");
                scan.WithDefaultConventions();
                scan.With(new ControllerConvention());
            });
            //For<IExample>().Use<Example>();
            For(typeof(ICommandHandler <>)).Use(new GenericCommandHandlerInstanceFactory());
            For(typeof(IGenericRepository <>)).Use(new GenericRepositoryInstanceFactory());

            //Registers the Static Log4Net instance after it is initialized
            For <ILog>().AlwaysUnique().Use(ctx => AppLogger.Initialize());
        }
コード例 #4
0
        private void InitializeNetwork()
        {
            _logger = new TextLogger(rtbLog);
            AppLogger.Initialize(_logger);
            NetLogger.Initialize(_logger);
            NetProtocol.Initialize(new Protocol_12());

            tbIP.Text   = _config.TCPListenAddress.Address.ToString();
            tbPort.Text = _config.TCPListenAddress.Port.ToString();

            _autorizator = new TPHostAutorizator(_config.MaxClients);
            _worker      = new TPWorkHost(_config.MaxClients);

            _autorizator.Listener.StartEvent += OnStartListener;
            _autorizator.Listener.StopEvent  += OnStopListener;

            _autorizator.DisconnectEvent    += OnDisconnectEventHandler;
            _autorizator.NewConnectionEvent += OnNewTCPConnectionEventHandler;
            _worker.DisconnectEvent         += OnDisconnectEventHandler;
        }
コード例 #5
0
        public static void ClassInitialize(TestContext testContext)
        {
            AppLogger.Initialize();
            MoqLeadRepository     = new Mock <ILeadRepository>();
            MoqERMSCustomer       = new Mock <IERMSRepository>();
            MoqcontactRepository  = new Mock <IContactRepository>();
            MoqphoneRepository    = new Mock <IPhoneRepository>();
            MoqemailRepository    = new Mock <IEmailRepository>();
            MoqaddressRepository  = new Mock <IAddressRepository>();
            MoqusageRepository    = new Mock <IUsageRepository>();
            MoqprogramRepository  = new Mock <IProgramRepository>();
            MoqcustomerRepository = new Mock <ICustomerRepository>();
            MoqcdcRepository      = new Mock <ICdcRepository>();

            MoqLogCommandHandlerDecorator = new Mock <LoggingCommandHandlerDecorator <LogCommand> >();
            MoqLogInstance = new Mock <ILog>();
            MoqLogInstance.Setup(s => s.Logger.IsEnabledFor(log4net.Core.Level.Debug)).Returns(false);
            LogCommand = new LogCommand
            {
                LoggingInstance = MoqLogInstance.Object
            };
        }