public AddFolderPathVM(IWinSimple win) { _callingWin = win; CommandExit = new CommandRelay(commandExitExecute, p => true); CommandSave = new CommandRelay(commandSaveExecute, commandSaveCanExecute); CommandAdd = new CommandRelay(commandAddExecute, commandAddCanExecute); CommandRemove = new CommandRelay(commandRemoveExecute, commandRemoveCanExecute); CommandSelectFolder = new CommandRelay(commandSelectFolderExecute, p => true); string path = Constants.FOLDERS_FILE_PATH; IList<PathItem> folders = null; ; try { folders = DataService.ParseFolderFile(path); } catch (Exception ex) { string message = String.Format((string) Resources.GlobalHelper_ParseFolderFile_Error_Text, path, ex.Message); MessageBox.Show(message, Resources.GlobalHelper_ParseFolderFile_Error_Title, MessageBoxButton.OK, MessageBoxImage.Exclamation); } _pathList = folders != null ? new ObservableCollection<PathItem>(folders) : new ObservableCollection<PathItem>(); ListChanged = false; }
public MainWindowVM(IWinSimple win, RecentFileList recentFileList) { _layoutFileName = Path.Combine(AppDataDirectoryPath, Assembly.GetEntryAssembly().GetName().Name + ".ColLayout"); _callingWin = win; _workspace = new LogAnalysisWorkspace(); YalvRegistry.Instance.SetActualLogAnalysisWorkspace(_workspace); _yalvLogViewModel = new YalvViewModel(); CommandCancelProcessing = YalvLogViewModel.CommandCancelProcessing; if (CreateAppDataDir()) { _yalvLogViewModel.LogEntryRows.LoadColumnsLayout(_layoutFileName); } RecentFileList = recentFileList; CommandExit = new RelayCommand <object>((p) => CommandExitExecute(p), p => true); CommandOpenFile = new RelayCommand <object>((p) => CommandOpenFileExecute(p), CommandOpenFileCanExecute); CommandExport = new RelayCommand <object>((p) => CommandExportExecute(p), p => true); CommandOpenSqliteDatabase = new RelayCommand <object>((p) => CommandOpenSqliteDatabaseExecute(p), p => true); CommandOpenLogAnalysisSession = new RelayCommand <object>((p) => CommandOpenLogAnalysisSessionExecute(p), p => true); }
public AddFolderPathVM(IWinSimple win) { _callingWin = win; CommandExit = new CommandRelay(commandExitExecute, p => true); CommandSave = new CommandRelay(commandSaveExecute, commandSaveCanExecute); CommandAdd = new CommandRelay(commandAddExecute, commandAddCanExecute); CommandRemove = new CommandRelay(commandRemoveExecute, commandRemoveCanExecute); CommandSelectFolder = new CommandRelay(commandSelectFolderExecute, p => true); string path = Constants.FOLDERS_FILE_PATH; IList <PathItem> folders = null; ; try { folders = DataService.ParseFolderFile(path); } catch (Exception ex) { string message = String.Format((string)Resources.GlobalHelper_ParseFolderFile_Error_Text, path, ex.Message); MessageBox.Show(message, Resources.GlobalHelper_ParseFolderFile_Error_Title, MessageBoxButton.OK, MessageBoxImage.Exclamation); } _pathList = folders != null ? new ObservableCollection <PathItem>(folders) : new ObservableCollection <PathItem>(); ListChanged = false; }
public AddFolderPathVM(IWinSimple win) { _callingWin = win; CommandExit = new CommandRelay(commandExitExecute, p => true); CommandSave = new CommandRelay(commandSaveExecute, commandSaveCanExecute); CommandAdd = new CommandRelay(commandAddExecute, commandAddCanExecute); CommandRemove = new CommandRelay(commandRemoveExecute, commandRemoveCanExecute); CommandSelectFolder = new CommandRelay(commandSelectFolderExecute, p => true); IList <PathItem> folders = GlobalHelper.ParseFolderFile(GlobalHelper.FOLDERS_FILE_PATH); _pathList = folders != null ? new ObservableCollection <PathItem>(folders) : new ObservableCollection <PathItem>(); ListChanged = false; }
public MainWindowVM(IWinSimple win) { _callingWin = win; CommandExit = new CommandRelay(commandExitExecute, p => true); CommandOpenFile = new CommandRelay(commandOpenFileExecute, commandOpenFileCanExecute); CommandSelectFolder = new CommandRelay(commandSelectFolderExecute, commandSelectFolderCanExecute); CommandSaveFolder = new CommandRelay(commandSaveFolderExecute, commandSaveFolderCanExecute); CommandRefresh = new CommandRelay(commandRefreshExecute, commandRefreshCanExecute); CommandRefreshFiles = new CommandRelay(commandRefreshFilesExecute, commandRefreshFilesCanExecute); CommandClear = new CommandRelay(commandClearExecute, commandClearCanExecute); CommandDelete = new CommandRelay(commandDeleteExecute, commandDeleteCanExecute); CommandOpenSelectedFolder = new CommandRelay(commandOpenSelectedFolderExecute, commandOpenSelectedFolderCanExecute); CommandSelectAllFiles = new CommandRelay(commandSelectAllFilesExecute, commandSelectAllFilesCanExecute); CommandIncreaseInterval = new CommandRelay(commandIncreaseIntervalExecute, p => true); CommandDecreaseInterval = new CommandRelay(commandDecreaseIntervalExecute, p => true); CommandAbout = new CommandRelay(commandAboutExecute, p => true); FileList = new ObservableCollection<FileItem>(); Items = new ObservableCollection<LogItem>(); loadFolderList(); SelectedFile = null; IsFileSelectionEnabled = false; IsLoading = false; _selectAll = true; _selectDebug = _selectInfo = _selectWarn = _selectError = _selectFatal = false; _showLevelDebug = _showLevelInfo = _showLevelWarn = _showLevelError = _showLevelFatal = true; bkLoader = new BackgroundWorker(); bkLoader.WorkerSupportsCancellation = true; bkLoader.DoWork += bkLoaderRun; bkLoader.RunWorkerCompleted += bkLoaderCompleted; _dispatcherTimer = new DispatcherTimer(); _dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); AutoRefreshInterval = Constants.DEFAULT_REFRESH_INTERVAL; IsAutoRefreshEnabled = false; refreshWindowTitle(); }
public static IMainWindowVM CreateMainViewModel(IWinSimple win, RecentFileList recentFileList) { return(new MainWindowVM(win, recentFileList)); }
public AddFolderPathVM(IWinSimple win) : this(win, new PathItemService()) { }