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); }
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); }
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); }