Exemple #1
0
        public TestDataUniverse(IUniverse universe)
        {
            _universe = universe;
            var planets = _universe.Planets();
            var mercury = planets.Create("Mercury");
            var venus   = planets.Create("Venus");
            var earth   = planets.Create("Earth");

            planets.Create("Mars");
            planets.Create("Jupiter");
            planets.Create("Saturn");
            planets.Create("Uranus");

            var properties = _universe.Properties();
            var atmosphere = properties.Create("Atmosphere");
            var water      = properties.Create("Water");
            var solid      = properties.Create("Solid");
            var radiation  = properties.Create("Radiation");
            var hot        = properties.Create("Hot");
            var cold       = properties.Create("Cold");
            var ice        = properties.Create("Ice");

            earth.Properties().Add(atmosphere);
            earth.Properties().Add(water);

            venus.Properties().Add(hot);
            venus.Properties().Add(radiation);

            mercury.Properties().Add(solid);
            mercury.Properties().Add(ice);
            mercury.Properties().Add(cold);
        }
Exemple #2
0
        public ListPlanetsViewModel(IUniverse universe)
        {
            _planets = new AsyncPlanets(universe.Planets());
            _planets.NewPlanetEvent += (sender, args) => { _addPlanet(args.Planet); };

            CreatePlanet  = new CreatePlanet(_planets);
            ReloadPlanets = new RelayCommand(_loadPlanets);

            _loadPlanets();
        }
Exemple #3
0
 public IPlanets Planets()
 {
     return(_universe.Planets());
 }