C# Class SIL.FieldWorks.FDO.DomainServices.Db4OLocalClientServerServices

The helper class that configures local servers in an FDO system where the backed can be either a Db4o backend that provides client-server services or a single-user XML-based backend.
Inheritance: ILocalClientServerServices
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Свойство Type Description
ConvertAllProjectsToDb4o bool
ConvertAllProjectsToDb4o object
ConvertAllProjectsToXml bool
ConvertAllProjectsToXmlTask object
EnsureNoClientsAreConnected bool
EnsureNoClientsAreConnected bool
IsLocalServiceRunning bool
ReportConversionError void
WarnOfOtherConnectedClients bool

Méthodes publiques

Méthode Description
ConvertToDb4oBackendIfNeeded ( IThreadedProgress progressDlg, string xmlFilename ) : string

Convert the specified project (assumed to be in the current Projects directory) to the current backend. This is used in Restore and New Project and when turning ShareMyProjects on.

CopyToXmlFile ( FdoCache source, string destDir ) : string

Copies the specified project (assumed to be in the current Projects directory) from the current backend to XML. This is used in Backup and when turning ShareMyProjects off. Returns the name of the temp file IF ANY; returns null if no copy was needed.

Db4OLocalClientServerServices ( IFdoUI ui, IFdoDirectories dirs ) : System
IdForLocalProject ( string projectName ) : string

Return the full ID that should be used to open the specified project, which is in the local projects directory. The input project name must NOT have an extension already.

ListConnectedClients ( string project ) : string[]

Finds all clients that are using specified project.

ListOpenProjects ( ) : string[]

Finds Client server projects that are in use.

ListRemoteConnectedClients ( string project ) : string[]

Finds all clients, except local host, that are using specified project.

RefreshProjectNames ( ) : void

Force the list of project names to be reloaded. (This is needed after deleting a project.)

SetProjectSharing ( bool fShare, IThreadedProgress progress ) : bool

Turns project sharing on or off.

WillProjectBeConverted ( string projectPath, string parentDirectory, string projectsDirectory ) : bool

Return true if the specified project (in the specified parent directory) will be converted as part of the process of converting the projects in projectsDirectory.

Private Methods

Méthode Description
ConvertAllProjectsToDb4o ( IThreadedProgress progressDlg ) : bool

Converts all projects to db4o.

ConvertAllProjectsToDb4o ( IThreadedProgress progress, object args ) : object
ConvertAllProjectsToXml ( IThreadedProgress progressDlg ) : bool

Converts all projects to XML.

ConvertAllProjectsToXmlTask ( IThreadedProgress progress, object args ) : object
EnsureNoClientsAreConnected ( ) : bool

If any clients are still connected to any shared projects, display connected clients to user and allow the user to either recheck (wait) or cancel. TODO: allow the user to force disconnect clients. TODO: prevent new connections while in this shutdown phase. TODO: as an enhancement connected clients could be messaged and asked to disconnect.

EnsureNoClientsAreConnected ( string projectName ) : bool

If any clients are still connected to the server file, display connected clients to user give the user an option to recheck (wait), or cancel. TODO: allow the user to force disconnect clients. TODO: prevent new connections while in this shutdown phase. TODO: as an enhancement connected clients could be messaged and asked to disconnect.

IsLocalServiceRunning ( ) : bool
ReportConversionError ( string projectPath, Exception e ) : void
WarnOfOtherConnectedClients ( string projectName, string connectedClientsMsg ) : bool

Warns the of other connected clients.

Method Details

ConvertToDb4oBackendIfNeeded() public méthode

Convert the specified project (assumed to be in the current Projects directory) to the current backend. This is used in Restore and New Project and when turning ShareMyProjects on.
public ConvertToDb4oBackendIfNeeded ( IThreadedProgress progressDlg, string xmlFilename ) : string
progressDlg IThreadedProgress The progress dialog (for getting a message box owner and/or /// ensuring we're invoking on the UI thread).
xmlFilename string The full path of the existing XML file for the project
Résultat string

CopyToXmlFile() public méthode

Copies the specified project (assumed to be in the current Projects directory) from the current backend to XML. This is used in Backup and when turning ShareMyProjects off. Returns the name of the temp file IF ANY; returns null if no copy was needed.
public CopyToXmlFile ( FdoCache source, string destDir ) : string
source FdoCache The source cache
destDir string The destination directory for the converted copy if a /// conversion needs to be done.
Résultat string

Db4OLocalClientServerServices() public méthode

public Db4OLocalClientServerServices ( IFdoUI ui, IFdoDirectories dirs ) : System
ui IFdoUI
dirs IFdoDirectories
Résultat System

IdForLocalProject() public méthode

Return the full ID that should be used to open the specified project, which is in the local projects directory. The input project name must NOT have an extension already.
public IdForLocalProject ( string projectName ) : string
projectName string
Résultat string

ListConnectedClients() public méthode

Finds all clients that are using specified project.
public ListConnectedClients ( string project ) : string[]
project string
Résultat string[]

ListOpenProjects() public méthode

Finds Client server projects that are in use.
public ListOpenProjects ( ) : string[]
Résultat string[]

ListRemoteConnectedClients() public méthode

Finds all clients, except local host, that are using specified project.
public ListRemoteConnectedClients ( string project ) : string[]
project string
Résultat string[]

RefreshProjectNames() public méthode

Force the list of project names to be reloaded. (This is needed after deleting a project.)
public RefreshProjectNames ( ) : void
Résultat void

SetProjectSharing() public méthode

Turns project sharing on or off.
public SetProjectSharing ( bool fShare, IThreadedProgress progress ) : bool
fShare bool if set to true, turn sharing on.
progress IThreadedProgress The progress dialog.
Résultat bool

WillProjectBeConverted() public méthode

Return true if the specified project (in the specified parent directory) will be converted as part of the process of converting the projects in projectsDirectory.
public WillProjectBeConverted ( string projectPath, string parentDirectory, string projectsDirectory ) : bool
projectPath string
parentDirectory string
projectsDirectory string
Résultat bool