public CachingRestClient(IRequestClient requestClient, IRestClient restClient, INetworkService network, ICache cache) { _requestClient = requestClient; _restClient = restClient; _network = network; _cache = cache; }
/// <summary> /// Constructor for <see cref="LoginViewModel"/>. /// </summary> public LoginViewModel(INetworkService networkService) { NetworkService = networkService; NetworkService.StatusChanged += ConnectionStatusChanged; Connect = new DelegateCommand(async() => await ConnectHandler(), CanConnect); ChooseCountry = new DelegateCommand(ChooseCountryHandler); }
private Sender( StreamingNetworkService <GeneralGroupCommunicationMessage> networkService, IIdentifierFactory idFactory) { _networkService = networkService; _idFactory = idFactory; }
public BlockAcceptedEventHandler(INetworkService networkService, ISyncStateService syncStateService, ITaskQueueManager taskQueueManager) { _taskQueueManager = taskQueueManager; _networkService = networkService; _syncStateService = syncStateService; }
public DriverRepository(IHttpClientService httpClientService, IJsonService jsonService, IResourcesService resourcesService, INetworkService networkService) { this.HttpClientService = httpClientService; this.JsonService = jsonService; this.ResourcesService = resourcesService; this.NetworkService = networkService; }
public MainViewModel(INavigationService navigationService, IApiService apiService, IDictionaryService dictionaryService, ILocalStorageService localStorageService, IRoamingStorageService roamingStorageService, IAnalyticsService analyticsService, INetworkService networkService, IFeatureToggleService featureToggleService) { _navigationService = navigationService; _apiService = apiService; _dictionaryService = dictionaryService; _localStorageService = localStorageService; _roamingStorageService = roamingStorageService; _analyticsService = analyticsService; _networkService = networkService; _featureToggleService = featureToggleService; InitializeAsync(); Messenger.Default.Register <NewTranslationMessage>(this, async(message) => { await AddTranslationAsync(message.Translation); }); Messenger.Default.Register <HistoryRemovedMessage>(this, async(message) => { await CreateTranslationCardsAsync(); }); Messenger.Default.Register <HistoryToggleMessage>(this, (message) => { HistoryShowed = _localStorageService.Read(StorageConstants.HistoryShowed, true); }); }
public void TestWritableNetworkServiceTwoWayCommunication() { int networkServicePort1 = NetworkUtils.GenerateRandomPort(6000, 7000); int networkServicePort2 = NetworkUtils.GenerateRandomPort(7001, 8000); BlockingCollection <WritableString> queue1; BlockingCollection <WritableString> queue2; using (var nameServer = NameServerTests.BuildNameServer()) { IPEndPoint endpoint = nameServer.LocalEndpoint; int nameServerPort = endpoint.Port; string nameServerAddr = endpoint.Address.ToString(); var handlerConf = TangFactory.GetTang() .NewConfigurationBuilder() .BindImplementation(GenericType <IObserver <WritableNsMessage <WritableString> > > .Class, GenericType <MessageHandler> .Class) .Build(); var networkServiceInjection1 = BuildNetworkService(networkServicePort1, nameServerPort, nameServerAddr, handlerConf); var networkServiceInjection2 = BuildNetworkService(networkServicePort2, nameServerPort, nameServerAddr, handlerConf); using (INetworkService <WritableString> networkService1 = networkServiceInjection1.GetInstance <WritableNetworkService <WritableString> >()) using (INetworkService <WritableString> networkService2 = networkServiceInjection2.GetInstance <WritableNetworkService <WritableString> >()) { queue1 = networkServiceInjection1.GetInstance <MessageHandler>().Queue; queue2 = networkServiceInjection2.GetInstance <MessageHandler>().Queue; IIdentifier id1 = new StringIdentifier("service1"); IIdentifier id2 = new StringIdentifier("service2"); networkService1.Register(id1); networkService2.Register(id2); using (IConnection <WritableString> connection1 = networkService1.NewConnection(id2)) using (IConnection <WritableString> connection2 = networkService2.NewConnection(id1)) { connection1.Open(); connection1.Write(new WritableString("abc")); connection1.Write(new WritableString("def")); connection1.Write(new WritableString("ghi")); connection2.Open(); connection2.Write(new WritableString("jkl")); connection2.Write(new WritableString("nop")); Assert.AreEqual("abc", queue2.Take().Data); Assert.AreEqual("def", queue2.Take().Data); Assert.AreEqual("ghi", queue2.Take().Data); Assert.AreEqual("jkl", queue1.Take().Data); Assert.AreEqual("nop", queue1.Take().Data); } } } }
public ClientApiService(ICustomLogger logger, ConvertService converter, INetworkService network, IErrorHandleStrategy errorHandle) { _logger = logger; _converter = converter; _network = network; _errorHandle = errorHandle; }
public LanguagesLoader(Location location, PersistenceService persistenceService, Func<Priority, INetworkService> networkServiceFactory, Priority priority = Priority.Background) { _location = location; _persistenceService = persistenceService; _networkService = networkServiceFactory(priority); }
public Sender( NetworkService<GroupCommunicationMessage> networkService, IIdentifierFactory idFactory) { _networkService = networkService; _idFactory = idFactory; }
public AddIncidentDetailViewModel(INetworkService networkService, IUserDialogs userDialogs, IAzureService azureService, IMvxMessenger messenger) : base(networkService, userDialogs) { _azureService = azureService; _messenger = messenger; }
/// <summary> /// Initializes a new instance of the ViewModelLocator class. /// </summary> public ViewModelLocator() { Resources.Resources.Culture = DependencyService.Get <ILocalize>()?.GetCurrentCultureInfo(); ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); SimpleIoc.Default.Register <MainViewModel>(); SimpleIoc.Default.Register <LayoutsViewModel>(); SimpleIoc.Default.Register <DisplayingViewModel>(); SimpleIoc.Default.Register <PagesViewModel>(); SimpleIoc.Default.Register <LoginViewModel>(); SimpleIoc.Default.Register <INavigationService>(() => new NavigationService(Navigation)); SimpleIoc.Default.Register <INewsRepository>(() => new NewsRepository()); ISQLite sqLiteService = DependencyService.Get <ISQLite>(); SimpleIoc.Default.Register <ISQLite>(() => sqLiteService); INetworkService networkService = DependencyService.Get <INetworkService>(); SimpleIoc.Default.Register <INetworkService>(() => networkService); IHubNotificationService hubNotificationService = DependencyService.Get <IHubNotificationService>(); SimpleIoc.Default.Register <IHubNotificationService>(() => hubNotificationService); }
public CameraService(IFontService fontService, INetworkService networkService, IControllerService controllerService) { _fontService = fontService; _networkService = networkService; _controllerService = controllerService; lastPosition = new Vector2(); }
/// <summary> /// Initializes a new instance of the <see cref="NetworkInterfaceType"/> class. /// </summary> /// <param name="networkService">The application layer NetworkService.</param> /// <param name="logger">The NLog logger instance.</param> public NetworkInterfaceType(INetworkService networkService, ILogger logger) { this.Field(x => x.Name); this.Field(x => x.IpAddress); this.Field(x => x.SubnetMask); this.Field(x => x.DefaultGateway); this.Field <NetworkInterfaceStatusType>() .Name("Status") .ResolveAsync(async context => { logger.Debug("Network interface status field"); return(await networkService.GetLastNetworkInterfaceStatusAsync(context.Source.Name)); }); this.Connection <NetworkInterfaceStatusType>() .Name("Statuses") .Bidirectional() .ResolveAsync(async context => { logger.Debug("Network Interface statuses connection"); var pagingInput = context.GetPagingInput(); var networkInterfaceStatuses = await networkService.GetNetworkInterfaceStatusesAsync(context.Source.Name, pagingInput); return(networkInterfaceStatuses.ToConnection()); }); }
public GroupCommClient( [Parameter(typeof(GroupCommConfigurationOptions.SerializedGroupConfigs))] ISet<string> groupConfigs, [Parameter(typeof(TaskConfigurationOptions.Identifier))] string taskId, StreamingNetworkService<GeneralGroupCommunicationMessage> networkService, AvroConfigurationSerializer configSerializer, IInjector injector) { _commGroups = new Dictionary<string, ICommunicationGroupClientInternal>(); _networkService = networkService; foreach (string serializedGroupConfig in groupConfigs) { IConfiguration groupConfig = configSerializer.FromString(serializedGroupConfig); IInjector groupInjector = injector.ForkInjector(groupConfig); var commGroupClient = (ICommunicationGroupClientInternal)groupInjector.GetInstance<ICommunicationGroupClient>(); _commGroups[commGroupClient.GroupName] = commGroupClient; } networkService.Register(new StringIdentifier(taskId)); foreach (var group in _commGroups.Values) { group.WaitingForRegistration(); } }
private Sender( StreamingNetworkService<GeneralGroupCommunicationMessage> networkService, IIdentifierFactory idFactory) { _networkService = networkService; _idFactory = idFactory; }
public CloudUpdateService(IProtoService protoService, INetworkService networkService, IEventAggregator aggregator) { _protoService = protoService; _networkService = networkService; _aggregator = aggregator; _aggregator.Subscribe(this); }
public NetworkServiceTests() { _blockchainService = GetRequiredService <IBlockchainService>(); _networkService = GetRequiredService <INetworkService>(); _peerPool = GetRequiredService <IPeerPool>(); _kernelTestHelper = GetRequiredService <KernelTestHelper>(); _blackListProvider = GetRequiredService <IBlackListedPeerProvider>(); }
public void ReplaceNetworkService(INetworkService newInstance) { var index = GameComponentsLookup.NetworkService; var component = (NetworkServiceComponent)CreateComponent(index, typeof(NetworkServiceComponent)); component.instance = newInstance; ReplaceComponent(index, component); }
public OpenWeatherService(INetworkService service, string countryCode) { _openWeatherKey = "5b4644a9b439f82f38796c3a2c242735"; _networkService = service; _language = countryCode.ToLower(); Debug.Log("Language code " + _language); }
public static void Create(EndpointAddress uri) { NetTcpBinding netTcpBinding = new NetTcpBinding(SecurityMode.None); ChannelFactory <INetworkService> channelFactory = new ChannelFactory <INetworkService>(netTcpBinding, uri); _instance = channelFactory.CreateChannel(); isCreated = true; }
public void SendMarketItemInfo(E_Item item, int netId, int holderNetId, INetworkService ns) { ns.SendServerCommand( SC_ApplyOtherUpdateMarketEquipment.Instance( netId, holderNetId, (item as E_EquipmentItem).GetEquipmentInfoNo())); }
public MinerController(Tuple <string, IImmutableList <MinersConfigModel> > data) { _minerSvc = CreateTasks(data); _consoleView = new MinersView(); _networkSvc = new NetworkService(); _networkSvc.Setup(); }
public AggregateMapDataProvider(IFileSystemService fileSystemService, INetworkService networkService, ITrace trace) { _osmMapDataProvider = new OpenStreetMapDataProvider(fileSystemService, networkService, trace); _mapzenMapDataProvider = new MapzenMapDataProvider(fileSystemService, networkService, trace); _mapzenElevationDataProvider = new MapzenElevationDataProvider(fileSystemService, networkService, trace); _srtmElevationDataProvider = new SrtmElevationDataProvider(fileSystemService, networkService, trace); }
/// <summary> /// Initializes a new instance of the <see cref="ClientConnected" /> class. /// </summary> /// <param name="client">The client.</param> public ClientConnected(INetworkService client) { if (client == null) { throw new ArgumentNullException("client"); } this.Client = client; }
public MapDataLoader(IElevationProvider elevationProvider, IFileSystemService fileSystemService, INetworkService networkService, IPathResolver pathResolver) { _elevationProvider = elevationProvider; _fileSystemService = fileSystemService; _networkService = networkService; _pathResolver = pathResolver; }
protected static void GlobalSetup() { // Setup a network for the DB Server DatabaseServerNetwork = new Builder().UseNetwork($"testnetwork{Guid.NewGuid()}").Build(); // Start the Database Server here DbConnectionStringWithNoDatabase = StartMySqlContainerWithOpenConnection(); }
public CreditServiceController(IEmployeeService employeeService, ICreditServiceService creditServiceService , INetworkService networkService) : base(employeeService) { this._creditServiceService = creditServiceService; this._employeeService = employeeService; _networkService = networkService; }
public CreateCodeStylePopupViewModel(Page page, INetworkService networkService) { _page = page; _networkService = networkService; CancelCommand = new Command(Cancel); OkCommand = new Command(Ok); }
public CustomerInfoRepository( INetworkService networkService, IRepository <CustomerInfoUpdateString> customerInfoUpdateRepository ) { _customerInfoUpdateRepository = customerInfoUpdateRepository; _networkService = networkService; }
public NetworkController( INetworkService networkService, INodeService nodeService ) { _networkService = networkService; _nodeService = nodeService; }
public WalletInfoViewModel(IWeb3Service web3Service, INetworkService networkService, INavigationService navigationService) { _web3Service = web3Service; _networkService = networkService; _navigationService = navigationService; TokenListItemPressed = new Command <Token>((t) => OnTokenListItemPressed(t).SafeFireAndForget(true)); RefreshPressed = new Command(() => Device.BeginInvokeOnMainThread(() => OnRefreshPressed().SafeFireAndForget(true))); }
public ServiceManager(ILogger <ServiceManager> logger, IServiceProviderRepository serviceProviderRepository, IUserRepository userRepository, INetworkService networkService, IMailingService mailingService) { this.logger = logger; this.serviceProviderRepository = serviceProviderRepository; this.userRepository = userRepository; this.networkService = networkService; this.mailingService = mailingService; }
public TransactionViewModel(INavService navService, INetworkService netService, IDatabaseService db, ICustomDialogService dialog) : base(navService, netService, db, dialog) { IsBusy = false; JsonContent = new SupportFormModel(); var location = DependencyService.Get <ILocationInterface>(); // DependencyService.Get<ILocationInterface>().InitialService(); }
public HomeController(IPostService postService, IUserService userService, INetworkService networkService) { _postService = postService; _userService = userService; _networkService = networkService; }
public NewCustomerViewModel( INavigationService navigationService, UnitOfWork unitOfWork, INetworkService networkService, IGooglePlacesService googlePlacesService) : base(networkService, navigationService, unitOfWork, googlePlacesService) { }
public WorkerQueueItemViewModel(INetworkService networkService, IUserDialogs userDialogs, Incident incident, string fullName) : base(networkService, userDialogs) { DateOpened = incident.DateOpened; Id = incident.Id; ImageLink = incident.ImageLink; Subject = incident.Subject; UserId = incident.AssignedToId; FullName = fullName; }
public Game(IQuest quest, GameMode gameMode, GameDisplayType gameDisplayType, INetworkService networkService, IUserInquirer userInquirer) { this.quest = quest; this.gameDisplayType = gameDisplayType; this.gameMode = gameMode; this.networkService = networkService; this.userInquirer = userInquirer; if (this.quest == null) throw new NotValidQuestException("Quest is not valid"); }
public MainViewModel(INetworkService networkService, ICurrencyService currencyService) { this.money = new Money() { Rate = 0.8440 }; this.networkService = networkService; this.currencyService = currencyService; this.convertCommand = new DelegateCommand(ConvertExecute, CanConvertExecute); this.rateCommand = new DelegateCommandAsync(RateExecute); }
public Github(IUserService userService, IRepositoryService repositoryService, INetworkService networkService, IIssueService issueService, IObjectService objectService, ICommitService commitService) { Users = userService; Repositories = repositoryService; Networks = networkService; Issues = issueService; Objects = objectService; Commits = commitService; }
// // Constructors // public GameRepository(GameMode gameMode, GameDisplayType gameDisplayType, INetworkService networkService) { if (appPath == null) throw new InvalidStateException("Application path is not set in GameRepository module."); this.gameMode = gameMode; this.gameDisplayType = gameDisplayType; this.networkService = networkService; this.Initialize(); }
/// <summary> /// /// </summary> public AppConfigurationRequiredServices(IAppConfigurationServiceSetup serviceSetup, IAppConfigurationEndpointService endpointService, IVersionService versionService, IUserDialogService userDialogService, INetworkService networkService, IFileCacheService fileCacheService) { this.FileCacheService = fileCacheService; this.ServiceSetup = serviceSetup; this.EndpointService = endpointService; this.VersionService = versionService; this.UserDialogService = userDialogService; this.NetworkService = networkService; }
public DisplayIncidentDetailViewModel(INetworkService networkService, IUserDialogs userDialogs, IncidentDetail model, string fullName, DisplayIncidentViewModel parent) : base(networkService, userDialogs) { DetailText = model.DetailText; ImageLink = model.ImageLink; AudioRecordingLink = model.AudioLink; DateOpened = model.DateEntered; FullName = fullName; _parent = new WeakReference(parent); }
private Vector2 _origin; // local origin position. #endregion Fields #region Constructors public Tank(Game game) { _game = game; _input = (IInputService)_game.Services.GetService(typeof(IInputService)); _network = (INetworkService)_game.Services.GetService(typeof(INetworkService)); velocity = Vector2.Zero; _direction = Vector2.Zero; position = new Vector2(100, 100); _origin = Vector2.Zero; rotationAngle = (float)Math.PI / 2; }
public PlayerViewModel( INavigationService navigationService, INetworkService networkService, IDownloadManager downloadManager, IDialogService dialogService, IVideoDownloaderService videoDownloaderService, ILogService logService) { this._navigationService = navigationService; this._networkService = networkService; this._downloadManager = downloadManager; this._dialogService = dialogService; this._videoDownloaderService = videoDownloaderService; _logService = logService; }
public Trello(INetworkService networkService, IRequestClient client) { _networkService = networkService; _client = client; Members = new AsyncMembers(_client); Boards = new AsyncBoards(_client); Lists = new AsyncLists(_client); Cards = new AsyncCards(_client); Checklists = new AsyncChecklists(_client); Organizations = new AsyncOrganizations(_client); Notifications = new AsyncNotifications(_client); Tokens = new AsyncTokens(_client); Actions = new AsyncActions(_client); }
public DownloadManager( INetworkService networkService, IStorageService storageService, IVideoDownloaderService downloaderService, ISettingsService settingsService, IVideoDownloaderFactory videoDownloaderFactory) { _networkService = networkService; _storageService = storageService; _downloaderService = downloaderService; _settingsService = settingsService; _videoDownloaderFactory = videoDownloaderFactory; _networkService.NetworkStatusChanged += OnNetworkStatusChanged; }
public SessionDetailsViewModel(INavigationService navigationService, IDialogService dialogService, IDownloadManager downloadManager, IVideoDownloaderService videoDownloaderService, INetworkService networkService, ILogService logService) { _navigationService = navigationService; _dialogService = dialogService; _downloadManager = downloadManager; _videoDownloaderService = videoDownloaderService; _networkService = networkService; _logService = logService; CreateCommands(); if (IsInDesignMode) { Session = DesignData.GetSession(); } }
private GroupCommClient( [Parameter(typeof(GroupCommConfigurationOptions.SerializedGroupConfigs))] ISet<string> groupConfigs, [Parameter(typeof(TaskConfigurationOptions.Identifier))] string taskId, NetworkService<GroupCommunicationMessage> networkService, AvroConfigurationSerializer configSerializer, IInjector injector) { _commGroups = new Dictionary<string, ICommunicationGroupClient>(); _networkService = networkService; networkService.Register(new StringIdentifier(taskId)); foreach (string serializedGroupConfig in groupConfigs) { IConfiguration groupConfig = configSerializer.FromString(serializedGroupConfig); IInjector groupInjector = injector.ForkInjector(groupConfig); ICommunicationGroupClient commGroupClient = groupInjector.GetInstance<ICommunicationGroupClient>(); _commGroups[commGroupClient.GroupName] = commGroupClient; } }
public NetworkViewModel(INetworkService networkService, IUserDialogService dialogService) { this.Host = "google.ca"; this.Network = networkService; this.Ping = new MvxCommand(async () => { if (String.IsNullOrWhiteSpace(this.Host)) { dialogService.Alert("You must enter a host"); } else { var reached = false; using (dialogService.Loading()) { reached = await networkService.IsHostReachable(this.Host); } var msg = (reached ? " is reachable" : " cannot be reached" ); dialogService.Alert(this.Host + msg); } }); }
public MainPage() { this.InitializeComponent(); this.networkService = new NetworkService(); var hub = new LifxHub(); var bulb1 = new LifxBulb(mac2, new GpioLedWrapper(new GpioRgbLed(26, 13, 06))) { Label = "RGB Led" }; var bulb2 = new AnimatedBulb(new LifxBulb(this.mac, this)) { Label = "Virtual Bulb" }; hub.AddBulb(bulb1); hub.AddBulb(bulb2); this.networkService.AddClient(hub); this.networkService.Open(); }
private void Cleanup() { if (_socket.Connected) Close(); _socket = null; if (_client == null) return; _client.Dispose(); _client = null; _writer.Reset(); }
/// <summary> /// Assign a new socket & client to this context. /// </summary> /// <param name="socket">Socket that connected</param> /// <param name="client">Your own class dealing with this particular client.</param> public void Assign(Socket socket, INetworkService client) { if (socket == null) throw new ArgumentNullException("socket"); if (client == null) throw new ArgumentNullException("client"); _socket = socket; _client = client; _client.Assign(this); _writer.Assign(socket); var ep = (IPEndPoint) _socket.RemoteEndPoint; _remoteEndPoint = new IPEndPoint(ep.Address, ep.Port); var willRaiseEvent = _socket.ReceiveAsync(_readArgs); if (!willRaiseEvent) OnReadCompleted(_socket, _readArgs); }
/// <summary> /// Initializes a new instance of the <see cref="ClientConnected" /> class. /// </summary> /// <param name="client">The client.</param> public ClientConnected(INetworkService client) { if (client == null) throw new ArgumentNullException("client"); Client = client; }
public Bot(INetworkService networkService, IConnectionFactory connectionFactory) : this() { this.networkService = networkService; this.connectionFactory = connectionFactory; }
public WorkerQueueViewModel(INetworkService networkService, IUserDialogs userDialogs, IAzureService azureService) : base(networkService, userDialogs) { _azureService = azureService; }
public DisplayIncidentViewModel(INetworkService networkService, IUserDialogs userDialogs, IAzureService azureService) : base(networkService, userDialogs) { _azureService = azureService; IncidentDetails = new List<DisplayIncidentDetailViewModel>(); }
public NetworkStatusChangedMessage(INetworkService networkService) : base(networkService) { this.Status = networkService; }
public MotorService(IFontService fontService, INetworkService networkService, IControllerService controllerService) { _fontService = fontService; _networkService = networkService; _controllerService = controllerService; }
/// <summary> /// Initializes a new instance of the <see cref="DashboardViewModel"/> class. /// </summary> /// <param name="networkService">The network service.</param> /// <param name="userDialogs">The user dialogs.</param> /// <param name="mobileService">Service for accessing Azure.</param> public DashboardViewModel(INetworkService networkService, IUserDialogs userDialogs, IAzureService mobileService) : base(networkService, userDialogs) { _azureService = mobileService; }