コード例 #1
0
ファイル: IRemoteService.cs プロジェクト: kozintsev/Pilot.Web
        public RemoteService(HttpPilotClient client)
        {
            _client = client;
            _client.SetConnectionLostListener(this);
            _serverCallback = new ServerCallback();
            _fileArchiveApi = client.GetFileArchiveApi();

            var searchFactory          = new SearchServiceFactory(_serverCallback);
            var localArchiveRootFolder = DirectoryProvider.GetTempPath();
            var fileStorageProvider    = new FileStorageProvider(localArchiveRootFolder);
            var changsetUploader       = new ChangesetUploader(_fileArchiveApi, fileStorageProvider, null);
            var messageApi             = client.GetMessagesApi(new NullableMessagesCallback());
            var serverApi = client.GetServerApi(_serverCallback);
            var dbInfo    = serverApi.OpenDatabase();
            var backend   = new Backend(serverApi, dbInfo, messageApi, changsetUploader);

            _serverApi = new ServerApiService(serverApi, dbInfo, searchFactory, backend);
            _serverCallback.RegisterCallbackListener((IRemoteServiceListener)_serverApi);
            IsActive = true;
        }
コード例 #2
0
 private static string GetTempPath(string fileName)
 {
     return(Path.Combine(DirectoryProvider.GetTempDirectory(), fileName));
 }