/// <summary>
        /// Load configuration from a given file, or use (and store) default settings if the file can not be loaded.
        /// </summary>
        /// <param name="filename">name of the configuration file to load</param>
        /// <returns>loaded configuration</returns>
        public static SimpleTIckleCheckerConfiguration LoadOrDefaultSettings(string filename)
        {
            SimpleTIckleCheckerConfiguration settings = null;

            try
            {
                var x      = new XmlSerializer(typeof(SimpleTIckleCheckerConfiguration));
                var reader = new StreamReader(filename);
                settings = (SimpleTIckleCheckerConfiguration)x.Deserialize(reader);
            }
            catch (Exception ex)
            {
                Logger.Error(ex, $"Caught exception when trying to read xml: {ex.Message}");
            }

            if (settings == null)
            {
                if (File.Exists(filename))
                {
                    File.Move(filename, $"{filename}-{DateTime.Now.ToString("yyyy_MM_dd-HH_mm_ss")}.bak");
                }

                settings = new SimpleTIckleCheckerConfiguration(DefaultSettings);
                settings.StoreToFile(filename);
            }

            return(settings);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="window">assigned m_window for this vm</param>
        public MainWindowViewModel(MainWindow window)
        {
            m_settings = SimpleTIckleCheckerConfiguration.LoadOrDefaultSettings(Resources.ConfigFilename);

            m_tickleFolder = new TickleFolder(m_settings.TicklePath);

            //var today = DateTime.Now;
            //ActiveTicklers = new ObservableCollection<TickleElementViewModel>(m_tickleFolder.Elements.Where(e => e.TickleDate <= today).Select(te => new TickleElementViewModel(te)));
            //WaitingTicklers = new ObservableCollection<TickleElementViewModel>(m_tickleFolder.Elements.Where(e => e.TickleDate > today).Select(te => new TickleElementViewModel(te)));
            UpdateTickles();
        }
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="orig">original configuration to copy</param>
 public SimpleTIckleCheckerConfiguration(SimpleTIckleCheckerConfiguration orig)
 {
     TicklePath        = orig.TicklePath;
     DefaultMoveToPath = orig.DefaultMoveToPath;
 }