in apps/samplecode/automotive/apisamples/Microsoft.Dynamics.Automotive.Samples/helpercode/CrmServiceHelpers.cs [65:113]
public override bool Equals(object obj)
{
//Check for null and compare run-time types.
if (obj == null || GetType() != obj.GetType()) return false;
Configuration c = (Configuration)obj;
if (!this.ServerAddress.Equals(c.ServerAddress, StringComparison.InvariantCultureIgnoreCase))
return false;
if (!this.OrganizationName.Equals(c.OrganizationName, StringComparison.InvariantCultureIgnoreCase))
return false;
if (this.EndpointType != c.EndpointType)
return false;
if (null != this.Credentials && null != c.Credentials)
{
if (this.EndpointType == AuthenticationProviderType.ActiveDirectory)
{
if (!this.Credentials.Windows.ClientCredential.Domain.Equals(
c.Credentials.Windows.ClientCredential.Domain, StringComparison.InvariantCultureIgnoreCase))
return false;
if (!this.Credentials.Windows.ClientCredential.UserName.Equals(
c.Credentials.Windows.ClientCredential.UserName, StringComparison.InvariantCultureIgnoreCase))
return false;
}
else if (this.EndpointType == AuthenticationProviderType.LiveId)
{
if (!this.Credentials.UserName.UserName.Equals(c.Credentials.UserName.UserName,
StringComparison.InvariantCultureIgnoreCase))
return false;
if (!this.DeviceCredentials.UserName.UserName.Equals(
c.DeviceCredentials.UserName.UserName, StringComparison.InvariantCultureIgnoreCase))
return false;
if (!this.DeviceCredentials.UserName.Password.Equals(
c.DeviceCredentials.UserName.Password, StringComparison.InvariantCultureIgnoreCase))
return false;
}
else
{
if (!this.Credentials.UserName.UserName.Equals(c.Credentials.UserName.UserName,
StringComparison.InvariantCultureIgnoreCase))
return false;
}
}
return true;
}