Beispiel #1
0
        static void Main(string[] args)
        {
            Program p     = new Program();
            double  input = 20f;

            ConvertUnit cu = null;

            cu += p.MileToKm;
            cu += p.CelsiusToKelvin;
            cu += delegate(double pound)
            {
                double kg = pound * 0.45359237;
                Console.WriteLine($"{pound} lbs = {Math.Round(kg, 3)} kg");
                return(kg);
            };

            cu += cal =>
            {
                double kj = cal * 4.184;
                Console.WriteLine($"{cal} cal = {Math.Round(kj, 3)} kJ");
                return(kj);
            };

            cu?.Invoke(input);

            Console.ReadKey();
        }