private void SignBrowseForKeyFile() { string filePath = AppService.UI.ShowOpenFileDialog( Constants.StrongNameKeyFileFilter, SR.OpenFileCaption); if (string.IsNullOrEmpty(filePath)) { return; } if (!File.Exists(filePath)) { return; } string password = null; if (StrongNameUtils.IsPKCS12File(filePath)) { if (!StrongNamePasswordCache.TryGet(filePath, out password)) { return; } } _projectSign.KeyFile = filePath; _projectSign.Password = password; OnPropertyChanged("SignKeyFile"); OnProjectChanged(); }
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(); }