本文整理汇总了C#中System.Data.SqlTypes.SqlDouble.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDouble.Equals方法的具体用法?C# SqlDouble.Equals怎么用?C# SqlDouble.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlTypes.SqlDouble
的用法示例。
在下文中一共展示了SqlDouble.Equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Equals
/**
* Performs a logical comparison on two instances of SqlDouble to determine if they are equal.
* @param x A SqlDouble instance.
* @param y A SqlDouble instance.
* @return true if the two values are equal, otherwise false.
* If one of the parameters is null or null value return SqlBoolean.Null.
*/
public static SqlBoolean Equals(SqlDouble x, SqlDouble y)
{
if (x.IsNull || y.IsNull)
return SqlBoolean.Null;
if (x.Equals(y))
return SqlBoolean.True;
return SqlBoolean.False;
}
示例2: EqualsMethods
public void EqualsMethods ()
{
SqlDouble Test0 = new SqlDouble (0);
SqlDouble Test1 = new SqlDouble (1.58e30);
SqlDouble Test2 = new SqlDouble (1.8e180);
SqlDouble Test22 = new SqlDouble (1.8e180);
Assert.IsTrue (!Test0.Equals (Test1), "#F01");
Assert.IsTrue (!Test1.Equals (Test2), "#F02");
Assert.IsTrue (!Test2.Equals (new SqlString ("TEST")), "#F03");
Assert.IsTrue (Test2.Equals (Test22), "#F04");
// Static Equals()-method
Assert.IsTrue (SqlDouble.Equals (Test2, Test22).Value, "#F05");
Assert.IsTrue (!SqlDouble.Equals (Test1, Test2).Value, "#F06");
}
示例3: EqualsMethods
public void EqualsMethods()
{
SqlDouble Test0 = new SqlDouble (0);
SqlDouble Test1 = new SqlDouble (1.58e30);
SqlDouble Test2 = new SqlDouble (1.8e180);
SqlDouble Test22 = new SqlDouble (1.8e180);
Assert ("#F01", !Test0.Equals (Test1));
Assert ("#F02", !Test1.Equals (Test2));
Assert ("#F03", !Test2.Equals (new SqlString ("TEST")));
Assert ("#F04", Test2.Equals (Test22));
// Static Equals()-method
Assert ("#F05", SqlDouble.Equals (Test2, Test22).Value);
Assert ("#F06", !SqlDouble.Equals (Test1, Test2).Value);
}
示例4: EqualsMethods
public void EqualsMethods()
{
SqlDouble Test0 = new SqlDouble(0);
SqlDouble Test1 = new SqlDouble(1.58e30);
SqlDouble Test2 = new SqlDouble(1.8e180);
SqlDouble Test22 = new SqlDouble(1.8e180);
Assert.True(!Test0.Equals(Test1));
Assert.True(!Test1.Equals(Test2));
Assert.True(!Test2.Equals(new SqlString("TEST")));
Assert.True(Test2.Equals(Test22));
// Static Equals()-method
Assert.True(SqlDouble.Equals(Test2, Test22).Value);
Assert.True(!SqlDouble.Equals(Test1, Test2).Value);
}