Ejemplo n.º 1
0
 public MainWindow()
 {
     InitializeComponent();
     allObjects = new allSpaceObjects();
     allObjects.allPlanets();
     allObjects.allMoons();
     list       = allObjects.objectList;
     t          = new System.Windows.Threading.DispatcherTimer();
     t.Interval = new TimeSpan(2000);
     t.Tick    += t_Tick;
     t.Start();
     subscribePlanets();
 }
Ejemplo n.º 2
0
    public static void Main()
    {
        allSpaceObjects planets = new allSpaceObjects();

        planets.allPlanets();
        planets.allMoons();
        List <SpaceObject> solarSystem = planets.objectList;

        foreach (SpaceObject obj in solarSystem)
        {
            obj.Draw();
            if (obj.children.Count != 0)
            {
                Console.WriteLine(" Moons: ");
                foreach (SpaceObject child in obj.children)
                {
                    child.Draw();
                }
            }
        }

        Console.ReadLine();
    }