public void UTSelectedResult() { var presenter = GetPrivateTestTarget(); var window = new ExplorerWindow() { Name = "X", Path = "Xxx" }; var mockService = GetMock <IExplorerRecService>(); mockService.Setup(s => s.OpenWindow(window)).Returns(true); presenter.Invoke("SelectedResult", window); var mockView = GetMock <IRecListView>(); mockView.Verify(v => v.Close(), Times.Once); mockView.Verify(v => v.ShowMessage(It.IsAny <string>()), Times.Never); }
/// <summary> /// Event handler for our invocation of the ShowExplorerWindow menu item. /// This results in the tool window being shown. /// </summary> /// <param name="sender"></param> /// <param name="arguments"></param> private void ShowExplorerWindow(object sender, EventArgs arguments) { ExplorerWindow.Show(); }
protected override void Dispose(bool disposing) { try { // HACK HACK -- change when the hack is removed above EFModelErrorTaskNavigator.DslDesignerOnNavigate = null; // -- // always dispose and null out items that use VS resources _viewExplorerCmd = null; _viewMappingCmd = null; if (_explorerWindow != null) { _explorerWindow.Dispose(); _explorerWindow = null; } if (_mappingDetailsWindow != null) { // don't need to call this, the MDF takes care of this one //_mappingDetailsWindow.Dispose(); _mappingDetailsWindow = null; } // remove all errors ErrorListHelper.RemoveAll(); // Unregister for VS Events ErrorListHelper.UnregisterForNotifications(); // dispose of our classes in reverse order than we created them if (_connectionManager != null) { _connectionManager.Dispose(); _connectionManager = null; } if (_modelChangeEventListener != null) { _modelChangeEventListener.Dispose(); _modelChangeEventListener = null; } if (_documentFrameMgr != null) { _documentFrameMgr.Dispose(); _documentFrameMgr = null; } _modelManager.Dispose(); #if (VS11) // UnSubscribe from the SQL CE upgrade service var sqlCeUpgradeService = GetGlobalService(typeof(IVsSqlCeUpgradeService)) as IVsSqlCeUpgradeService; if (sqlCeUpgradeService != null) { sqlCeUpgradeService.OnUpgradeProject -= EdmUtils.SqlCeUpgradeService_OnUpgradeProject; } #endif // UnSubscribe from the SqlDatabaseFile upgrade service var sqlDatabaseFileUpgradeService = GetGlobalService(typeof(IVsSqlDatabaseFileUpgradeService)) as IVsSqlDatabaseFileUpgradeService; if (sqlDatabaseFileUpgradeService != null) { sqlDatabaseFileUpgradeService.OnUpgradeProject -= EdmUtils.SqlDatabaseFileUpgradeService_OnUpgradeProject; } // clear out any static references PackageManager.Package = null; Services.ServiceProvider = null; _dispatcher = null; } finally { base.Dispose(disposing); } }
private void OnExplorer() { var explorerWindow = new ExplorerWindow(); explorerWindow.Show(); }
public void Refresh_Clicked(object sender, MouseEventArgs e) { ExplorerWindow.Refresh(); }
public WindowChecker(ILogWriter logWriter) { FileName_EXPLORER = ExplorerWindow.ExplorerFullName(); _logWriter = logWriter ?? throw new ArgumentNullException(nameof(logWriter)); }
private void startbutton_Click(object sender, RoutedEventArgs e) { IEnumerable <CollectorNode> _selectedCollectors = FileManager.GetSelectedCollectors(Collectors); if (!_selectedCollectors.Any() && !FileManager.Configuration.Options.DisableSearch) { MessageBox.Show("Please select at least one provider for images.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); return; } GC.Collect(); //GC.WaitForPendingFinalizers(); ExplorerWindow _fileExplorer = new ExplorerWindow(this); ExplorerWindowViewModel _fileExplorerVM = new ExplorerWindowViewModel(); _fileExplorer.DataContext = _fileExplorerVM; _fileExplorerVM.SelectPath(FileManager.Configuration.Options.LastSelectedFolder); bool?_res = _fileExplorer.ShowDialog(); StartActionType _actionType = _fileExplorer.StartActionType; if (_res.HasValue && _res.Value) { switch (_actionType) { case StartActionType.Process: case StartActionType.ProcessAutomatic: case StartActionType.ProcessSemiautomatic: case StartActionType.ProcessFeelingLucky: case StartActionType.GenerateRandomThumbs: switch (_actionType) { case StartActionType.Process: FileManager.Mode = ProcessingMode.Manual; break; case StartActionType.ProcessSemiautomatic: FileManager.Mode = ProcessingMode.SemiAutomatic; break; case StartActionType.ProcessAutomatic: FileManager.Mode = ProcessingMode.Automatic; break; case StartActionType.ProcessFeelingLucky: FileManager.Mode = ProcessingMode.FeelingLucky; break; } dcMovies.IsEnabled = false; TheRibbon.IsEnabled = false; try { IList <string> list = _fileExplorerVM.CollectSelectedFolders(); UpdateConfigurationData(); _fileExplorerVM.Dispose(); _fileExplorer.Close(); _fileExplorer = null; GC.Collect(); if (list.Count != 0) { FileManager.ProcessMovies(_selectedCollectors as ObservableCollection <CollectorNode>, this, list, _actionType); } else { System.Windows.MessageBox.Show("Nothing selected, nothing to do...", "Information", MessageBoxButton.OK, MessageBoxImage.Information); return; } } finally { dcMovies.IsEnabled = true; TheRibbon.IsEnabled = true; } break; case StartActionType.FixNetworkShares: case StartActionType.UnfixNetworkShares: case StartActionType.UpdateMoviesheetsTemplate: case StartActionType.CreatePlaylist: case StartActionType.GenerateDummyFile: _fileExplorer.Close(); _fileExplorer = null; GC.Collect(); IList <string> list2 = _fileExplorerVM.CollectSelectedFolders(); if (list2.Count != 0) { FileManager.ProcessMovies(_selectedCollectors as ObservableCollection <CollectorNode>, this, list2, _actionType); } else { System.Windows.MessageBox.Show("Nothing selected, nothing to do...", "Information", MessageBoxButton.OK, MessageBoxImage.Information); return; } break; } } }