Ejemplo n.º 1
0
        public FolderDataSourceViewModel(IFolderDataSource folder,
                                         IActionCenter actionCenter,
                                         IApplicationSettings applicationSettings)
            : base(folder, actionCenter, applicationSettings)
        {
            _dataSource = folder;
            var path = folder.LogFileFolderPath;

            if (!string.IsNullOrEmpty(path))
            {
                _displayName = Path.GetFileName(path);
            }
            _folderPath    = folder.LogFileFolderPath;
            _searchPattern = folder.LogFileSearchPattern;
            _recursive     = folder.Recursive;

            _actionCenter = actionCenter;
            _settings     = applicationSettings;
            _dataSourceViewModelsByDataSource = new Dictionary <IDataSource, IDataSourceViewModel>();
            _dataSourceViewModels             = new ObservableCollection <IDataSourceViewModel>();

            AddFileMenuItems(new []
            {
                new CommandMenuViewModel(new DelegateCommand2(OpenInExplorer))
                {
                    Header  = "Open Containing Folder",
                    ToolTip = "Opens the Folder being watched in Windows Explorer"
                }
            });
            SetContextMenuItems(new IMenuViewModel[] { new IncludeAllInGroupViewModel(this), new ExcludeAllInGroupViewModel(this) });

            UpdateFileReport();
        }
Ejemplo n.º 2
0
        public FolderDataSourceViewModel(IFolderDataSource folder, IActionCenter actionCenter)
            : base(folder)
        {
            _dataSource = folder;
            var path = folder.LogFileFolderPath;

            if (!string.IsNullOrEmpty(path))
            {
                _displayName = Path.GetFileName(path);
            }
            _folderPath    = folder.LogFileFolderPath;
            _searchPattern = folder.LogFileSearchPattern;
            _recursive     = folder.Recursive;

            _actionCenter = actionCenter;
            _dataSourceViewModelsByDataSource = new Dictionary <IDataSource, IDataSourceViewModel>();
            _dataSourceViewModels             = new ObservableCollection <IDataSourceViewModel>();

            UpdateFileReport();
        }
 private FolderDataSourceViewModel CreateFolderViewModel(IFolderDataSource dataSource)
 {
     return(new FolderDataSourceViewModel(dataSource, _actionCenter.Object, _applicationSettings.Object));
 }