Exemplo n.º 1
0
        static int Main(string[] args)
        {
            AstroTime time;

            switch (args.Length)
            {
            case 0:
                time = new AstroTime(DateTime.Now);
                break;

            case 1:
                time = DemoHelper.ParseTime("lunar_eclipse", args[0]);
                break;

            default:
                Console.WriteLine("USAGE: lunar_eclipse [date]");
                return(1);
            }

            int count = 0;
            LunarEclipseInfo eclipse = Astronomy.SearchLunarEclipse(time);

            for (;;)
            {
                if (eclipse.kind != EclipseKind.Penumbral)
                {
                    PrintEclipse(eclipse);
                    if (++count == 10)
                    {
                        break;
                    }
                }
                eclipse = Astronomy.NextLunarEclipse(eclipse.peak);
            }

            return(0);
        }