예제 #1
0
 public LineHandler(IWebhookDispatch webhookDispatch, ArcConfig config, IArcLog arcLog, IAlarmLog alarmLog)
 {
     this.webhookDispatch = webhookDispatch;
     this.config          = config;
     this.arcLog          = arcLog;
     this.alarmLog        = alarmLog;
 }
예제 #2
0
 public ArcServer(ILineHandlerFactory lineHandlerFactory, IPEndPoint endpoint, Socket socket, ArcConfig config, IArcLog arcLog)
 {
     this.lineHandlerFactory = lineHandlerFactory;
     this.endpoint           = endpoint;
     this.socket             = socket;
     this.config             = config;
     this.arcLog             = arcLog;
     lineHandlers            = new List <ILineHandler>();
 }
예제 #3
0
 public GenericWebhookDispatch(ArcConfig config, IAccountsHandler accountsHandler, IArcLog arcLog)
 {
     if (config.WebhookEnabled)
     {
         configured = true;
         restClient = new RestClient(config.WebhookUrl);
     }
     this.accountsHandler = accountsHandler;
     this.arcLog          = arcLog;
 }
예제 #4
0
파일: Autofac.cs 프로젝트: sugar-pickle/Arc
        public static IContainer BuildContainer(ArcConfig config)
        {
            var builder = new ContainerBuilder();

            builder.RegisterInstance(new IPEndPoint(IPAddress.Any, (int)config.ListenPort));
            builder.RegisterInstance(new Socket(IPAddress.Any.AddressFamily, SocketType.Stream, ProtocolType.Tcp));
            builder.RegisterInstance(config);

            builder.RegisterType <LineHandler>()
            .As <ILineHandler>()
            .InstancePerDependency();

            builder.RegisterType <LineHandlerFactory>()
            .As <ILineHandlerFactory>()
            .SingleInstance();

            builder.RegisterType <ArcLog>()
            .As <IArcLog>()
            .SingleInstance();

            builder.RegisterType <ArcServer>()
            .As <IArcServer>()
            .SingleInstance();

            builder.RegisterType <AccountsHandler>()
            .As <IAccountsHandler>()
            .SingleInstance();

            builder.RegisterType <GenericWebhookDispatch>()
            .As <IWebhookDispatch>()
            .SingleInstance();

            builder.RegisterType <ArcConsole>()
            .As <IArcConsole>()
            .SingleInstance();

            builder.RegisterType <AlarmLog>()
            .As <IAlarmLog>()
            .SingleInstance();

            return(builder.Build());
        }
예제 #5
0
 public AccountsHandler(ArcConfig config, IArcLog arcLog)
 {
     this.config = config;
     this.arcLog = arcLog;
     LoadAccounts();
 }