Inheritance: BaseViewModel
        public ProjectManagerViewModel(BaseViewModel parent)
            : base(parent)
        {
            Config = new Config.ConfigViewModel(this);

            Project = new ProjectViewModel(this);
            Project.FileRequested += Project_FileRequested;
            Project.SelectionChanged += Project_SelectionChanged;
            Project.FileCreated += Project_FileCreated;
            Project.ReferenceAdded += Project_ReferenceAdded;
            Project.FileDeleted += Project_FileDeleted;
            Project.ProjectCreated += Project_ProjectCreated;
            Project.ProjectOpened += Project_ProjectOpened;
            Project.ProjectClosed += Project_ProjectClosed;

            Blueprint = new BlueprintViewModel(this);
            Blueprint.InsertRequested += Blueprint_InsertRequested;

            Editor = new EditorViewModel(this);
            Editor.FileChanged += Editor_FileChanged;
            Editor.Items.CollectionChanged += Editor_CollectionChanged;

            Classes = new ClassViewModel(this);
            BuildClasses();

            Output = new OutputViewModel(this);

            Backup = new BackupViewModel(this);
            Backup.RestoreRequested += Backup_RestoreRequested;

            FindReplace = new FindReplaceViewModel(this);

            _NewProjectCommand = new Commands.DelegateCommand(PerformNewProject);
            _OpenProjectCommand = new Commands.DelegateCommand(PerformOpenProject);
            _CloseProjectCommand = new Commands.DelegateCommand(PerformCloseProject);

            _SaveFileCommand = new Commands.DelegateCommand(PerformSaveFile);
            _SaveAllCommand = new Commands.DelegateCommand(PerformSaveAll);

            _RunScriptCommand = new Commands.DelegateCommand(PerformRunScript);
            _OpenSelectedCommand = new Commands.DelegateCommand(PerformOpenSelected);

            _CloseFileCommand = new Commands.DelegateCommand(PerformCloseFile);
            _CloseAllCommand = new Commands.DelegateCommand(PerformCloseAll);

            _UndoCommand = new Commands.DelegateCommand(PerformUndo);
            _RedoCommand = new Commands.DelegateCommand(PerformRedo);
            _CutCommand = new Commands.DelegateCommand(PerformCut);
            _CopyCommand = new Commands.DelegateCommand(PerformCopy);
            _PasteCommand = new Commands.DelegateCommand(PerformPaste);
            _DeleteCommand = new Commands.DelegateCommand(PerformDelete);
            _SelectAllCommand = new Commands.DelegateCommand(PerformSelectAll);

            _CloseViewCommand = new Commands.DelegateCommand(PerformCloseView);
        }
Example #2
0
 private void SetProject(ProjectItem parent, ProjectViewModel project)
 {
     parent.Project = project;
     foreach (ProjectItem child in parent.Children)
     {
         SetProject(child, project);
     }
 }