public override bool EquivalentTo(DataConnectionProperties connectionProperties) { if (connectionProperties == null || // safety check !(connectionProperties is IngresConnectionProperties)) return false; //if (CompareProperties(connectionProperties, "Server") && // CompareProperties(connectionProperties, "Database") && // CompareProperties(connectionProperties, "User ID")) // return true; if (CompareProperties(connectionProperties, "Database")) return true; return false; }
private bool CompareProperties( DataConnectionProperties connProperties, string propName) { string prop1; string prop2; if (propName == "Server") { prop1 = GetMachineNameIfLocal(this); prop2 = GetMachineNameIfLocal(connProperties); } else { prop1 = this[propName] as string; prop2 = connProperties[propName] as string; } return((String.Compare(prop1, prop2, StringComparison.InvariantCultureIgnoreCase)) == 0); }
public override bool EquivalentTo(DataConnectionProperties connectionProperties) { if (connectionProperties == null || // safety check !(connectionProperties is IngresConnectionProperties)) { return(false); } //if (CompareProperties(connectionProperties, "Server") && // CompareProperties(connectionProperties, "Database") && // CompareProperties(connectionProperties, "User ID")) // return true; if (CompareProperties(connectionProperties, "Database")) { return(true); } return(false); }
private string GetMachineNameIfLocal(DataConnectionProperties connProperties) { string server = connProperties["Server"] as string; if (server == null) { return(null); } server = server.ToUpperInvariant(); if (server.Equals("(LOCAL)", StringComparison.InvariantCulture) || server.StartsWith("(LOCAL)\\")) { // return machinenmae + name beyond the "(LOCAL)" return(Environment.MachineName.ToUpperInvariant() + server.Substring("(LOCAL)".Length)); } return(server); }
private bool CompareProperties( DataConnectionProperties connProperties, string propName) { string prop1; string prop2; if (propName == "Server") { prop1 = GetMachineNameIfLocal(this); prop2 = GetMachineNameIfLocal(connProperties); } else { prop1 = this[propName] as string; prop2 = connProperties[propName] as string; } return (String.Compare(prop1, prop2, StringComparison.InvariantCultureIgnoreCase)) == 0; }
private string GetMachineNameIfLocal(DataConnectionProperties connProperties) { string server = connProperties["Server"] as string; if (server == null) return null; server = server.ToUpperInvariant(); if (server.Equals("(LOCAL)", StringComparison.InvariantCulture) || server.StartsWith("(LOCAL)\\")) // return machinenmae + name beyond the "(LOCAL)" return Environment.MachineName.ToUpperInvariant() + server.Substring("(LOCAL)".Length); return server; }
public override bool EquivalentTo(DataConnectionProperties connectionProperties) { return(ToString().Equals(((MySqlConnectionProperties)connectionProperties).ToString())); }