C# 클래스 Business.DatabaseHandler

Ensures server and database are up and running.
파일 보기 프로젝트 열기: mysteryx93/NaturalGroundingPlayer 1 사용 예제들

공개 메소드들

메소드 설명
CopyFileAsync ( string sourcePath, string destinationPath ) : Task
DatabaseHandler ( Window owner ) : System
EnsureAvailableAsync ( ) : Task

Checks server and database availability. If there is no database file, copy and attach initial database. Update database if it is outdated.

If connection fails, the exception must be handled by the caller.

LogException ( Exception ex ) : void

Writes exception details into a log file.

UpdateDatabaseAsync ( ) : Task

Updates database if needed.

비공개 메소드들

메소드 설명
CreateNewDatabaseAsync ( ) : Task

Creates a new database.

GetUpdateScript ( string name ) : string

Returns the update script with specified name.

RunScript ( string scriptFile ) : void

Runs the specified database script.

TryUntilTimeout ( System.Action action, int timeout ) : Task
UpdateDatabaseToVersion ( bool backupBeforeUpdate, int major, int minor, int build, int revision ) : void

Updates database by running a script, after making an optional backup.

메소드 상세

CopyFileAsync() 공개 메소드

public CopyFileAsync ( string sourcePath, string destinationPath ) : Task
sourcePath string
destinationPath string
리턴 Task

DatabaseHandler() 공개 메소드

public DatabaseHandler ( Window owner ) : System
owner Window
리턴 System

EnsureAvailableAsync() 공개 메소드

Checks server and database availability. If there is no database file, copy and attach initial database. Update database if it is outdated.
If connection fails, the exception must be handled by the caller.
public EnsureAvailableAsync ( ) : Task
리턴 Task

LogException() 공개 메소드

Writes exception details into a log file.
public LogException ( Exception ex ) : void
ex System.Exception The exception to log.
리턴 void

UpdateDatabaseAsync() 공개 메소드

Updates database if needed.
public UpdateDatabaseAsync ( ) : Task
리턴 Task