当前位置: 首页>>代码示例>>C#>>正文


C# Vector.Equals方法代码示例

本文整理汇总了C#中System.Windows.Vector.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Vector.Equals方法的具体用法?C# Vector.Equals怎么用?C# Vector.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Vector的用法示例。


在下文中一共展示了Vector.Equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Equals

		public void Equals ()
		{
			Vector v = new Vector (4, 5);
			Assert.IsTrue (v.Equals (new Vector (4, 5)));
			Assert.IsFalse (v.Equals (new Vector (5, 4)));
			Assert.IsFalse (v.Equals (new object()));
		}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:VectorTest.cs

示例2: Equals

		public static bool Equals (Vector vector1, Vector vector2)
		{
			return vector1.Equals (vector2);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:4,代码来源:Vector.cs

示例3: PerformOperation


//.........这里部分代码省略.........

                    // Declaring vector2 without initializing x,y values
                    var vector2 = new System.Windows.Vector
                    {
                        X = 45,
                        Y = 70
                    };

                    // Boolean to hold the result of the comparison

                    // assigning values to vector2

                    // Comparing Vectors for equality
                    var areEqual = (vector1 == vector2);

                    // areEqual is False

                    // Displaying Results
                    syntaxString = "areEqual = (vector1 == vector2);";
                    resultType = "Boolean";
                    operationString = "Checking if two vectors are equal";
                    ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
                    break;
                }


                case "rb25":
                {
                    // Checks if two Vectors are equal using the static Equals method.

                    var vector1 = new System.Windows.Vector(20, 30);
                    var vector2 = new System.Windows.Vector(45, 70);

                    var areEqual = System.Windows.Vector.Equals(vector1, vector2);

                    // areEqual is False    

                    // Displaying Results
                    syntaxString = "areEqual = Vector.Equals(vector1, vector2);";
                    resultType = "Boolean";
                    operationString = "Checking if two vectors are equal";
                    ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
                    break;
                }
                case "rb26":
                {
                    // Compares an Object and a Vector for equality using the non-static Equals method.

                    var vector1 = new System.Windows.Vector(20, 30);
                    var vector2 = new System.Windows.Vector(45, 70);

                    var areEqual = vector1.Equals(vector2);

                    // areEqual is False    


                    // Displaying Results
                    syntaxString = "areEqual = vector1.Equals(vector2);";
                    resultType = "Boolean";
                    operationString = "Checking if two vectors are equal";
                    ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
                    break;
                }

                case "rb27":
                {
开发者ID:ClemensT,项目名称:WPF-Samples,代码行数:67,代码来源:MainWindow.cs

示例4: PerformOperation


//.........这里部分代码省略.........
                        // Displaying Results
                        resultType = "Point";
                        syntaxString = "pointResult = Point.Multiply(point1, matrix1);";
                        operationString = "Multiplying a Point by a Matrix";
                        ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
                        break;
                    }

                case "rb10":
                    {
                        // Checks if two Points are equal using the overloaded equality operator.
                        Point point1 = new Point(10, 5);
                        Point point2 = new Point(15, 40);
                        Boolean areEqual;

                        areEqual = (point1 == point2);
                        // areEqual is False

                        // Displaying Results
                        syntaxString = "areEqual = (point1 == point2);";
                        resultType = "Boolean";
                        operationString = "Checking if two points are equal";
                        ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
                        break;
                    }

                case "rb11":
                    {
                        // Checks if two Points are equal using the static Equals method.
                        Point point1 = new Point(10, 5);
                        Point point2 = new Point(15, 40);
                        Boolean areEqual;

                        areEqual = Point.Equals(point1, point2);
                        // areEqual is False

                        // Displaying Results
                        syntaxString = "areEqual = Point.Equals(point1, point2);";
                        resultType = "Boolean";
                        operationString = "Checking if two points are equal";
                        ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
                        break;
                    }
                case "rb12":
                    {
                        // Compares an Object and a Point for equality using the non-static Equals method.
                        Point point1 = new Point(10, 5);
                        Point point2 = new Point(15, 40);
                        Boolean areEqual;

                        areEqual = point1.Equals(point2);
                        // areEqual is False

                        // Displaying Results
                        syntaxString = "areEqual = point1.Equals(point2);";
                        resultType = "Boolean";
                        operationString = "Checking if two points are equal";
                        ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
                        break;
                    }

                case "rb13":
                    {
                        // Compares an Object and a Vector for equality using the non-static Equals method.
                        Vector vector1 = new Vector(20, 30);
                        Vector vector2 = new Vector(45, 70);
开发者ID:samgonzalezr,项目名称:WPFSamples,代码行数:67,代码来源:MainWindow.xaml.cs


注:本文中的System.Windows.Vector.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。