コード例 #1
0
        private static void OperatorPersonalizadoComparativoMenor()
        {
            var poligonoA = new Poligono(1, 3, 2, 1);

            var poligonoB = new Poligono(3, 3, 1, 1);

            Console.WriteLine($"{poligonoA < poligonoB}");
        }
コード例 #2
0
        private static void OperatorPersonalizadoComparativoMaiorIgual()
        {
            var poligonoA = new Poligono(1, 2, 2, 1);

            var poligonoB = new Poligono(2, 2, 1, 1);

            Console.WriteLine($"{poligonoA >= poligonoB}");
        }
コード例 #3
0
        private static void OperatorPersonalizadoEqualidade()
        {
            var poligonoA = new Poligono(4, 3, 3, 6);

            var poligonoB = new Poligono(2, 2, 6, 6);

            Console.WriteLine($"{poligonoA == poligonoB}");
        }
コード例 #4
0
        private static void OperatorPersonalizadoInequalidade()
        {
            var poligonoA = new Poligono(1, 3, 5, 2);

            var poligonoB = new Poligono(3, 2, 6, 1);

            Console.WriteLine($"{poligonoA != poligonoB}");
        }
コード例 #5
0
        private static void OperatorPersonalizadoDivisaoComposta()
        {
            var poligonoA = new Poligono(10, 8, 10, 6);

            var poligonoB = new Poligono(5, 2, 10, 3);

            poligonoA /= poligonoB;
        }
コード例 #6
0
        private static void OperatorPersonalizadoSubtracao()
        {
            var poligonoA = new Poligono(10, 8, 10, 6);

            var poligonoB = new Poligono(5, 2, 10, 3);

            var poligonoC = poligonoA - poligonoB;
        }
コード例 #7
0
        private static void OperatorPersonalizadoDivisor()
        {
            var poligonoA = new Poligono(10, 8, 10, 6);

            var poligonoB = new Poligono(5, 2, 10, 3);

            var poligonoC = poligonoA / poligonoB;
        }
コード例 #8
0
        private static void OperatorPersonalizadoMultiplicador()
        {
            var poligonoA = new Poligono(2, 2, 2, 2);

            var poligonoB = new Poligono(3, 3, 3, 3);

            var poligonoC = poligonoA * poligonoB;
        }
コード例 #9
0
        private static void OperatorPersonalizadoConversaoImplicita()
        {
            var quadrado = new Retangulo()
            {
                LadoA = 3,
                LadoB = 4
            };

            Poligono poligono = quadrado;
        }
コード例 #10
0
        private static void OperatorPersonalizadoDecremento()
        {
            var poligono = new Poligono(2, 2, 2, 2);

            poligono--;
        }