Ejemplo n.º 1
0
        public async Task Reload()
        {
            var error   = "";
            var handler = HandlersFactory.GetProfilerHandler(SettingService, LoggerService);

            handler.Start(LOG_TAG, "Reload", GetActorProperties());

            try
            {
                // Given the actor id (which is the event id), re-load the event stats
                TicketEventStats stats = await DataStoreService.GetEventStats(this.Id.GetStringId());

                var state = new EventActorState(stats);

                // Make sure the state is saved
                await SetEntityStateAsync(state);
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            finally
            {
                handler.Stop(error);
                if (!string.IsNullOrEmpty(error))
                {
                    this.HealthReporterService.SendReportForService(HealthState.Error, GetHealthErrorMessage("GetStats", error));
                }
            }
        }
Ejemplo n.º 2
0
 public Engine(
     IStrategy strategy,
     DataStoreService dataStoreService)
 {
     _dataStoreService = dataStoreService;
     _strategy         = strategy;
     Console.WriteLine(_strategy.GetType().Name);
 }
Ejemplo n.º 3
0
        public AccountServiceShould(ITestOutputHelper output)
        {
            // Helper service objects
            _ds = new DataStoreService();
            _as = new AccountService(_ds);

            // Helper objects
            _output = output;
            _output.WriteLine("Creating account service...");
        }
Ejemplo n.º 4
0
        public PaymentServiceShould(ITestOutputHelper output)
        {
            // Helper service objects
            _ds = new DataStoreService();
            _as = new AccountService(_ds);
            _ps = new PaymentService(_as);

            // Helper objects
            _req    = new MakePaymentRequest();
            _output = output;
            _output.WriteLine("Creating payment service...");
        }
Ejemplo n.º 5
0
        public override async void OnNavigatedTo(INavigationParameters parameters)
        {
            base.OnNavigatedTo(parameters);

            IsBusy = true;

            try
            {
                var port = await DataStoreService.GetPortAsync();

                TokenHandlerModel.Port = port;
            }
            catch
            {
                await NavigationService.NavigateAsync("../");

                await PageDialogService.DisplayAlertAsync("Hiba", "Hálózati hiba", "OK");
            }

            IsBusy = false;
        }
Ejemplo n.º 6
0
        private async Task ExecuteLogout()
        {
            IsBusy = true;

            try
            {
                var result = await DataStoreService.LogoutAsync();

                if (result)
                {
                    await NavigationService.NavigateAsync("../");
                }
            }
            catch (NetworkException e)
            {
                await PageDialogService.DisplayAlertAsync("Hiba", e.Message.ToString(), "OK");
            }
            catch
            {
                await PageDialogService.DisplayAlertAsync("Hiba", "Hálózati hiba", "OK");
            }

            IsBusy = false;
        }
Ejemplo n.º 7
0
 public void PerformSearchRealtime(string newTextValue)
 {
     SearchResults = DataStoreService.GetSearchResults(newTextValue);
 }
Ejemplo n.º 8
0
        public void init_servers()
        {
            string portString = Utilities.getPortFromUrl(url);
            string hostName   = Utilities.getHostNameFromUrl(url);
            int    port;

            int.TryParse(portString, out port);
            Server server = new Server
            {
                Services = { ServerCommunicationService.BindService(new ServerCommunicationLogic(this)), DataStoreService.BindService(new DataStoreServiceImpl(this)) },
                Ports    = { new ServerPort(hostName, port, ServerCredentials.Insecure) }
            };

            server.Start();
        }
Ejemplo n.º 9
0
 private async Task LoadWordsCommandExecute()
 {
     await DataStoreService.ReadWords();
 }
 public void Setup()
 {
     _dataStoreService = new DataStoreService();
 }
Ejemplo n.º 11
0
 void Handle_Clicked(object sender, System.EventArgs e)
 {
     using (var ds = new DataStoreService()){
         itemList.ItemsSource = ds.GetProducts();
     }
 }
Ejemplo n.º 12
0
 public DataStoreServiceShould()
 {
     _ds = new DataStoreService();
 }
 public ExhibitVisitedController(EventStoreService eventStore, InMemoryCache cache, DataStoreService dataStoreService, CacheDatabaseManager db) : base(eventStore, cache)
 {
     _index            = cache.Index <ExhibitsVisitedIndex>();
     _dataStoreService = dataStoreService;
     _db = db;
 }