示例#1
0
 public QueryCommand(IBackendService backendService, IMinetokenService minetokenService, IUserService userService, IMatatakiService matatakiService)
 {
     _backendService   = backendService;
     _minetokenService = minetokenService;
     _userService      = userService;
     _matatakiService  = matatakiService;
 }
 internal static void SetBackendService(this EndpointsConfig self, IBackendService backendService)
 {
     foreach (var(_, endpointUrl)  in self)
     {
         endpointUrl.SetBackendService(backendService);
     }
 }
示例#3
0
        public BackendContext(ContextType backendType, BackendConnection connectionData)
        {
            _backendType       = backendType;
            _backendConnection = connectionData;
            _statusManager     = AppContext.Resolve <IStatusManager>();
            _runbookNameCache  = new List <string>();

            if (backendType == ContextType.SMA)
            {
                // SMA
                _backendService = new SmaService(this, connectionData);
            }
            else if (backendType == ContextType.AzureRM)
            {
                _backendService = new AzureRMService(this, connectionData);
            }
            else
            {
                // Azure
                _backendService = new AzureService(this, connectionData);
            }

            Runbooks    = new ObservableCollection <ResourceContainer>();
            Credentials = new ObservableCollection <ResourceContainer>();
            Schedules   = new ObservableCollection <ResourceContainer>();
            Variables   = new ObservableCollection <ResourceContainer>();
            Tags        = new ObservableCollection <ResourceContainer>();
            Modules     = new ObservableCollection <ResourceContainer>();
            Connections = new ObservableCollection <ResourceContainer>();

            IsReady = false;
        }
示例#4
0
 public CardBookViewModel(Book book,
                          IBackendService backendService)
 {
     Book = book;
     CheckAsReadCommand  = CreateCommandAsync(CheckAsReadAsync);
     this.backendService = backendService;
 }
 public ChartManager(IBackendService backendService, IFrontendService frontendService, IDatabaseService databaseService, IDevopsService devopsService)
 {
     _backendService  = backendService;
     _frontendService = frontendService;
     _databaseService = databaseService;
     _devopsService   = devopsService;
 }
示例#6
0
        public MatatakiService(HttpClient httpClient, HttpClient transferHttpClient, IBackendService backendService, AppConfiguration appConfiguration)
        {
            _httpClient         = httpClient;
            _transferHttpClient = transferHttpClient;
            _backendService     = backendService;

            _urlPrefix = appConfiguration.Matataki.UrlPrefix ?? throw new InvalidOperationException("Missing Matataki.UrlPrefix in app settings");
        }
示例#7
0
 public HomeController(IBackendService backendService, IPageService pageService, ICityService cityService, INewsService newsService, ITicketsService ticketsService)
 {
     BackendService = backendService;
     PageService    = pageService;
     CityService    = cityService;
     NewsService    = newsService;
     TicketsService = ticketsService;
 }
示例#8
0
 public AddNewHotspotViewModel(IBackendService backendService, IDeviceInfo deviceInfo)
 {
     OkCommand      = new MvxAsyncCommand(Ok);
     CancelCommand  = new MvxCommand(Cancel);
     BackendService = backendService;
     DeviceInfo     = deviceInfo;
     InitModel();
     SetEndOfLabels();
 }
示例#9
0
        public ExecutionResultViewModel(RunbookViewModel runbookViewModel, Guid jobId, bool isTestRun)
            : this(isTestRun)
        {
            _runbookViewModel = runbookViewModel;
            _jobId            = jobId;

            _backendService = (_runbookViewModel.Model as RunbookModelProxy).Context.Service;

            SubscribeToJob();
        }
示例#10
0
 public HongbaoCommand(ITelegramBotClient botClient,
                       ILogger logger,
                       IBackendService backendService,
                       IGroupService groupService)
 {
     _botClient      = botClient;
     _logger         = logger;
     _backendService = backendService;
     _groupService   = groupService;
 }
示例#11
0
        public BackendService()
        {
            _customHttpClientHandler = new EtagHttpClientHandler();
            _customHttpClient        = new HttpClient(_customHttpClientHandler)
            {
                BaseAddress = new Uri(ApiBaseUrl)
            };

            _restService = RestService.For <IBackendService>(_customHttpClient);
        }
示例#12
0
 public WifiHotspotsViewModel(IBackendService backendService, IUnitOfWork unitOfWork, INavigationService navigationService)
 {
     BackendService              = backendService;
     UnitOfWork                  = unitOfWork;
     NavigationService           = navigationService;
     LoadWifiHotspotsCommand     = new MvxAsyncCommand(LoadWifiHotspots);
     LoadMoreWifiHotspotsCommand = new MvxAsyncCommand(LoadMoreWifiHotspots);
     LoadMapCommand              = new MvxCommand(LoadMap);
     LoadWifiHotspotsButtonText  = "Charger la liste des points Wifi";
     FilterPlaceholder           = "Filtre par code postal";
     LoadMapButtonText           = "Charger la carte";
 }
示例#13
0
 public BackendServiceTests()
 {
     _logger = Substitute.For <ILogger <BackendService> >();
     _config = Substitute.For <IOptions <BackendServerConfig> >();
     _config.Value.Returns(new BackendServerConfig
     {
         BaseUrl         = "http://localhost",
         UsersController = "api/users"
     });
     _httpClientFactory      = Substitute.For <IHttpClientFactory>();
     _mockHttpMessageHandler = new MockHttpMessageHandler();
     _httpClientFactory.CreateClient().Returns(new HttpClient(_mockHttpMessageHandler));
     _service = new BackendService(_logger, _config, _httpClientFactory);
 }
示例#14
0
        //  -----------------------------
        //  Actual Class variables
        //  -----------------------------


        //  -----------
        //  CONSTRUCTOR
        //  -----------
        public VM_Main()
        {
            // Initialization
            UInotification           = "";
            LoadingScreen_Visibility = Visibility.Visible;

            // Inject Services
            //InitializeServiceInjections(new BackendService());
            myBackendService = new BackendService();

            allCustomers             = new ObservableCollection <Customer>();
            allcustomers_placeholder = new List <Customer>();
            allProjects             = new ObservableCollection <Project>();
            allprojects_placeholder = new List <Project>();

            availProjects    = new ObservableCollection <Project>();
            availTaskEntries = new ObservableCollection <TaskEntry>();

            //selCustomer = new Customer();
            //selProject = new Project();
            //selTaskEntry = new TaskEntry();

            //selCustomerID = -1;
            //selProjectID = -1;
            //selTaskEntryID = -1;

            db_shownCustomers           = new ObservableCollection <Customer>();
            db_shownProjects            = new ObservableCollection <Project>();
            db_shownTaskEntries         = new ObservableCollection <TaskEntry>();
            db_shownTimeEntries         = new ObservableCollection <TimeEntry>();
            customer_addedit_Visibility = Visibility.Visible;
            customer_edit_IsEnabled     = false;
            customer_edit_Visibility    = Visibility.Visible;

            // Initializations
            InitializeData();

            // Load commands
            LoadCommands();

            // Initialize process
            Logger.SetPath(Environment.GetEnvironmentVariable("TEMP"));
            Logger.Initialize();

            // Search Background Worker event handler initialization
        }
示例#15
0
        void Initialize(
            [Inject] IBackendService backendService
            )
        {
            _backendService = backendService;

            this.OnEvent <LoginCommand>().Subscribe(e => LoginCommandHandler(e)).AddTo(this);
            this.OnEvent <LogoutCommand>().Subscribe(e => LogoutCommandHandler(e)).AddTo(this);
            this.OnEvent <RegisterNewUser>().Subscribe(e => RegisterNewUserHandler(e)).AddTo(this);
            this.OnEvent <GetUserDataCommand>().Subscribe(e => GetUserDataCommandHandler(e)).AddTo(this);
            this.OnEvent <UpdateUserDataCommand>().Subscribe(e => UpdateUserDataCommandHandler(e)).AddTo(this);
            this.OnEvent <GetGameDataCommand>().Subscribe(e => GetGameDataCommandHandler(e)).AddTo(this);
            this.OnEvent <GetDownloadUrlCommand>().Subscribe(e => GetDownloadUrlCommandHandler(e)).AddTo(this);
            this.OnEvent <RequestMatchCommand>().Subscribe(e => RequestMatchCommandHandler(e)).AddTo(this);
            this.OnEvent <RedeemMatchCommand>().Subscribe(e => RedeemMatchCommandHandler(e)).AddTo(this);
            this.OnEvent <PlayerLeftMatchCommand>().Subscribe(e => PlayerLeftMatchCommandHandler(e)).AddTo(this);
            this.OnEvent <GetItemCatalogCommand>().Subscribe(e => GetItemCatalogCommandHandler(e)).AddTo(this);
        }
        public SpeakSessionRepository(IBackendService backendService)
        {
            var db = new LiteDatabase(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "MVPConf.db"));

            collection = db.GetCollection <SpeakSession>();
            collection.EnsureIndex(s => s.Id);
            collection.EnsureIndex(s => s.RoomId);
            rooms = db.GetCollection <Room>();
            rooms.EnsureIndex(s => s.Id);

            var mapper = BsonMapper.Global;

            mapper.Entity <SpeakSession>()
            .Id(x => x.Id);
            mapper.Entity <Room>()
            .Id(x => x.Id);
            this.backendService = backendService;
        }
        public AttendeeRepository(IBackendService backendService)
        {
            var db = new LiteDatabase(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "MVPConf.db"));

            collection = db.GetCollection <Attendee>();

            collection.EnsureIndex(x => x.Id);

            sessionAttendees = db.GetCollection <SessionAttendee>();

            sessionAttendees.EnsureIndex(s => s.AttendeeId);

            var mapper = BsonMapper.Global;

            mapper.Entity <Attendee>()
            .Id(x => x.Id);
            mapper.Entity <SessionAttendee>()
            .Id(x => x.Id, true);

            this.backendService = backendService;
        }
示例#18
0
 public StatusCommand(IBackendService backendService, IMatatakiService matatakiService)
 {
     _backendService  = backendService;
     _matatakiService = matatakiService;
 }
示例#19
0
 public TransferCommand(IBackendService backendService, IMatatakiService matatakiService, IUserService userService)
 {
     _backendService  = backendService;
     _matatakiService = matatakiService;
     _userService     = userService;
 }
示例#20
0
 public GrabHongbaoAction(IHongbaoService hongbaoService, IBackendService backendService)
 {
     _hongbaoService = hongbaoService;
     _backendService = backendService;
 }
        public AppShellViewModel(IBackendService backendService)
        {
            _backendService = backendService;

            LoadRounds();
        }
示例#22
0
 public HongbaoService(HttpClient httpClient, IBackendService backendService)
 {
     _httpClient     = httpClient;
     _backendService = backendService;
 }
示例#23
0
 public HotspotsWifiActivity()
 {
     BackendService = AppContainer.Container.Resolve <IBackendService> ();
     UnitOfWork     = AppContainer.Container.Resolve <IUnitOfWork> ();
 }
示例#24
0
 public NewsController(IBackendService backendService, INewsService newsService)
 {
     BackendService = backendService;
     NewsService    = newsService;
 }
 public WifiHotspotsViewController(IntPtr handle) : base(handle)
 {
     _backendService = AppContainer.Container.Resolve <IBackendService> ();
     _unitOfWork     = AppContainer.Container.Resolve <IUnitOfWork> ();
     _wifiHotspots   = new List <WifiHotspot> ();
 }
示例#26
0
 public TwilioServiceTest()
 {
     _service = new TwilioService();
 }
示例#27
0
 public static TResponse Send <TResponse>(this IBackendService backend, Request request) where TResponse : Response
 {
     return((TResponse)backend.Send(request));
 }
 public BackendController(IBackendService backendService, ILogger <BackendController> logger)
 {
     _backendService = backendService;
     _logger         = logger;
 }
示例#29
0
 public static TValue SendSingleValue <TValue>(this IBackendService backend, Request request)
 {
     return(((SingleValueResponse <TValue>)backend.Send(request)).Value);
 }
示例#30
0
 public AccountController(IBackendService backendService, IPageService pageService, IUserService userService)
 {
     BackendService = backendService;
     PageService    = pageService;
     UserService    = userService;
 }