/// <summary> /// Removes a connectionparameter from the connectionparameterlist /// </summary> /// <param name="name">name from the connectionparameter</param> /// <author>Bernhard Bruns</author> public static void RemoveConnectionParameter(String name) { foreach (ConnectionParameters conParams in ConnectionParametersList) { if (conParams.Name != name) { continue; } ConnectionParametersList.Remove(conParams); break; } }
/// <summary> /// Returns the last used connectionparameter /// </summary> /// <returns>ConnectionParameter</returns> /// <author>Bernhard Bruns</author> public static ConnectionParameters LoadLastUsedDatabase() { return(ConnectionParametersList.FirstOrDefault(connectionParameters => connectionParameters.IsLastUsedDatabase)); }
/// <summary> /// Checks if the DatabaseConnection connectionname already exists /// </summary> /// <param name="connectionName"></param> /// <returns>true, if the connectionname not already exists</returns> /// <author>Bernhard Bruns</author> public static bool CheckIfDatabaseNameExists(String connectionName) { return(ConnectionParametersList.All(conParams => conParams.Name != connectionName)); }
/// <summary> /// Add a database connection to the connectionlist /// </summary> /// <author>Bernhard Bruns</author> public static void AddDatabaseConnectionToConnectionList(ConnectionParameters conParams) { ConnectionParametersList.Add(conParams); }