Example #1
0
        public void AddAssembly()
        {
            AppService.UI.ShowAppWait();

            string[] files = AppService.UI.ShowOpenFilesDialog(
                Constants.AddAssemblyFileFilter,
                SR.OpenFileCaption);

            if (files == null)
            {
                return;
            }

            try
            {
                _eventTriggering = EventTriggering.DoNotTriggerHierarchyChanged;

                for (int i = 0; i < files.Length; i++)
                {
                    _projectViewModel.AddAssembly(files[i]);
                }
            }
            finally
            {
                _eventTriggering = EventTriggering.TriggerAll;
            }

            OnHierarchyChanged();
        }
Example #2
0
        public void Refresh()
        {
            if (!string.IsNullOrEmpty(_filePath) && !_isChanged)
            {
                var project = LaodProject(_filePath, true);
                if (project == null)
                {
                    return;
                }

                _project = project;
            }

            try
            {
                _eventTriggering = EventTriggering.DoNotTriggerHierarchyChanged;

                _projectViewModel = new ProjectViewModel(_project, this);
                _nodes.Clear();
                _nodes.Add(_projectViewModel);
                _projectViewModel.Expand();
                _projectViewModel.IsSelected = true;
                _navigator.Clear();
            }
            finally
            {
                _eventTriggering = EventTriggering.TriggerAll;
            }

            OnHierarchyChanged();
        }
Example #3
0
        protected override void OnActivate()
        {
            _eventTriggering = EventTriggering.DoNotTriggerHierarchyChanged;

            if (!IsNew)
            {
                _shell.ProjectMRUList.Add(_filePath);
            }

            StrongNamePasswordCache.AddKeys(_project);

            // Attache events.
            Commands.AddAssembly.Subscribe(AddAssembly);
            Commands.RemoveAssembly.Subscribe(RemoveSelectedAssembly, CanRemoveSelectedAssembly);
            Commands.Save.Subscribe(Save, CanSave);
            Commands.Build.Subscribe(Build);
            Commands.Refresh.Subscribe(Refresh);
            Commands.GoBack.Subscribe(GoBack, CanGoBack);
            Commands.GoForward.Subscribe(GoForward, CanGoForward);
            Commands.ExpandAll.Subscribe(ExpandAll);
            Commands.CollapseAll.Subscribe(CollapseAll);
            Commands.ViewSearch.Subscribe(ShowSearch);
            Commands.ViewDecodeStackTrace.Subscribe(ShowDecodeStackTrace);

            // Add and show project view.
            _projectViewModel = new ProjectViewModel(_project, this);
            _nodes.Add(_projectViewModel);
            _projectViewModel.Expand();
            _projectViewModel.IsSelected = true;

            // Update main window caption.
            _shell.WindowTitle = _projectViewModel.Caption;

            _eventTriggering = EventTriggering.TriggerAll;

            base.OnActivate();
        }
Example #4
0
        /// <summary>
        /// Reload project from project file
        /// </summary>
        protected virtual void Reload()
        {
            Debug.Assert(this.buildEngine != null, "There is no build engine defined for this project");

            try
            {
                this.disableQueryEdit = true;

                this.isClosed = false;
                this.eventTriggeringFlag = ProjectNode.EventTriggering.DoNotTriggerHierarchyEvents | ProjectNode.EventTriggering.DoNotTriggerTrackerEvents;

                SetBuildProject(Utilities.ReinitializeMsBuildProject(this.buildEngine, this.filename, this.buildProject));

                // Load the guid
                this.SetProjectGuidFromProjectFile();

                this.ProcessReferences();

                this.ProcessFiles();

                this.ProcessFolders();

                this.LoadNonBuildInformation();

                this.InitSccInfo();

                this.RegisterSccProject();
            }
            finally
            {
                this.SetProjectFileDirty(false);
                this.eventTriggeringFlag = ProjectNode.EventTriggering.TriggerAll;
                this.disableQueryEdit = false;
            }
        }
Example #5
0
        /// <summary>
        /// Reload project from project file
        /// </summary>
        protected virtual void Reload()
        {
            Debug.Assert(this.buildEngine != null, "There is no build engine defined for this project");

            try
            {
                this.disableQueryEdit = true;

                this.isClosed = false;
                this.eventTriggeringFlag = ProjectNode.EventTriggering.DoNotTriggerHierarchyEvents | ProjectNode.EventTriggering.DoNotTriggerTrackerEvents;

                this.buildProject = Utilities.ReinitializeMsBuildProject(this.buildEngine, this.filename, this.buildProject);
                MSBuild.BuildPropertyGroup projectProperties = buildProject.EvaluatedProperties;

                // Load the guid
                if (projectProperties != null)
                {
                    string projectGuid = this.GetProjectProperty(ProjectFileConstants.ProjectGuid);
                    if (String.IsNullOrEmpty(projectGuid))
                    {
                        this.projectIdGuid = Guid.NewGuid();
                    }
                    else
                    {
                        this.projectIdGuid = new Guid(projectGuid);
                    }
                }

                this.ProcessReferences();

                this.ProcessFiles();

                this.ProcessFolders();

                this.LoadNonBuildInformation();

                this.InitSccInfo();

                this.RegisterSccProject();
            }
            finally
            {
                this.SetProjectFileDirty(false);
                this.eventTriggeringFlag = ProjectNode.EventTriggering.TriggerAll;
                this.disableQueryEdit = false;
            }
        }