C# Класс SIL.FieldWorks.FDO.DomainServices.Db4OClientServerServices

The master class that configures an FDO system where the Db4o backend provides client-server services.
Наследование: IClientServerServices
Показать файл Открыть проект

Открытые методы

Метод Описание
BeginFindProjects ( string host, Action foundProject, Action exceptionCallback, bool showLocalProjects ) : void

Used to populate the File Open dialog, this returns the names of the projects on the specified host.

BeginFindServers ( Action foundServer ) : void

Used to populate the File Open dialog, this returns the names of the remote servers on which the user might be able to open projects. The local server may be the only one, and always will be if a client-server backend is not configured.

CountOfOtherUsersConnected ( FdoCache cache ) : int

Returns the number of other users currently connected

ForceEndFindProjects ( ) : void

Forcibly ends the task of finding projects begun by BeginFindProjects without waiting for it to complete normally.

ForceEndFindServers ( ) : void

Forcibly ends the task of finding servers begun by BeginFindServers without waiting for it to complete normally.

GetExclusiveModeToken ( FdoCache cache, string id ) : IDisposable

This function is used to obtain a lock, to prevent two clients doing something at the same time. The current use is to prevent two clients from both running the parser at once; hence, it is to be expected that the lock may be held for some time. If some other client already has the lock, it returns null (possibly after a short wait). The caller should Dispose of the token when exclusive access is no longer needed (ideally, using (ClientServerServices.Current.GetExclusiveModeToken(cache, "my function")) {...} A single-user implementation may just return a trivial IDisposable without checking anything.

ListConnectedClients ( string serverName, string project ) : string[]

Finds all clients that are using specified project on the specified server.

ProjectNames ( string serverName ) : string[]

Used to populate the File Open dialog, this returns the names of the projects which can be opened on the specified (possibly remote) server. If the name passed is the name of the local server, it returns the projects being shared by that computer if ShareMyProjects is true; otherwise, it returns the XML projects in the ProjectsDirectory.

ProjectNames ( string serverName, bool refresh ) : string[]

Used to populate the File Open dialog, this returns the names of the projects which can be opened on the specified (possibly remote) server. If the name passed is the name of the local server, it returns the projects being shared by that computer if ShareMyProjects is true; otherwise, it returns the XML/fwdata projects in the ProjectsDirectory. if refresh is true, then the remote server is asked to refresh is project cache.

Приватные методы

Метод Описание
Db4OClientServerServices ( IFdoUI ui, IFdoDirectories dirs ) : System

Initializes a new instance of the Db4OClientServerServices class.

Описание методов

BeginFindProjects() публичный Метод

Used to populate the File Open dialog, this returns the names of the projects on the specified host.
public BeginFindProjects ( string host, Action foundProject, Action exceptionCallback, bool showLocalProjects ) : void
host string The host to search
foundProject Action Callback that is invoked when a project is found /// (string parameter is the name of the project).
exceptionCallback Action Callback to handle any exceptions that happen when /// getting the list of projects (parameter is the exception that occured).
showLocalProjects bool true if we want to show local fwdata projects
Результат void

BeginFindServers() публичный Метод

Used to populate the File Open dialog, this returns the names of the remote servers on which the user might be able to open projects. The local server may be the only one, and always will be if a client-server backend is not configured.
public BeginFindServers ( Action foundServer ) : void
foundServer Action Callback that is invoked when a server is found /// (string parameter is the IP address of the found server).
Результат void

CountOfOtherUsersConnected() публичный Метод

Returns the number of other users currently connected
public CountOfOtherUsersConnected ( FdoCache cache ) : int
cache FdoCache The FDO cache.
Результат int

ForceEndFindProjects() публичный Метод

Forcibly ends the task of finding projects begun by BeginFindProjects without waiting for it to complete normally.
public ForceEndFindProjects ( ) : void
Результат void

ForceEndFindServers() публичный Метод

Forcibly ends the task of finding servers begun by BeginFindServers without waiting for it to complete normally.
public ForceEndFindServers ( ) : void
Результат void

GetExclusiveModeToken() публичный Метод

This function is used to obtain a lock, to prevent two clients doing something at the same time. The current use is to prevent two clients from both running the parser at once; hence, it is to be expected that the lock may be held for some time. If some other client already has the lock, it returns null (possibly after a short wait). The caller should Dispose of the token when exclusive access is no longer needed (ideally, using (ClientServerServices.Current.GetExclusiveModeToken(cache, "my function")) {...} A single-user implementation may just return a trivial IDisposable without checking anything.
public GetExclusiveModeToken ( FdoCache cache, string id ) : IDisposable
cache FdoCache
id string
Результат IDisposable

ListConnectedClients() публичный Метод

Finds all clients that are using specified project on the specified server.
public ListConnectedClients ( string serverName, string project ) : string[]
serverName string
project string
Результат string[]

ProjectNames() публичный Метод

Used to populate the File Open dialog, this returns the names of the projects which can be opened on the specified (possibly remote) server. If the name passed is the name of the local server, it returns the projects being shared by that computer if ShareMyProjects is true; otherwise, it returns the XML projects in the ProjectsDirectory.
public ProjectNames ( string serverName ) : string[]
serverName string
Результат string[]

ProjectNames() публичный Метод

Used to populate the File Open dialog, this returns the names of the projects which can be opened on the specified (possibly remote) server. If the name passed is the name of the local server, it returns the projects being shared by that computer if ShareMyProjects is true; otherwise, it returns the XML/fwdata projects in the ProjectsDirectory. if refresh is true, then the remote server is asked to refresh is project cache.
public ProjectNames ( string serverName, bool refresh ) : string[]
serverName string
refresh bool
Результат string[]