C# Класс 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.
Наследование: ILocalClientServerServices
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
ConvertAllProjectsToDb4o bool
ConvertAllProjectsToDb4o object
ConvertAllProjectsToXml bool
ConvertAllProjectsToXmlTask object
EnsureNoClientsAreConnected bool
EnsureNoClientsAreConnected bool
IsLocalServiceRunning bool
ReportConversionError void
WarnOfOtherConnectedClients bool

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

Метод Описание
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.

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

Метод Описание
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.

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

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

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
Результат string

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

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.
Результат string

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

public Db4OLocalClientServerServices ( IFdoUI ui, IFdoDirectories dirs ) : System
ui IFdoUI
dirs IFdoDirectories
Результат System

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

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
Результат string

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

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

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

Finds Client server projects that are in use.
public ListOpenProjects ( ) : string[]
Результат string[]

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

Finds all clients, except local host, that are using specified project.
public ListRemoteConnectedClients ( string project ) : string[]
project string
Результат string[]

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

Force the list of project names to be reloaded. (This is needed after deleting a project.)
public RefreshProjectNames ( ) : void
Результат void

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

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.
Результат bool

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

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
Результат bool