Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        public ProjectViewModel(AD.Project project, ViewModel parent)
            : base(parent)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            _project = project;

            Load();
        }
Ejemplo n.º 3
0
        public ProjectDetailsViewModel(ProjectViewModel parent)
            : base(parent)
        {
            _project = Node.ProjectNode;

            var projectShell = ProjectShell;

            _filePath         = projectShell.FilePath;
            _createdDate      = _project.CreatedDate;
            _lastModifiedDate = _project.LastModifiedDate;
            _expandAllCommand = new DelegateCommand <bool>(ExpandAll);
        }
Ejemplo n.º 4
0
        private ProjectShellViewModel(string filePath, AD.Project project, ViewModel parent)
            : base(parent)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            _project   = project;
            _filePath  = filePath;
            _isChanged = string.IsNullOrEmpty(_filePath);
            _navigator = new HistoryNavigator(this);
            _shell     = FindParent <ShellViewModel>(true);
        }
        internal static void AddKeys(AD.Project project)
        {
            if (project != null)
            {
                foreach (var projectAssembly in project.Assemblies)
                {
                    if (!projectAssembly.IsSigned)
                    {
                        continue;
                    }

                    var sign = projectAssembly.Sign;
                    if (string.IsNullOrEmpty(sign.Password))
                    {
                        continue;
                    }

                    _keyFilePasswordByPath[sign.KeyFile] = sign.Password;
                }
            }
        }
Ejemplo n.º 6
0
        public static ProjectShellViewModel CreateNew(ViewModel parent)
        {
            var project = new AD.Project();

            return(new ProjectShellViewModel(null, project, parent));
        }