private void AddRecentScript(string filePath) { settingsManager.Settings.AddRecentScript(filePath); RecentScripts.Clear(); RecentScripts.AddRange(ListRecentFiles()); NotifyOfPropertyChange(() => CanOpenRecentScript); }
void OnRecentFilesChanged() { lock (synchObject) { if (this.ExecuteInGUIThread == null) { return; } string[] lines = null; try { lines = File.ReadAllLines(RecentFilesHelper.RecentFilesHistoryFile); this.ExecuteInGUIThread(() => { try { RecentScripts.Clear(); foreach (RecentScript script in RecentFilesHelper.Instance.GetRecentFiles()) { RecentScripts.Add(script); } } catch (Exception) { // throw; } }); } catch (Exception e) { Trace.WriteLine(e.Message); } //if (lines == null || RecentScripts.Count != lines.Length) // System.Diagnostics.Debug.Assert(false, "Recent file misreading"); } }
private void AddRecentScript(string filePath) { settingsManager.Settings.AddRecentScript(filePath); RecentScripts.Clear(); RecentScripts.AddRange(ListRecentFiles()); }