本文整理汇总了C#中PointClass.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# PointClass.Equals方法的具体用法?C# PointClass.Equals怎么用?C# PointClass.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointClass
的用法示例。
在下文中一共展示了PointClass.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
PointStruct ps1 = new PointStruct();
ps1.x = ps1.y = 22;
PointStruct ps2 = new PointStruct();
ps2.x = ps2.y = 33;
ps1 = ps2;
ps2.x = ps2.y = 55;
Console.WriteLine("ps1 is ({0}, {1})", ps1.x, ps1.y);
Console.WriteLine("ps2 is ({0}, {1})", ps2.x, ps2.y);
Console.WriteLine("ps1.Equals(ps2) results in " + ps1.Equals(ps2));
PointClass pc1 = new PointClass();
pc1.x = pc1.y = 22;
PointClass pc2 = new PointClass();
pc2.x = pc2.y = 33;
pc1 = pc2;
pc2.x = pc2.y = 55;
Console.WriteLine("pc1 is ({0}, {1})", pc1.x, pc1.y);
Console.WriteLine("pc2 is ({0}, {1})", pc2.x, pc2.y);
Console.WriteLine("pc1.Equals(pc2) results in " + pc1.Equals(pc2));
Console.WriteLine("pc1 == pc2 results in " + (pc1 == pc2));
}
示例2: Main
static void Main()
{
PointStruct ps1 = new PointStruct();
ps1.x = ps1.y = 55;
PointStruct ps2 = new PointStruct();
ps2.x = ps2.y = 55;
PointClass pc1 = new PointClass();
pc1.x = pc1.y = 55;
PointClass pc2 = new PointClass();
pc2.x = pc2.y = 55;
Console.WriteLine("ps1.Equals(ps2) results in " + ps1.Equals(ps2));
Console.WriteLine("ps1.Equals(pc1) results in " + ps1.Equals(pc1));
Console.WriteLine("pc1.Equals(pc2) results in " + pc1.Equals(pc2));
Console.WriteLine("pc1 == pc2 results in " + (pc1 == pc2));
// Console.WriteLine("ps1 == ps2 results in " + (ps1 == ps2));
}