예제 #1
0
파일: ddex.cs 프로젝트: JordanChin/Ingres
        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;
        }
예제 #2
0
        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);
        }
예제 #3
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);
        }
예제 #4
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);
        }
예제 #5
0
파일: ddex.cs 프로젝트: JordanChin/Ingres
        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;
        }
예제 #6
0
파일: ddex.cs 프로젝트: JordanChin/Ingres
        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()));
 }