private static ConnectionInfo ConvertToConnectionInfo(ConnectionConfigurationElement configurationElement) { ArgumentChecks.AssertNotNull(configurationElement, nameof(configurationElement)); var pluginIdentifier = configurationElement.DbServerPluginInfo; var pluginResult = DbServerPluginRegistry.GetPluginByIdentifier(pluginIdentifier); if (!pluginResult.HasValue) { var message = string.Format( CultureInfo.CurrentCulture, Messages.PluginNotFound, pluginIdentifier); throw new SnapshotException(message); } var connection = new ConnectionInfo( pluginResult.Value, configurationElement.Host, configurationElement.UsesIntegratedSecurity, configurationElement.UserId, configurationElement.Password); return(connection); }
/// <summary> /// Determines whether the collection contains an element with the same key as the one specified. /// </summary> public bool Contains(ConnectionConfigurationElement element) { ArgumentChecks.AssertNotNull(element, nameof(element)); var contains = BaseGetAllKeys() .Cast <string>() .Contains(this.GetElementKey(element)); return(contains); }
private static ConnectionConfigurationElement ConvertToConfigElement(ConnectionInfo connection) { ArgumentChecks.AssertNotNull(connection, nameof(connection)); var element = new ConnectionConfigurationElement { DbServerPluginInfo = connection.DbServer.PluginIdentifier, Host = connection.Host, UsesIntegratedSecurity = connection.UsesIntegratedSecurity, UserId = connection.UserId, Password = connection.Password }; return(element); }
/// <summary> /// Removes the specified element. /// </summary> public void Remove(ConnectionConfigurationElement element) { ArgumentChecks.AssertNotNull(element, nameof(element)); this.BaseRemove(this.GetElementKey(element)); }
/// <summary> /// Adds the specified element. /// </summary> public void Add(ConnectionConfigurationElement element) { ArgumentChecks.AssertNotNull(element, nameof(element)); this.BaseAdd(element); }