private void updateMenu() { AnnoTier tier = AnnoTierStatic.Selected; bool hasTier = tier != null; SignalTrack track = SignalTrackStatic.Selected; bool hasTrack = track != null; MediaBox box = MediaBoxStatic.Selected; bool hasBox = box != null; bool isConnected = DatabaseHandler.IsConnected; bool isConnectedAndHasSession = isConnected && DatabaseHandler.IsSession; bool hasDatabaseTier = false; if (isConnectedAndHasSession && hasTier && tier.AnnoList.Source.HasDatabase) { hasDatabaseTier = true; } DatabaseAuthentication authentication = DatabaseHandler.CheckAuthentication(); // file control.fileSaveProjectMenu.IsEnabled = hasTier || hasTrack || hasBox; control.exportSamplesMenu.IsEnabled = hasTier && hasTrack; control.exportToGenie.IsEnabled = hasTier; control.exportSelectedTrackMenu.IsEnabled = hasTrack; control.exportSelectedTierMenu.IsEnabled = hasTier; // database control.databaseLoadSessionMenu.IsEnabled = isConnected; control.databasePasswordMenu.IsEnabled = isConnected; control.databaseUpdateMenu.IsEnabled = isConnected; control.databaseCMLMenu.IsEnabled = isConnected; control.databaseCMLCompleteStepMenu.IsEnabled = isConnectedAndHasSession; control.databaseCMLExtractFeaturesMenu.IsEnabled = isConnected && (authentication > DatabaseAuthentication.READ); control.databaseCMLMergeAnnotationsMenu.IsEnabled = isConnected && (authentication > DatabaseAuthentication.READ); control.databaseCMLTrainAndPredictMenu.IsEnabled = isConnected && (authentication > DatabaseAuthentication.READ); control.databaseAdminMenu.Visibility = isConnected && (authentication > DatabaseAuthentication.READWRITE) ? Visibility.Visible : Visibility.Collapsed; control.databaseManageUsersMenu.Visibility = isConnected && (authentication > DatabaseAuthentication.DBADMIN) ? Visibility.Visible : Visibility.Collapsed; control.fusionmenu.Visibility = (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\bayesfusion.exe") == true) ? Visibility.Visible : Visibility.Collapsed; // annotation control.annoNewMenu.IsEnabled = ((Time.TotalDuration > 0) == true); control.annoSaveAllMenu.IsEnabled = hasTier; control.annoSaveMenu.IsEnabled = hasTier; control.annoSaveAsFinishedMenu.IsEnabled = hasTier; control.annoReloadMenu.IsEnabled = hasTier; control.annoReloadBackupMenu.IsEnabled = hasDatabaseTier; control.annoExportMenu.IsEnabled = hasTier; control.convertSelectedTierMenu.IsEnabled = hasTier; control.convertAnnoContinuousToDiscreteMenu.IsEnabled = hasTier && (tier.IsContinuous || tier.AnnoList.Scheme.Type == AnnoScheme.TYPE.FREE); control.removeRemainingSegmentsMenu.IsEnabled = hasTier && tier.IsDiscreteOrFree; control.convertAnnoToSignalMenu.IsEnabled = hasTier && tier.IsContinuous; control.convertSignalMenu.IsEnabled = hasTrack; control.XAIMenu.IsEnabled = hasBox; control.XAIMenu.Visibility = control.updatePythonMenu.Visibility = (MainHandler.ENABLE_PYTHON ? Visibility.Visible : Visibility.Collapsed); }
internal void Populate(TDatabaseAuthentication data) { if (data != null) { DatabaseAuthentication.Change(data); } }
/// <summary> /// Initializes a new instance of the <see cref="DatabaseInfo" /> class. /// </summary> /// <param name="server">The server.</param> /// <param name="database">The database.</param> /// <param name="authentication">The authentication.</param> /// <param name="credentials">The credentials.</param> /// <param name="connectionTimeout">The connection timeout.</param> /// <param name="commandTimeout">The command timeout.</param> /// <param name="transactionTimeout">The transaction timeout.</param> /// <param name="maxPoolSize">The maximum number of database connections used for the connection pool.</param> protected DatabaseInfo(string server, string database, DatabaseAuthentication authentication, NetworkCredential credentials, int connectionTimeout, int commandTimeout, int transactionTimeout, int maxPoolSize) : this(server, database, authentication, credentials) { ConnectionTimeout = connectionTimeout; CommandTimeout = commandTimeout; TransactionTimeout = transactionTimeout; MaxPoolSize = maxPoolSize; }
internal void Populate(TDatabaseAuthentication data) { if (data != null) { if (data.Authentication.Equals(DatabaseAuthentication.Authentication)) { DatabaseAuthentication.CopyFrom(data); DatabaseConnection1 = $"Data Server = {data.DatabaseServer}; Initial Catalog = {data.DatabaseName}"; } IsCheckedAuthentication = DatabaseAuthentication.IsActive; } }
internal void Populate(TDatabaseAuthentication data) { if (data.NotNull()) { if (data.Authentication.Equals(DatabaseAuthentication.Authentication)) { DatabaseAuthentication.CopyFrom(data); DatabaseConnection1 = $"Data Server = {data.DatabaseServer}; Initial Catalog = {data.DatabaseName}"; DatabaseConnection2 = $"User Id = {data.UserId}; Password = {data.UserPassword}"; } IsCheckedAuthentication = DatabaseAuthentication.IsActive; } }
public void Select (TDatabaseAuthentication database) { DatabaseAuthentication.CopyFrom (database); }
internal void Apply() { DatabaseAuthentication.Apply(); CheckVisibility = Visibility.Visible; }
/// <summary> /// Initializes a new instance of the <see cref="SqlDatabaseInfo" /> class. /// </summary> /// <param name="server">The server.</param> /// <param name="database">The database.</param> /// <param name="authentication">The authentication.</param> /// <param name="credentials">The credentials.</param> /// <param name="connectionTimeout">The connection timeout.</param> /// <param name="commandTimeout">The command timeout.</param> /// <param name="transactionTimeout">The transaction timeout.</param> /// <param name="maxPoolSize">The maximum number of database connections allowed in the connection pool.</param> public SqlDatabaseInfo(string server, string database, DatabaseAuthentication authentication, NetworkCredential credentials, int connectionTimeout, int commandTimeout, int transactionTimeout, int maxPoolSize = 200) : base(server, database, authentication, credentials, connectionTimeout, commandTimeout, transactionTimeout, maxPoolSize) { }
/// <summary> /// Initializes a new instance of the <see cref="SqlDatabaseInfo" /> class. /// </summary> /// <param name="server">The server.</param> /// <param name="database">The database.</param> /// <param name="authentication">The authentication.</param> /// <param name="credentials">The credentials.</param> public SqlDatabaseInfo(string server, string database, DatabaseAuthentication authentication, NetworkCredential credentials) : base(server, database, authentication, credentials) { }
/// <summary> /// Initializes a new instance of the <see cref="SqlDatabaseInfo" /> class. /// </summary> /// <param name="server">The server.</param> /// <param name="database">The database.</param> /// <param name="authentication">The authentication.</param> public SqlDatabaseInfo(string server, string database, DatabaseAuthentication authentication) : base(server, database, authentication) { }
/// <summary> /// Initializes a new instance of the DatabaseInfo class. /// </summary> /// <param name="server">The server.</param> /// <param name="database">The database.</param> /// <param name="authentication">The authentication.</param> /// <param name="credentials">The credentials.</param> protected DatabaseInfo(string server, string database, DatabaseAuthentication authentication, NetworkCredential credentials) : this(server, database, authentication) { Credentials = credentials; }
/// <summary> /// Initializes a new instance of the <see cref="DatabaseInfo" /> class. /// </summary> /// <param name="server">The server.</param> /// <param name="database">The database.</param> /// <param name="authentication">The authentication.</param> protected DatabaseInfo(string server, string database, DatabaseAuthentication authentication) : this(server, database) { Authentication = authentication; }