public void selectLogPath(String logdir) { var dlg = new SelectLogPathWindow(logdir); bool?showDialog = dlg.ShowDialog(); if (showDialog != null && (bool)showDialog) { _logdir = dlg.Logpath; Properties.Settings.Default.logpath = _logdir.FullName; Properties.Settings.Default.Save(); SetWatcherAndStuff(); } }
public MainWindow() { InitializeComponent(); if (_logdir.Parent != null && !_logdir.Parent.Exists) { if (Properties.Settings.Default.logpath != "") { string path = Properties.Settings.Default.logpath; try { _logdir = new DirectoryInfo(path); SetWatcherAndStuff(); } catch (Exception) { MessageBox.Show("Settings file corrupted, sorry."); } } else { var dlg = new SelectLogPathWindow(); bool?showDialog = dlg.ShowDialog(); if (showDialog != null && (bool)showDialog) { _logdir = dlg.Logpath; Properties.Settings.Default.logpath = _logdir.FullName; Properties.Settings.Default.Save(); SetWatcherAndStuff(); } } } else { SetWatcherAndStuff(); } }
public MainWindow() { InitializeComponent(); if (_logdir.Parent != null && !_logdir.Parent.Exists) { if (Properties.Settings.Default.logpath != "") { string path = Properties.Settings.Default.logpath; try { _logdir = new DirectoryInfo(path); SetWatcherAndStuff(); } catch (Exception) { MessageBox.Show("Settings file corrupted, sorry."); } } else { var dlg = new SelectLogPathWindow(); bool? showDialog = dlg.ShowDialog(); if (showDialog != null && (bool) showDialog) { _logdir = dlg.Logpath; Properties.Settings.Default.logpath = _logdir.FullName; Properties.Settings.Default.Save(); SetWatcherAndStuff(); } } } else { SetWatcherAndStuff(); } }