コード例 #1
0
        private void OpenSimulation(object simulationURI)
        {
            IsXmlPlainSimulation = false;

            this.SimulationFile = File.ReadAllText(simulationURI.ToString());

            var simulation = XMLParser.GetSimulation(this.SimulationFile);

            if (simulation.Stages.Any())
            {
                foreach (var stage in simulation.Stages)
                {
                    var newStage = new StageViewModel(simulation, stage)
                    {
                        Name = stage.Name
                    };
                    this.Stages.Add(newStage);
                }
                this.SelectedStage = this.Stages[0];
            }
            else
            {
                var newStage = new StageViewModel(simulation)
                {
                    Name = "Principal"
                };
                this.Stages.Add(newStage);
                this.SelectedStage = newStage;
            }
            this.SimulationUri = simulationURI.ToString();
        }
コード例 #2
0
        private void OpenXmlPlainSimulation(object simulationXmlText)
        {
            this.SimulationFile = (string)simulationXmlText;

            this.IsXmlPlainSimulation = true;

            var simulation = XMLParser.GetSimulation(this.SimulationFile);

            if (simulation.Stages.Any())
            {
                foreach (var stage in simulation.Stages)
                {
                    var newStage = new StageViewModel(simulation, stage)
                    {
                        Name = stage.Name
                    };
                    this.Stages.Add(newStage);
                }
                this.SelectedStage = this.Stages[0];
            }
            else
            {
                var newStage = new StageViewModel(simulation)
                {
                    Name = "Principal"
                };
                this.Stages.Add(newStage);
                this.SelectedStage = newStage;
            }
        }
コード例 #3
0
        private void AddStage(object stageName)
        {
            var simulation = XMLParser.GetSimulation(this.SimulationFile);
            //simulation.InitializeForNewStage();
            var newStage = new StageViewModel(simulation)
            {
                Name = stageName.ToString()
            };

            this.Stages.Add(newStage);
            this.SelectedStage = newStage;
        }