Esempio n. 1
0
        public static void Main()
        {
            // Console.WriteLine(FileExtensions.GetFileExtension("example")); // throws exception
            Console.WriteLine(FileExtensions.GetFileExtension("example.pdf"));
            Console.WriteLine(FileExtensions.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine(
                "Distance in the 2D space = {0:f2}",
                DistanceCalculator.CalcDistance2D(1, -2, 3, 4));

            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                DistanceCalculator.CalcDistance3D(5, 2, -1, 3, -6, 4));

            double width  = 3;
            double height = 4;
            double depth  = 5;

            Console.WriteLine("Volume = {0:f2}", VolumeUtilities.CalcVolume(width, height, depth));

            double xyz = DistanceCalculator.Calc3DSpaceDiagonalDistance(
                width,
                height,
                depth,
                DistanceCalculator.DiagonalFormat.Xyz);

            Console.WriteLine("Diagonal XYZ = {0:f2}", xyz);

            double xy = DistanceCalculator.Calc3DSpaceDiagonalDistance(
                width,
                height,
                depth,
                DistanceCalculator.DiagonalFormat.Xy);

            Console.WriteLine("Diagonal XY = {0:f2}", xy);

            double xz = DistanceCalculator.Calc3DSpaceDiagonalDistance(
                width,
                height,
                depth,
                DistanceCalculator.DiagonalFormat.Xz);

            Console.WriteLine("Diagonal XZ = {0:f2}", xz);

            double yz = DistanceCalculator.Calc3DSpaceDiagonalDistance(
                width,
                height,
                depth,
                DistanceCalculator.DiagonalFormat.Yz);

            Console.WriteLine("Diagonal YZ = {0:f2}", yz);
        }
Esempio n. 2
0
        private static void FileExtensionExamples()
        {
            Console.WriteLine(FileExtensions.GetFileExtension("example"));
            Console.WriteLine(FileExtensions.GetFileExtension("example.pdf"));
            Console.WriteLine(FileExtensions.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example.new.pdf"));
        }
        private static void Main()
        {
            Console.WriteLine(FileExtensions.GetFileExtension("example"));
            Console.WriteLine(FileExtensions.GetFileExtension("example.pdf"));
            Console.WriteLine(FileExtensions.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}", DistanceCalculator.CalculateDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", DistanceCalculator.CalculateDistance3D(5, 2, -1, 3, -6, 4));

            Cube.Width  = 3;
            Cube.Height = 4;
            Cube.Depth  = 5;
            Console.WriteLine("Volume = {0:f2}", Cube.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", Cube.CalculateDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", Cube.CalculateDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", Cube.CalculateDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", Cube.CalculateDiagonalYZ());
        }
Esempio n. 4
0
        static void Main()
        {
            Console.WriteLine(FileExtensions.GetFileExtension("example"));
            Console.WriteLine(FileExtensions.GetFileExtension("example.pdf"));
            Console.WriteLine(FileExtensions.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileExtensions.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}",
                              DistanceCalculator.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                              DistanceCalculator.CalcDistance3D(5, 2, -1, 3, -6, 4));

            Cube cube = new Cube(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", cube.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", cube.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", cube.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", cube.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", cube.CalcDiagonalYZ());
        }