Пример #1
0
        private void SetProject(ProjectSettings projectSettings, string serializationPath = null)
        {
            this.ProjectSettings = projectSettings;
            this.SerializationPath = serializationPath;

            if (this.ProjectSettings != null)
            {
                this.ProjectSettings.EntityComponentTypesChanged += this.OnEntityComponentTypesChanged;

                // Setup project explorer
                this.ProjectExplorerViewModel = new ProjectExplorerViewModel();

                foreach (var blueprintFile in this.ProjectSettings.BlueprintFiles)
                {
                    // Add project file.
                    var projectFileViewModel = new ProjectFileViewModel(blueprintFile);
                    this.ProjectExplorerViewModel.ProjectFiles.Add(projectFileViewModel);
                }
            }
            else
            {
                this.ProjectExplorerViewModel = new ProjectExplorerViewModel();
                this.BlueprintManagerViewModel = null;
            }

            // Load localization data.
            this.localizationContext.LoadLanguages();

            // Raise events.
            this.OnPropertyChanged("ProjectSettings");
            this.OnEntityComponentTypesChanged();
        }
Пример #2
0
        public void New()
        {
            ProjectSettings newProjectSettings = new ProjectSettings();

            // Set new project.
            this.SetProject(newProjectSettings);
            this.SetAvailableLanguages(new List<string>());
            this.SelectedProjectFile = this.ProjectExplorerViewModel.ProjectFiles[0];

            // Update blueprint view model.
            this.LoadBlueprints();
        }