コード例 #1
0
 public TransactionsPollingWorkerBase(ILogger <PollingWorkerBase <Transaction> > logger,
                                      AdamantApi api,
                                      IPusher pusher,
                                      ANSContext context) : base(api, context, logger)
 {
     _pusher = pusher;
 }
コード例 #2
0
 public CreateBoardItemFunction(
     IPusher pusher,
     IBoardManager boardManager)
 {
     _pusher       = pusher;
     _boardManager = boardManager;
 }
コード例 #3
0
 public JoinBoardFunction(
     IPusher pusher,
     IBoardManager boardManager)
 {
     _pusher       = pusher;
     _boardManager = boardManager;
 }
コード例 #4
0
 public GiveSyncFunction(
     IBoardManager boardManager,
     IPusher pusher)
 {
     _boardManager = boardManager;
     _pusher       = pusher;
 }
コード例 #5
0
        private void Start()
        {
            _ui = new UI.Core.UI();
            _forceCalculator = new ForceCalculator();
            _selector        = new Selector3D();
            _pusher          = new Pusher();
            _boardBuilder    = new BoardBuilder();
            _inputHandler    = new MouseInputHandler();

            _board        = _boardBuilder.Build();
            _turnSwitcher = new TurnSwitcher(_board);

            _playerAI = new PlayerAI(
                _inputHandler,
                _board
                );

            InitUIHandler();
            _inputHandler.OnDownEvent       += OnDownEventHandler;
            _inputHandler.OnUpEvent         += OnUpEventHandler;
            _turnSwitcher.MoveCompleteEvent += MoveCompleteEventHandler;
            _board.CheckersIsEmty           += CheckersIsEmtyEventHandler;

            foreach (var checker in _board.CheckersWhite.Concat(_board.CheckersBlack))
            {
                var checker1 = checker;
                checker1.SelectEvent         += () => SelectEventHandler(checker1);
                checker1.BouncingBorderEvent += () => BouncingBorderEventHandler(checker1);
            }

            _ui.SelectYourColourText();
        }
コード例 #6
0
ファイル: Trigger.cs プロジェクト: pusher/pusher-http-dotnet
 public void Setup()
 {
     PusherClient.Pusher.Trace.Listeners.Add(new ConsoleTraceListener(true));
     _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, new PusherOptions()
     {
         HostName = Config.HttpHost
     });
 }
コード例 #7
0
 public void Setup()
 {
     PusherClient.Pusher.Trace.Listeners.Add(new ConsoleTraceListener(true));
     _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, new PusherOptions()
     {
         HostName = Config.HttpHost
     });
 }
コード例 #8
0
 public ListenController(StargateDbContext dbContext,
                         StargateMemory memoryContext,
                         IPusher <WebSocket> pusher)
 {
     _dbContext     = dbContext;
     _memoryContext = memoryContext;
     _pusher        = pusher;
 }
コード例 #9
0
        static void ApplePusher_OnInvalidToken(IPusher sender, InvalidTokenEventArgs eventArgs)
        {
            var device = _context.Devices.FirstOrDefault(d => d.Token.Equals(eventArgs.Token));

            if (device != null)
            {
                _logger.Info("Removing invalid/expired token: {0}", eventArgs.Token);
                _context.Devices.Remove(device);
                _context.SaveChanges();
            }
        }
コード例 #10
0
ファイル: Get.cs プロジェクト: NearbyNow/pusher-dotnet-server
        public void Setup()
        {
            _subClient = Substitute.For<IRestClient>();
            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subClient
            };

            Config.AppId = "test-app-id";
            Config.AppKey = "test-app-key";
            Config.AppSecret = "test-app-secret";

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);
        }
コード例 #11
0
        private void InitPusher()
        {
            var options = new PusherOptions
            {
                Cluster   = AppSettings.Cluster,
                Encrypted = true
            };

            _pusher = new Pusher(
                AppSettings.AppId,
                AppSettings.AppKey,
                AppSettings.AppSecret,
                options);
        }
コード例 #12
0
        public void Setup()
        {
            _subClient = Substitute.For <IRestClient>();
            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subClient
            };

            Config.AppId     = "test-app-id";
            Config.AppKey    = "test-app-key";
            Config.AppSecret = "test-app-secret";

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);
        }
コード例 #13
0
        internal PusherClientService()
        {
            var options = new PusherOptions {
                JsonSerializer = new CustomerSerializer()
            };

            //_pusher = new Pusher(
            //    ConfigurationManager.AppSettings.Get("pusher-id"),
            //    ConfigurationManager.AppSettings.Get("pusher-key"),
            //    ConfigurationManager.AppSettings.Get("pusher-secret"),
            //    options);

            _pusher = new Pusher("75465", "0041ab94e110de594bdb", "965b8dd2bd7f6cec18cc", options);
        }
コード例 #14
0
        public void Setup()
        {
            _subClient = Substitute.For <IRestClient>();
            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subClient
            };

            Config.AppId     = "test-app-id";
            Config.AppKey    = "test-app-key";
            Config.AppSecret = "test-app-secret";

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            _subClient.Execute(Arg.Any <IRestRequest>()).Returns(V8_PROTOCOL_SUCCESSFUL_RESPONSE);
        }
コード例 #15
0
        public void trigger_calls_are_made_over_HTTP_by_default()
        {
            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subClient
            };

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            _pusher.Trigger(channelName, eventName, eventData);

            _subClient.Received().Execute(
                Arg.Is <IRestRequest>(
                    x => CheckRequestScheme("http", _subClient, x)
                    )
                );
        }
コード例 #16
0
ファイル: Trigger.cs プロジェクト: pusher/pusher-http-dotnet
        public void Setup()
        {
            _subPusherClient = Substitute.For<IPusherRestClient>();

            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subPusherClient
            };

            Config.AppId = "test-app-id";
            Config.AppKey = "test-app-key";
            Config.AppSecret = "test-app-secret";

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            _subPusherClient.ExecutePostAsync(Arg.Any<IPusherRestRequest>()).Returns(Task.FromResult(new TriggerResult(_v8ProtocolSuccessfulResponse, TriggerResultHelper.TRIGGER_RESPONSE_JSON)));
        }
コード例 #17
0
        public void Setup()
        {
            _subPusherClient = Substitute.For <IPusherRestClient>();

            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subPusherClient
            };

            Config.AppId     = "test-app-id";
            Config.AppKey    = "test-app-key";
            Config.AppSecret = "test-app-secret";

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            _subPusherClient.ExecutePostAsync(Arg.Any <IPusherRestRequest>()).Returns(Task.FromResult(new TriggerResult(_v8ProtocolSuccessfulResponse, TriggerResultHelper.TRIGGER_RESPONSE_JSON)));
        }
コード例 #18
0
        /// <summary>
        /// Удалить задачу с доски.
        /// </summary>
        /// <param name="boardController"></param>
        protected static void DelTaskFromBoard(BoardController boardController, IPusher pusher)
        {
            Console.Clear();

            if (pusher == null)
            {
                throw new ArgumentNullException("Следует передать интерфейс удаления задачи!");
            }
            try
            {
                pusher.DelTask(boardController, TryParseName("задачи"));
            }
            catch (ArgumentException ex)
            {
                Console.Error.WriteLine(ex.Message);
            }
        }
コード例 #19
0
        public void Setup()
        {
            _subPusherClient = Substitute.For <IPusherRestClient>();

            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subPusherClient
            };

            _config = new ApplicationConfig
            {
                AppId     = "test-app-id",
                AppKey    = "test-app-key",
                AppSecret = "test-app-secret",
            };

            _pusher = new Pusher(_config.AppId, _config.AppKey, _config.AppSecret, options);
        }
コード例 #20
0
        public void trigger_calls_are_made_over_port_443_when_Encrypted_option_is_set()
        {
            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subClient,
                Encrypted  = true,
                HostName   = Config.HttpHost
            };

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            _pusher.Trigger(channelName, eventName, eventData);

            _subClient.Received().Execute(
                Arg.Is <IRestRequest>(
                    x => _CheckRequestPort(443, _subClient, x)
                    )
                );
        }
コード例 #21
0
        public void trigger_calls_are_made_over_configured_Port_when_option_is_set()
        {
            int            expectedPort = 900;
            IPusherOptions options      = new PusherOptions()
            {
                RestClient = _subClient,
                Port       = expectedPort
            };

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            _pusher.Trigger(channelName, eventName, eventData);

            _subClient.Received().Execute(
                Arg.Is <IRestRequest>(
                    x => _CheckRequestPort(expectedPort, _subClient, x)
                    )
                );
        }
コード例 #22
0
        /// <summary>
        /// Консольный интерфейс добавления задач.
        /// </summary>
        /// <param name="boardController"></param>
        protected static void AddTaskToBoard(BoardController boardController, IPusher pusher)
        {
            Console.Clear();

            var nameTask = TryParseName("задачи");
            var date     = TryParseDate();
            var priority = TryParsePriority();

            if (pusher == null)
            {
                throw new ArgumentNullException("Следует передать интерфейс добавления задачи!");
            }
            try
            {
                pusher.AddTask(boardController, new Task(nameTask, date, priority));
            }
            catch (ArgumentException ex)
            {
                Console.Error.WriteLine(ex.Message);
            }
        }
コード例 #23
0
 public IPusher CreatePusher(IIndexModel model)
 {
     if (model == null)
     {
         return(null);
     }
     using (var connectionRepository = ResolverFactory.Resolve <ConnectionRepository>())
         using (var entityRepository = ResolverFactory.Resolve <EntityRepository>())
         {
             var     destinationConnection = connectionRepository.GetById(model.DestinationConnectionId.ToString());
             IPusher result = null;
             if (model.EntityType == EntityType.Attribute)
             {
                 var attrModel   = model as AttributeModel;
                 var entityModel = entityRepository.GetById(attrModel.EntityId.ToString());
                 result = pushers
                          .Where(p => typeof(IAttributePusher).IsAssignableFrom(p.GetType()))
                          .Select(p => p as IAttributePusher)
                          .FirstOrDefault(p => p.IsImplemented(model.DestinationProcessorId, entityModel.DestinationProcessorId, destinationConnection.ProviderId));
             }
             else
             {
                 result = pushers
                          .Where(p => typeof(IEntityPusher).IsAssignableFrom(p.GetType()))
                          .Select(p => p as IEntityPusher)
                          .FirstOrDefault(p => p.IsImplemented(model.DestinationProcessorId, destinationConnection.ProviderId));
             }
             var options = entityRepository.LoadOptions(model.Id.ToString(), model.EntityType)
                           .Select(o => new OptionItem
             {
                 Name  = o.Key,
                 Value = o.Value
             });
             result.SetIndex(model);
             result.SetOptions(options);
             return(result);
         }
 }
コード例 #24
0
        public void trigger_calls_are_made_over_HTTPS_when_Encrypted_option_is_set()
        {
            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subClient,
                Encrypted  = true
            };

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            ITriggerResult result =
                _pusher.Trigger(
                    channelName,
                    eventName,
                    eventData
                    );

            _subClient.Received().Execute(
                Arg.Is <IRestRequest>(
                    x => CheckRequestIsMadeOver("https://", _subClient, x)
                    )
                );
        }
コード例 #25
0
 public OrdersHistoryCommand(ICore core, IPusher pusher) : base(core, pusher)
 {
 }
コード例 #26
0
 public HomeController(TweetEventSource tweetEventSource, IPusher pusher)
 {
     _pusher = pusher;
     InitialiseAndConfigureTweetEventSource(tweetEventSource);
 }
コード例 #27
0
 public void Setup()
 {
     _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret);
 }
コード例 #28
0
        public void trigger_calls_are_made_over_port_443_when_Encrypted_option_is_set()
        {
            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subClient,
                Encrypted = true
            };

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            ITriggerResult result =
                _pusher.Trigger(
                    channelName,
                    eventName,
                    eventData
                );

            _subClient.Received().Execute(
                Arg.Is<IRestRequest>(
                    x => _CheckRequestPort(443, _subClient, x)
                )
            );
        }
コード例 #29
0
 public PusherService(IPusher pusher, IPusherProvider pusherProvider)
 {
     _pusher = pusher;
     _pusherProvider = pusherProvider;
 }
コード例 #30
0
 public DataFeedListCommand(ICore core, IPusher pusher, IDataFeedWorker dataFeedWorker) : base(core, pusher)
 {
     _dataFeedWorker = dataFeedWorker ?? throw new ArgumentNullException(nameof(dataFeedWorker));
 }
コード例 #31
0
 public GetPositionsCommand(ICore core, IPusher pusher) : base(core, pusher)
 {
 }
コード例 #32
0
 public ModifyAccountOrderCommand(ICore core, IPusher pusher) : base(core, pusher)
 {
 }
コード例 #33
0
 public HomeController()
 {
     _pusher = new WebSocketPusher();
 }
コード例 #34
0
 public RemoveUserFilesCommand(ICore core, IPusher pusher) : base(core, pusher)
 {
 }
コード例 #35
0
 public PlaceAccountOrderCommand(ICore core, IPusher pusher) : base(core, pusher)
 {
 }
コード例 #36
0
 public GetAvailableSymbolsCommand(ICore core, IPusher pusher, IDataFeedWorker dataFeedWorker) : base(core, pusher)
 {
     _dataFeedWorker = dataFeedWorker ?? throw new ArgumentNullException(nameof(dataFeedWorker));
 }
コード例 #37
0
        public void trigger_calls_are_made_over_configured_Port_when_option_is_set()
        {
            int expectedPort = 900;
            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subClient,
                Port = expectedPort
            };

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            ITriggerResult result =
                _pusher.Trigger(
                    channelName,
                    eventName,
                    eventData
                );

            _subClient.Received().Execute(
                Arg.Is<IRestRequest>(
                    x => _CheckRequestPort(expectedPort, _subClient, x)
                )
            );
        }
コード例 #38
0
        public void trigger_calls_are_made_over_HTTP_by_default()
        {
            IPusherOptions options = new PusherOptions()
            {
                RestClient = _subClient
            };

            _pusher = new Pusher(Config.AppId, Config.AppKey, Config.AppSecret, options);

            ITriggerResult result =
                _pusher.Trigger(
                    channelName,
                    eventName,
                    eventData
                );

            _subClient.Received().Execute(
                Arg.Is<IRestRequest>(
                    x => CheckRequestIsMadeOver("http://", _subClient, x)
                )
            );
        }
コード例 #39
0
 public PortfolioActionCommand(ICore core, IPusher pusher) : base(core, pusher)
 {
 }
コード例 #40
0
		public static void Init(IPusher pusher)
		{
			Pusher = pusher;
		}