Exemplo n.º 1
0
 public FamilyService(
     IRequestProvider requestProvider,
     IIdentityUtilService identityUtilService)
 {
     _requestProvider     = requestProvider;
     _identityUtilService = identityUtilService;
 }
        public CountriesControllerTests()
        {
            var server = new TestServer(new WebHostBuilder()
                                        .UseStartup <StubStartup>());

            _requestProvider = new RequestProvider(server.CreateClient());
        }
Exemplo n.º 3
0
 public SchedulingService(
     IRequestProvider requestProvider,
     IIdentityUtilService identityUtilService)
 {
     _requestProvider     = requestProvider;
     _identityUtilService = identityUtilService;
 }
Exemplo n.º 4
0
 public GerritRepoReader(IRequestProvider repoReader)
 {
     _repoReader     = repoReader;
     _jsonSerializer = new JsonSerializer {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     };
 }
Exemplo n.º 5
0
 public AuthenticationService(
     IRequestProvider request,
     ISettingsService settingsService)
 {
     _request         = request;
     _settingsService = settingsService;
 }
        public void Process(IRequestProvider provider)
        {
            var request = provider.Take();

            var httpRequest = request.HttpRequest;
            var httpResponse = request.HttpResponse;

            Console.WriteLine("Request:" + httpRequest.RawUrl);
            
            // todo:pre filters?
            if (!httpResponse.Completed()) 
            {
                // maybe filter has finished or client has disconnected
                var serializer = LookupSerializer(httpRequest);
                var requestDto = ReadRequestDto(httpRequest, serializer);
                var responseDto = GenerateResponseDto(httpRequest, httpResponse, requestDto);

                // maybe response has already been written to and closed, in which case we don't need to do anything
                if (!httpResponse.Completed())
                {
                    WriteResponseDto(httpResponse, serializer, responseDto);
                }

                // todo:post filters?
            }
        }
Exemplo n.º 7
0
        public HyperPipe(int poolSize,
                         IRequestProvider <T> requestProvider,
                         IResponseConsumer <T> responseConsumer)
        {
            _requestProvider  = requestProvider;
            _responseConsumer = responseConsumer;

            _easyPool    = new EasyPool <T>(poolSize);
            _multiHandle = CurlNative.Multi.Init();
            if (_multiHandle.IsInvalid)
            {
                throw new Exception("Could not init curl_multi handle.");
            }

            _socketMap = new SocketPollMap();
            _loop      = new Loop();
            _timeout   = _loop.CreateTimer();

            // Explicitly define callback functions to keep them from being GCed.
            _socketCallback = HandleSocket;
            _timerCallback  = StartTimeout;

            Logger.LogDebug($"Set {CURLMoption.SOCKETFUNCTION}.");
            CurlNative.Multi.SetOpt(_multiHandle, CURLMoption.SOCKETFUNCTION, _socketCallback);
            Logger.LogDebug($"Set {CURLMoption.TIMERFUNCTION}.");
            CurlNative.Multi.SetOpt(_multiHandle, CURLMoption.TIMERFUNCTION, _timerCallback);
        }
Exemplo n.º 8
0
 public StocksService(
     IRequestProvider requestProvider,
     ISettingsService settingsService)
 {
     _requestProvider = requestProvider ?? throw new ArgumentNullException(nameof(requestProvider));
     _settingsService = settingsService ?? throw new ArgumentNullException(nameof(settingsService));
 }
Exemplo n.º 9
0
 public CatalogDataService(
     IRequestProvider request,
     IBaseCacheStrategy cache)
 {
     _request = request;
     _cache   = cache;
 }
Exemplo n.º 10
0
 public PluginsController(IModelMapper modelMapper, IPluginAccountant pluginAccountant, IDataSerializer dataSerializer, PluginSettings pluginSettings, IRequestProvider requestProvider)
 {
     _modelMapper      = modelMapper;
     _pluginAccountant = pluginAccountant;
     _dataSerializer   = dataSerializer;
     _pluginSettings   = pluginSettings;
     _requestProvider  = requestProvider;
 }
Exemplo n.º 11
0
 public UpdatesComponent(IRequestProvider requestProvider, SystemSettings systemSettings, ISettingService settingService, GeneralSettings generalSettings, IDataSerializer dataSerializer)
 {
     _requestProvider = requestProvider;
     _systemSettings  = systemSettings;
     _settingService  = settingService;
     _generalSettings = generalSettings;
     _dataSerializer  = dataSerializer;
 }
Exemplo n.º 12
0
 public GenreService(
     IRequestProvider requestProvider,
     ISettingsService settingsService
     )
 {
     _requestProvider = requestProvider;
     _settingsService = settingsService;
 }
Exemplo n.º 13
0
 public ShoppingCartService(
     IRequestProvider requestProvider,
     ICustomerService customerService,
     INavigationService navigationService)
 {
     _requestProvider   = requestProvider;
     _customerService   = customerService;
     _navigationService = navigationService;
 }
Exemplo n.º 14
0
 public TeamMemberService(
     IRequestProvider requestProvider,
     IIdentityUtilService identityUtilService,
     ITeamMemberFactory teamMemberFactory)
 {
     _requestProvider     = requestProvider;
     _identityUtilService = identityUtilService;
     _teamMemberFactory   = teamMemberFactory;
 }
Exemplo n.º 15
0
 /// <summary>
 ///     ctor().
 /// </summary>
 public IdentityService(
     IRequestProvider requestProvider,
     INavigationService navigationService,
     IAnnouncementSignalService announcementHubService)
 {
     _requestProvider        = requestProvider;
     _navigationService      = navigationService;
     _announcementHubService = announcementHubService;
 }
Exemplo n.º 16
0
 /// <summary>
 ///     ctor().
 /// </summary>
 public SearchService(
     IRequestProvider requestProvider,
     IFoundUserGroupDataItemFactory foundUserGroupDataItemFactory,
     IIdentityUtilService identityUtilService)
 {
     _requestProvider = requestProvider;
     _foundUserGroupDataItemFactory = foundUserGroupDataItemFactory;
     _identityUtilService           = identityUtilService;
 }
 public PushNotificationService(
     INavigationService navigationService,
     IRequestProvider requestProvider,
     ITripsService tripsService)
 {
     _navigationService = navigationService;
     _requestProvider   = requestProvider;
     _tripsService      = tripsService;
 }
Exemplo n.º 18
0
 /// <summary>
 ///     ctor().
 /// </summary>
 public FriendService(
     IRequestProvider requestProvider,
     IProfileService profileService,
     IIdentityUtilService identityUtilService)
 {
     _requestProvider     = requestProvider;
     _profileService      = profileService;
     _identityUtilService = identityUtilService;
 }
Exemplo n.º 19
0
 /// <summary>
 ///     ctor().
 /// </summary>
 public ProfileMediaService(
     IRequestProvider requestProvider,
     IIdentityUtilService identityUtilService,
     IMediaFactory mediaFactory)
 {
     _requestProvider     = requestProvider;
     _identityUtilService = identityUtilService;
     _mediaFactory        = mediaFactory;
 }
        public FinishSignUpViewModel(INavigationService navigationService,
                                     IRequestProvider requestProvider,
                                     IAuthenticationService authenticationService, IPlatformService platformService) : base(navigationService)
        {
            this.requestProvider       = requestProvider;
            this.authenticationService = authenticationService;
            this.platformService       = platformService;

            GoToInboxCommand = new Command(GoToInboxCommandExecute);
        }
Exemplo n.º 21
0
 public WatchedFile(ILog log, IEntityProvider entityLocator, IFile file, IRequestProvider requestProvider, IEnvironmentUtility environmentUtility, IDirectory directory)
 {
     // TODO: Dependency injection feels like it is bloating the constructor. Might be time to re-address the responsibility of this classes methods.
     _log                = log;
     _entityLocator      = entityLocator;
     _file               = file;
     _requestProvider    = requestProvider;
     _environmentUtility = environmentUtility;
     _directory          = directory;
 }
Exemplo n.º 22
0
 public WatchedFile(ILog log, IEntityProvider entityLocator, IFile file, IRequestProvider requestProvider, IEnvironmentUtility environmentUtility, IDirectory directory)
 {
     // TODO: Dependency injection feels like it is bloating the constructor. Might be time to re-address the responsibility of this classes methods.
     _log = log;
     _entityLocator = entityLocator;
     _file = file;
     _requestProvider = requestProvider;
     _environmentUtility = environmentUtility;
     _directory = directory;
 }
Exemplo n.º 23
0
 public MovieService(
     IRequestProvider requestProvider,
     ISettingsService settingService,
     IGenreService genreService
     )
 {
     _requestProvider = requestProvider;
     _settingsService = settingService;
     _genreService    = genreService;
     _genresCache     = new Lazy <Task <IEnumerable <Genre> > >(async() => await _genreService.GetGenresAsync());
 }
 public ArticlePageModel(IRequestProvider requestProvider,
                         ISettingsService settingsService, IUserDialogs userDialogs,
                         IFontDependDevice fontDependDevice,
                         ICommentsService commentsService)
 {
     _requestProvider  = requestProvider;
     _settingsService  = settingsService;
     _userDialogs      = userDialogs;
     _fontDependDevice = fontDependDevice;
     _commentsService  = commentsService;
 }
Exemplo n.º 25
0
 /// <summary>
 ///     ctor().
 /// </summary>
 public TeamService(
     IRequestProvider requestProvider,
     IIdentityUtilService identityUtilService,
     ITeamFactory teamFactory,
     IProfileFactory profileFactory)
 {
     _requestProvider     = requestProvider;
     _identityUtilService = identityUtilService;
     _teamFactory         = teamFactory;
     _profileFactory      = profileFactory;
 }
Exemplo n.º 26
0
 public IdentityService(
     IRequestProvider requestProvider,
     IDialogService dialogService,
     INavigationService navigationService,
     IIdentityUtilService identityUtilService)
 {
     _requestProvider     = requestProvider;
     _dialogService       = dialogService;
     _navigationService   = navigationService;
     _identityUtilService = identityUtilService;
 }
Exemplo n.º 27
0
        public GlobalSetting()
        {
            _requestProvider = new RequestProvider();

            baseName   = GetAppSetting("baseName", string.Empty).ToString();
            serverName = GetAppSetting("serverName", string.Empty).ToString();
#if DEBUG
            login   = GetAppSetting("loginDebug", string.Empty).ToString();
            passwod = GetAppSetting("passwodDebug", string.Empty).ToString();
#endif
        }
Exemplo n.º 28
0
 public IdentityService()
 {
     _requestProvider    = GlobalSetting.Instance.RequestProvider;
     _serializerSettings = new JsonSerializerSettings
     {
         ContractResolver     = new CamelCasePropertyNamesContractResolver(),
         DateTimeZoneHandling = DateTimeZoneHandling.Utc,
         NullValueHandling    = NullValueHandling.Ignore
     };
     _serializerSettings.Converters.Add(new StringEnumConverter());
 }
Exemplo n.º 29
0
        internal Response Send(IRequestProvider request)
        {
            var httpRequest = request.GetRequest();

            var resp = _client.Get(httpRequest);

            using (var stream = resp.Body)
            {
                var pair = request.Parser.Parse(stream);
                return pair.Value;
            }
        }
Exemplo n.º 30
0
        public WelcomeViewModel(INavigationService navigationService,
                                IRequestProvider requestProvider,
                                IAuthenticationService authenticationService,
                                IUserService userService) : base(navigationService)
        {
            this.requestProvider       = requestProvider;
            this.authenticationService = authenticationService;
            this.userService           = userService;

            SignInToAnotherAccountCommand = new Command(SignInToAnotherAccountCommandExecute);
            SignUpTpLogotypeCommand       = new Command(SignUpTpLogotypeCommandExecute);
            QuickLoginCommand             = new Command(QuickLoginCommandExecute);
        }
Exemplo n.º 31
0
 public PaymentController(IRequestProvider requestProvider,
                          ILogger <PaymentController> logger,
                          IMerchantRepository merchantRepository,
                          ITransactionRepository transactionRepository,
                          ILogRepository logRepository,
                          ISubscriptionsRepository subscriptionsRepository)
 {
     _requestProvider         = requestProvider;
     _logger                  = logger;
     _merchantRepository      = merchantRepository;
     _transactionRepository   = transactionRepository;
     _logRepository           = logRepository;
     _subscriptionsRepository = subscriptionsRepository;
 }
Exemplo n.º 32
0
 /// <summary>
 ///     ctor().
 /// </summary>
 public ProfileService(
     IRequestProvider requestProvider,
     IIdentityUtilService identityUtilService,
     IProfileMediaService profileMediaService,
     IMediaFactory mediaFactory,
     IProfileFactory profileFactory,
     INavigationService navigationService)
 {
     _requestProvider     = requestProvider;
     _identityUtilService = identityUtilService;
     _mediaFactory        = mediaFactory;
     _navigationService   = navigationService;
     _profileFactory      = profileFactory;
 }
Exemplo n.º 33
0
 public PostService(
     IRequestProvider requestProvider,
     IIdentityUtilService identityUtilService,
     IGroupsService groupsService,
     IPostPublicityScopeFactory postPublicityScopeFactory,
     ITeamMemberService teamMemberService,
     IFamilyService familyService)
 {
     _requestProvider           = requestProvider;
     _identityUtilService       = identityUtilService;
     _groupsService             = groupsService;
     _postPublicityScopeFactory = postPublicityScopeFactory;
     _teamMemberService         = teamMemberService;
     _familyService             = familyService;
 }
Exemplo n.º 34
0
 public NukitoFactCommand(
 IMethodInfo method,
 ConstructorInfo constructor,
 IRequestProvider requestProvider,
 IResolver resolver,
 IReflectionHelper reflectionHelper,
 IMockRepository mockRepository,
 MockSettings settings,
 MockSettings constructorSettings)
     : base(method)
 {
     _constructor = constructor;
       _requestProvider = requestProvider;
       _resolver = resolver;
       _reflectionHelper = reflectionHelper;
       _mockRepository = mockRepository;
       _settings = settings;
       _constructorSettings = constructorSettings;
 }
Exemplo n.º 35
0
 public static IRequestProvider GetRequestProvider()
 {
     Lock.EnterReadLock();
     try
     {
         {
             if (_provider == null)
             {
                 if (Configuration.IsMock)
                     _provider = new MockRequestProvider();
                 else
                     _provider = new RequestProvider(AccountProviderFactory.GetAccountProvider());
             }
         }
     }
     finally
     {
         Lock.ExitReadLock();
     }
     return _provider;
 }
Exemplo n.º 36
0
 protected FlexiWebClient(ICryptProvider crypt, IRequestProvider requestProvider, IJsonProvider jsonProvider)
 {
     _cryptProvider = crypt;
     _requestProvider = requestProvider;
     _jsonProvider = jsonProvider;
 }