Exemplo n.º 1
0
 public ConnectionsManager(ITransportResource resource,
                           IUsersRepository userRepository,
                           ICommandSerializer serializer)
 {
     _resource           = resource;
     _userRepository     = userRepository;
     _serializer         = serializer;
     _resource.Received += _resource_OnReceived;
     _timer              = new Timer(OnTimerTick, null, TimerInterval);
 }
 public ConnectionsManager(ITransportResource resource, 
     IUsersRepository userRepository,
     ICommandSerializer serializer)
 {
     _resource = resource;
     _userRepository = userRepository;
     _serializer = serializer;
     _resource.Received += _resource_OnReceived;
     _timer = new Timer(OnTimerTick, null, TimerInterval);
 }
        public ApplicationManager(
            ITransportResource transportResource,
            IStorage storage,
			IDeviceInfo deviceInfo)
        {
            _transport = transportResource;
            _storage = storage;
            DeviceInfo = deviceInfo;

            Initialize ();
        }
Exemplo n.º 4
0
        public ConnectionManager(
            ITransportResource transport,
            CommandBuffer commandBuffer,
            CommandParser commandParser,
            RequestsHandler requestsHandler,
            IDtoSerializer serializer)
        {
            _transport       = transport;
            _commandBuffer   = commandBuffer;
            _commandParser   = commandParser;
            _requestsHandler = requestsHandler;
            _serializer      = serializer;

            _commandBuffer.CommandAssembled += CommandBuffer_CommandAssembled;
            _transport.DataReceived         += data => _commandBuffer.AppendBytes(data);
            _transport.ConnectionError      += Transport_ConnectionError;
        }
Exemplo n.º 5
0
        public ApplicationManager(
            ITransportResource transportResource,
            IDtoSerializer dtoSerializer,
            IStorage storage,
            IDeviceInfo deviceInfo)
        {
            var commandParser     = new CommandParser();
            var connectionManager = new ConnectionManager(transportResource, new CommandBuffer(commandParser), commandParser, new RequestsHandler(), dtoSerializer);

            AccountManager = new AccountManager(storage, deviceInfo, connectionManager,
                                                new ProfileServiceProxy(connectionManager),
                                                new RegistrationServiceProxy(connectionManager),
                                                new AuthenticationServiceProxy(connectionManager));
            ChatManager       = new ChatManager(connectionManager, new ChatServiceProxy(connectionManager), AccountManager);
            FriendsManager    = new FriendsManager(connectionManager, new FriendsServiceProxy(connectionManager));
            SearchManager     = new SearchManager(connectionManager, new UsersSearchServiceProxy(connectionManager));
            ConnectionManager = connectionManager;
        }
 public ApplicationManager(
     ITransportResource transportResource,
     IDtoSerializer dtoSerializer,
     IStorage storage,
     IDeviceInfo deviceInfo)
 {
     //we don't have autofac so let's build the tree 
     var commandParser = new CommandParser();
     var connectionManager = new ConnectionManager(transportResource, new CommandBuffer(commandParser), commandParser, new RequestsHandler(), dtoSerializer);
     
     AccountManager = new AccountManager(storage, deviceInfo, connectionManager, 
         new ProfileServiceProxy(connectionManager), 
         new RegistrationServiceProxy(connectionManager), 
         new AuthenticationServiceProxy(connectionManager));
     ChatManager = new ChatManager(connectionManager, new ChatServiceProxy(connectionManager), AccountManager);
     FriendsManager = new FriendsManager(connectionManager, new FriendsServiceProxy(connectionManager));
     SearchManager = new SearchManager(connectionManager, new UsersSearchServiceProxy(connectionManager));
     ConnectionManager = connectionManager;
 }
Exemplo n.º 7
0
 public TransportManager(ITransportResource resource, ICommandSerializer serializer)
 {
     _resource           = resource;
     _serializer         = serializer;
     _resource.Received += _resource_OnReceived;
 }
 public TransportManager(ITransportResource resource, ICommandSerializer serializer)
 {
     _resource = resource;
     _serializer = serializer;
     _resource.Received += _resource_OnReceived;
 }