Ejemplo n.º 1
0
        public void SaveProject(ProjectDocument project)
        {
            var projectWriter = _writerProvider.GetProjectWriter();

            projectWriter.Save(project.Project);
            project.Dirty = false;

            foreach (var stageName in project.StageNames)
            {
                var stage = project.StageByName(stageName);
                SaveStage(stage);
            }

            var allEntities = project.Entities.Concat(project.UnloadedEntities).ToList();

            foreach (var entity in allEntities)
            {
                if (entity.StoragePath == null)
                {
                    entity.StoragePath = project.FileStructure.CreateEntityPath(entity.Name);
                }
            }

            var entityFileGroups = allEntities
                                   .GroupBy(e => e.StoragePath.Absolute);

            foreach (var group in entityFileGroups)
            {
                SaveEntities(group, group.Key);
            }
        }
Ejemplo n.º 2
0
        public void ChangeStage(string stageName)
        {
            try
            {
                var nextStage = _project.StageByName(stageName);

                _stage = nextStage;

                ViewModelMediator.Current.GetEvent <StageChangedEventArgs>().Raise(this, new StageChangedEventArgs(_stage));
            }
            catch (GameXmlException ex)
            {
                CustomMessageBox.ShowError(ex.Message, this.Project.Name);
            }
        }