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; }
private static string GetTempPath(string fileName) { return(Path.Combine(DirectoryProvider.GetTempDirectory(), fileName)); }