C# 클래스 SIL.FieldWorks.FDO.DomainServices.Db4OClientServerServices

The master class that configures an FDO system where the Db4o backend provides client-server services.
상속: IClientServerServices
파일 보기 프로젝트 열기: sillsdev/FieldWorks

공개 메소드들

메소드 설명
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[]