Example #1
0
 public bool IsEqual(StartupConfigurationProject other)
 {
     return(this.Project == other.Project &&
            this.CommandLineArguments == other.CommandLineArguments &&
            this.WorkingDirectory == other.WorkingDirectory &&
            this.StartProject == other.StartProject &&
            this.StartExternalProgram == other.StartExternalProgram &&
            this.StartBrowserWithUrl == other.StartBrowserWithUrl &&
            this.EnableRemoteDebugging == other.EnableRemoteDebugging &&
            this.RemoteDebuggingMachine == other.RemoteDebuggingMachine);
 }
Example #2
0
        private double _EqualityScore <T>(StartupConfigurationProject available, StartupConfigurationProject current, Func <StartupConfigurationProject, T> getProperty)
        {
            var availableProp = getProperty(available);
            var currentProp   = getProperty(current);

            if (availableProp == null)
            {
                return(0.0);                                            // Property not configured => equality score 0
            }
            var result = !EqualityComparer <T> .Default.Equals(availableProp, currentProp) ?
                         double.NegativeInfinity :                      // Property configured but doesn't match => not equal
                         1.0;                                           // Property configured and does match => increase equality score by 1

            return(result);
        }
Example #3
0
        private double _StringEqualityScore(StartupConfigurationProject available, StartupConfigurationProject current, Func <StartupConfigurationProject, string> getProperty)
        {
            var availableProp = getProperty(available);
            var currentProp   = getProperty(current) ?? string.Empty;   // Some properties return null instead of empty string

            if (availableProp == null)
            {
                return(0.0);                                            // Property not configured => equality score 0
            }
            var result = availableProp != currentProp ?
                         double.NegativeInfinity :                      // Property configured but doesn't match => not equal
                         1.0;                                           // Property configured and does match => increase equality score by 1

            return(result);
        }