Example #1
0
 private void AddRecentScript(string filePath)
 {
     settingsManager.Settings.AddRecentScript(filePath);
     RecentScripts.Clear();
     RecentScripts.AddRange(ListRecentFiles());
     NotifyOfPropertyChange(() => CanOpenRecentScript);
 }
Example #2
0
        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");
            }
        }
Example #3
0
 private void AddRecentScript(string filePath)
 {
     settingsManager.Settings.AddRecentScript(filePath);
     RecentScripts.Clear();
     RecentScripts.AddRange(ListRecentFiles());
 }