protected void OnDatabaseAccessEvent(object sender, DatabaseAccessEventArgs eventArgs)
 {
     if (this.DatabaseAccessEvent != null)
     {
         this.DatabaseAccessEvent(this, eventArgs);
     }
 }
Beispiel #2
0
 public void OnChangeDatabaseSettings(object sender, DatabaseAccessEventArgs databaseAccessEventArgs)
 {
     if (this.ChangeDatabaseSettings != null)
     {
         this.ChangeDatabaseSettings(sender, databaseAccessEventArgs);
     }
 }
        /// <summary>
        /// If the database access manager sends an database access event than the workspace view is enabled, that mean the main window is not bright gray.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DatabaseAccessEventArgs"/> instance containing the event data.</param>
        private void SoftwareVersions_DatabaseAccessEvent(object sender, DatabaseAccessEventArgs e)
        {
            try
            {
                this.IsWorkspaceEnabled = true;

                this.statusbarViewModel.Status = string.Format("Database: {0}  -  Status: {1}", e.DatabaseName, e.DatabaseAvailability.ToString());

                if (e.DatabaseAvailability != DatabaseAvailability.Available)
                {
                    this.IsWorkspaceEnabled = false;
                }
            }
            catch (Exception ex)
            {
                this.viewModelEvents.OnHandleError(this, new UnexpectedErrorHandlerEventArgs(ex));
            }
        }