public EmailMainViewModel(IExchangeService exchangeService)
 {
     this.exchangeService = exchangeService;
     this.inbox = new ObservableCollection<EmailMessage>();
     this.inbox.AddRange(this.exchangeService.GetInbox());
     this.SelectedEmail = new ObservableObject<EmailMessage>();
 }
コード例 #2
0
        public double Sell(Currencies currency, double amount)
        {         

            try
            {
                if (!UseAsmx)
                {
                    // Call the WCF service
                    currencyProx = currencyChf.CreateChannel();
                    return currencyProx.Sell(currency, amount);
                }
                else
                {
                    // Call the WCF service
                    currencyAsmxProx = currencyAsmxChf.CreateChannel();
                    return currencyAsmxProx.Sell(currency, amount);
                }
            }
            catch (Exception ex)
            {
                LoggingManager.Logger.Log(LoggingCategory.Error, StringsResource.FailedToContactCurrencyExchange + " " + ex.Message);
                throw new FaultException<CurrencyExchangeException>
                    (new CurrencyExchangeException(StringsResource.FailedToContactCurrencyExchange + " " + ex.Message, ex));
            }
            finally
            {
                var channel = currencyProx as ICommunicationObject;
                if ((channel != null) && (channel.State == CommunicationState.Opened))
                    channel.Close();

                channel = currencyAsmxProx as ICommunicationObject;
                if ((channel != null) && (channel.State == CommunicationState.Opened))
                    channel.Close();
            }
        }
 public NewEmailUseCase(
     IViewToRegionBinder viewtoToRegionBinder,
     ObjectFactory<NewEmailViewModel> newEmailViewFactory,
     ObjectFactory< NewEmailToolBarViewModel> newEmailToolBarFactory,
     IExchangeService exchangeService, 
     IRegionManager regionManager) : base (viewtoToRegionBinder)
 {
     this.AddInitializationMethods(
         () => this.newEmailViewModel = newEmailViewFactory.CreateInstance()
         , () => this.newEmailToolBarViewModel = newEmailToolBarFactory.CreateInstance());
     
     this.exchangeService = exchangeService;
     this.RegionManager = regionManager;
 }
コード例 #4
0
 public CalculatorApp(IExchangeService exchangeService, IUserInteraction userInteraction)
 {
     _exchangeService = exchangeService;
     _userInteraction = userInteraction;
 }
コード例 #5
0
 public Exchangeservice_IsExchangeShould()
 {
     _exchangeService = new TCMBExchangeService();
 }
コード例 #6
0
 public ExchangeController(IExchangeService exchangeService)
 {
     _exchangeService = exchangeService;
 }
 public ExchangeRateCommandHandler(IExchangeCurrencyHttpQuery exchangeRateQuery, IExchangeService exchangeRateService)
 {
     _exchangeRateQuery   = exchangeRateQuery;
     _exchangeRateService = exchangeRateService;
 }
コード例 #8
0
        public async virtual Task AddExchangeService(IEnumerable <StrategySubscription> strategySubscriptions, Exchange exchange, IExchangeService exchangeService)
        {
            if (exchangeServices.ContainsKey(exchange))
            {
                return;
            }

            exchangeServices.Add(exchange, exchangeService);

            var symbols = await exchangeService.GetSymbolsAsync(exchange, cancellationToken);

            var subscribedSymbols = (from s in symbols
                                     join ss in strategySubscriptions on s.ExchangeSymbol equals ss.Symbol
                                     select s).ToList();

            exchangeSymbols.Add(exchange, subscribedSymbols);
        }
コード例 #9
0
 public void Setup()
 {
     _repositoryMock  = Substitute.For <IRepository>();
     _exchangeService = new ExchangeService(_repositoryMock);
 }
コード例 #10
0
 public ConsoleAction(IStockService stockService, IExchangeService exchangeService)
 {
     this.stockService    = stockService;
     this.exchangeService = exchangeService;
 }
コード例 #11
0
 public DemoTerminalAppController(ILoggerFactory loggerFactory,
                                  IExchangeService exchangeService)
 {
     _logger          = loggerFactory.CreateLogger(nameof(DemoTerminalAppController));
     _exchangeService = exchangeService;
 }
コード例 #12
0
 public MemberController(IMemberService memberService, ILoginCodeService loginCodeService, IExchangeService exchangeService, IRechargeRecordService rechargeRecordService,
                         ICooperationService cooperationService, IRefundService refundService, ICosFileStatService cosFileStatService)
 {
     _memberService         = memberService;
     _loginCodeService      = loginCodeService;
     _exchangeService       = exchangeService;
     _rechargeRecordService = rechargeRecordService;
     _cooperationService    = cooperationService;
     _refundService         = refundService;
     _cosFileStatService    = cosFileStatService;
 }
コード例 #13
0
 protected abstract Task ExecuteOnExchangeAsync(IExchangeService exchangeService, Instrument instrument);
コード例 #14
0
 public ExchangeController(IExchangeService exchangeService, ILogger <ExchangeController> logger)
 {
     _exchangeService = exchangeService;
     _logger          = logger;
 }
コード例 #15
0
 public OrderService(IExchangeService exchange)
 {
     _exchange = ValidateExchangeService(exchange);
 }
コード例 #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MeetingHelper"/> class.
 /// </summary>
 /// <param name="meetingProvider">Provider for post and get API calls to Graph.</param>
 /// <param name="userConfigurationProvider">Provider for getting user specific configuration.</param>
 /// <param name="roomCollectionStorageProvider">Storage provider to perform fetch operation on RoomCollection table.</param>
 /// <param name="memoryCache">Memory cache to store rooms.</param>
 public MeetingHelper(IMeetingProvider meetingProvider, IMemoryCache memoryCache, IExchangeService exchangeService)
 {
     this.meetingProvider = meetingProvider;
     this.memoryCache     = memoryCache;
     this.exchangeService = exchangeService;
 }
コード例 #17
0
 public CurrencyController(IExchangeService service)
 {
     _service = service;
 }
コード例 #18
0
 public ExchangeSubscriptionsCacheFactory(IExchangeService exchangeService)
 {
     this.exchangeService       = exchangeService;
     exchangeSubscriptionsCache = new ConcurrentDictionary <Exchange, IExchangeSubscriptionsCache>();
 }
コード例 #19
0
ファイル: SignalsJob.cs プロジェクト: lulzzz/bognabot
 protected override async Task ExecuteOnExchangeAsync(IExchangeService exchangeService, Instrument instrument)
 {
     await _traderService.ProcessSignals(exchangeService, instrument);
 }
コード例 #20
0
 public ControllerExchange()
 {
     exchangeService = new ExchangeTest();
 }
コード例 #21
0
        public static ExchangeResponseDTO MapExchangeDetailsToDto(Exchangesusers exchangeDetails, IExchangeService exchangeService)
        {
            _exchangeService = exchangeService;
            string count  = string.Empty;
            var    result = new ExchangeResponseDTO
            {
                ID          = exchangeDetails.EuId,
                DateEnabled = exchangeDetails.ExchangeuCrDt,
            };

            result.ExchangeName = _exchangeService.GetExchangeTypeById(exchangeDetails.ExchangeuId);
            result.APIsEntered  = _exchangeService.GetApiEnteredCount(exchangeDetails.EuId);

            return(result);
        }
コード例 #22
0
 public ExchangeRateController(IExchangeService service)
 {
     _service = service;
 }
コード例 #23
0
        public void TestHoardGames()
        {
            hoardFixture.InitializeFromConfig();
            HoardService = hoardFixture.HoardService;

            //ulong amount = (ulong)HoardService.GetHRDAmount(HoardService.DefaultPlayer);

            if (HoardService.DefaultGame != GameID.kInvalidID)
            {
                ErrorCallbackProvider.ReportInfo("\tName: " + HoardService.DefaultGame.Name);
                ErrorCallbackProvider.ReportInfo("\tBackend Url: " + HoardService.DefaultGame.Url);
                ErrorCallbackProvider.ReportInfo("\tGameID: " + HoardService.DefaultGame.ID);
            }

            ErrorCallbackProvider.ReportInfo("Getting Hoard games...");

            GameID[] games = HoardService.GetAllHoardGames().Result;

            ErrorCallbackProvider.ReportInfo(string.Format("Found {0} Hoard games.", games.Length));

            foreach (GameID game in games)
            {
                //Register hoard provider for this gam
                ErrorCallbackProvider.ReportInfo(string.Format("Registering Hoard game {0}", game.Name));
                HoardService.RegisterHoardGame(game);

                ErrorCallbackProvider.ReportInfo(string.Format("Getting player items for game {0}", game.Name));
                GameItem[] items = HoardService.GetPlayerItems(hoardFixture.UserIDs[0], game).Result;

                ErrorCallbackProvider.ReportInfo(string.Format("Found {0} items.", items.Length));
                foreach (GameItem gi in items)
                {
                    //assume we need to populate properties
                    //TODO: if properties is not null we would need to compare state with some cached data and if there is mismatch update too
                    ErrorCallbackProvider.ReportInfo(string.Format("Getting properties for item {0}:{1}...", gi.Symbol, gi.State));
                    if (gi.Properties == null)
                    {
                        HoardService.FetchItemProperties(gi);
                    }
                    //TODO: enumerate properties...
                }
            }

            // Check exchange
            IExchangeService exchange = HoardService.ExchangeService;

            if (exchange != null)
            {
                var orders = exchange.ListOrders(null, null, null).Result;
                ErrorCallbackProvider.ReportInfo(string.Format("Found {0} exchange orders.", orders.Length));
                foreach (Order order in orders)
                {
                    ErrorCallbackProvider.ReportInfo(string.Format("Order: Buy {0} {1} for {2} {3}.",
                                                                   order.amountGive,
                                                                   order.gameItemGive.Symbol,
                                                                   order.amountGet,
                                                                   order.gameItemGet.Symbol
                                                                   ));
                }
                // test trade:

                /*if (orders.Length > 1)
                 * {
                 *  Order order = orders[0];
                 *  bool result = exchange.Deposit(order.gameItemGet, order.amountGet).Result;
                 *  result = exchange.Trade(order, order.amountGet).Result;
                 *  result = exchange.Withdraw(order.gameItemGive, order.amountGive).Result;
                 * }*/
            }

            ErrorCallbackProvider.ReportInfo("Shutting down HOARD...");

            HoardService.Shutdown();
        }
コード例 #24
0
 public ExchangeController(IOptions <AppSettings> settings,
                           IExchangeService exchangeService)
 {
     _settings        = settings.Value;
     _exchangeService = exchangeService;
 }
コード例 #25
0
 public Worker(ILogger <Worker> logger, IHubContext <ExchangeHub, IExchangeHub> exchangeHub, IExchangeService exchangeService)
 {
     _logger          = logger;
     _exchangeHub     = exchangeHub;
     _exchangeService = exchangeService;
     _relativeStrengthIndexIndicator = new RelativeStrengthIndex(exchangeService);
 }
コード例 #26
0
 public ExchangeController()
 {
     _exchangeService = new ExchangeService();
 }
コード例 #27
0
        public async virtual Task AddExchangeService(IEnumerable <StrategySubscription> strategySubscriptions, Exchange exchange, IExchangeService exchangeService)
        {
            if (exchangeService == null)
            {
                throw new ArgumentNullException(nameof(exchangeService));
            }

            if (ExchangeServices.ContainsKey(exchange))
            {
                return;
            }

            ExchangeServices.Add(exchange, exchangeService);

            var symbols = await exchangeService.GetSymbolsAsync(exchange, CancellationToken).ConfigureAwait(false);

            var subscribedSymbols = (from s in symbols
                                     join ss in strategySubscriptions on s.ExchangeSymbol equals ss.Symbol
                                     select s).ToList();

            ExchangeSymbols.Add(exchange, subscribedSymbols);
        }
コード例 #28
0
 public TickersMonitorTimedTask(ILoggingService loggingService, IExchangeService exchangeService)
 {
     this.loggingService  = loggingService;
     this.exchangeService = exchangeService;
 }
コード例 #29
0
 public CurrencyConverterTests()
 {
     _fakeApi = new ExchangeApiFake();
     _service = new ExchangeService(_fakeApi);
 }
コード例 #30
0
 public ApiContoller(IExchangeService service)
 {
     _service = service;
 }
コード例 #31
0
 public CurrencyController(IExchangeService exchangeService)
 {
     _exchangeService = exchangeService;
 }
コード例 #32
0
 public WpfExchangeService(IExchangeService exchangeService)
 {
     this.exchangeService = exchangeService;
 }
コード例 #33
0
 public CalculatorApp()
 {
     _exchangeService = new DefaultExchangeService();
     _userInteraction = new UserInteraction();
 }