public LoginPresenter(ILoginView view, IServerCommunicator serverCommunicator, IMobileConfigurationReader mobileConfigurationReader, INavigationManager navigationManager,
                              IFileSystem fileSystem, IVaultRepositoryFactory vaultRepositoryFactory, ISynchronizer synchronizer, IAlertDisplayer alertDisplayer,
                              ISecureStringConverter secureStringConverter, IApplicationContext applicationContext)
        {
            this.View = view;
            this.MobileConfigurationReader = mobileConfigurationReader;
            this.NavigationManager         = navigationManager;
            this.FileSystem             = fileSystem;
            this.Synchronizer           = synchronizer;
            this.VaultRepositoryFactory = vaultRepositoryFactory;
            this.AlertDisplayer         = alertDisplayer;
            this.SecureStringConverter  = secureStringConverter;
            this.ApplicationContext     = applicationContext;

            var config = MobileConfigurationReader.GetConfiguration();

            this.View.SyncButtonVisible = config.ApplicationMode == ApplicationMode.Client;
            var repository = VaultRepositoryFactory.CreateInstance();
            var vaults     = repository.GetAllVaultNames();

            this.View.VaultNames        = vaults;
            this.View.SelectedVaultName = vaults.FirstOrDefault();


            this.View.Login += OnLogin;
            this.View.NavigateToConfiguration += OnNavigateToConfiguration;
            this.View.Sync += OnSync;
            this.Synchronizer.StatusUpdate += (message) => this.View.ActivityIndicatorText = message;
            this.View.Initialize           += OnInitialize;
        }
示例#2
0
 public NewHostViewModel(IMemoryManager memoryManager = null)
 {
     host           = new Host();
     dataHandler    = new ServerDataHandler();
     Com            = new ServerCommunicator(dataHandler);
     SuccesTxt      = "";
     _memoryManager = memoryManager ?? MemoryManager.GetInstance();
 }
示例#3
0
 public Synchronizer(IServerCommunicator serverCommunicator, IVaultRepositoryFactory vaultRepositoryFactory, IFileSystem fileSystem,
                     ISyncContext syncContext)
 {
     this.ServerCommunicator     = serverCommunicator;
     this.VaultRepositoryFactory = vaultRepositoryFactory;
     this.FileSystem             = fileSystem;
     this.SyncContext            = syncContext;
 }
示例#4
0
        public EventSeeImagesViewModel(EventModel loadEvent)
        {
            com    = new ServerCommunicator();
            Items  = new ObservableCollection <TestImage>();
            Images = new List <string>();

            _memoryManager = MemoryManager.GetInstance();

            _event = loadEvent;

            ReloadData();
        }
示例#5
0
 public void Setup()
 {
     mockClient           = Substitute.For <HttpClient>();
     mockClientHandler    = Substitute.For <HttpClientHandler>();
     mockCookieContainer  = Substitute.For <CookieContainer>();
     mockErrorcodeHandler = Substitute.For <IServerErrorcodeHandler>();
     mockDataHandler      = Substitute.For <IServerDataHandler>();
     uut = new ServerCommunicator(mockClient,
                                  mockClientHandler,
                                  mockCookieContainer,
                                  mockDataHandler,
                                  mockErrorcodeHandler
                                  );
 }
        public FrontEndServer(IServerCommunicator communicator, ILogger logger, int sleepTimer, IServerDOManager dOManager)
        {
            this.communicator = communicator;
            this.logger = logger;
            this.sleepTimer = sleepTimer;
            this.dOManager = dOManager;

            // Create root DObject
            // TODO - DObject should have OnGetEvent property.
            DObject newObject = new DObject(dOManager);
            newObject.OnGetEvent += RootDObjectHandler;
            rootDObject = newObject;
            dOManager.RegisterObject(newObject);
        }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeusOperations"/> class.
 /// </summary>
 /// <param name="communicator">
 /// The communicator.
 /// </param>
 public ZeusOperations(IServerCommunicator communicator)
 {
     this.Communicator = communicator;
 }
        public ServerActor(DObject dObject, ILogger logger, IServerCommunicator communicator)
        {
            this.dObject = dObject;
            this.logger = logger;
            this.communicator = communicator;
            handlers = new EventHandlersOnServerActor();

            this.dObject.OnGetEvent += OnGetEvent;
            handlers.ChangeColorRequest += Handler_OnChangeColorRequest;
        }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeusOperations"/> class.
 /// </summary>
 /// <param name="communicator">
 /// The communicator.
 /// </param>
 public ZeusOperations(IServerCommunicator communicator)
 {
     this.Communicator = communicator;
 }