示例#1
0
        void ReadRecentFiles()
        {
            string file = GetConfigFile();

            recentFiles = null;

            if (File.Exists(file))
            {
                try {
                    using (StreamReader sr = new StreamReader(file)) {
                        XmlSerializer ser = new XmlSerializer(typeof(RecentFiles));
                        recentFiles = (RecentFiles)ser.Deserialize(sr);
                    }
                } catch {
                    // Ignore exceptions while reading the recents file
                }
            }

            if (recentFiles == null)
            {
                recentFiles = new RecentFiles();
            }

            BuildRecentMenu();
        }
示例#2
0
文件: UIManager.cs 项目: mono/stetic
        void ReadRecentFiles()
        {
            string file = GetConfigFile ();
            recentFiles = null;

            if (File.Exists (file)) {
                try {
                    using (StreamReader sr = new StreamReader (file)) {
                        XmlSerializer ser = new XmlSerializer (typeof (RecentFiles));
                        recentFiles = (RecentFiles) ser.Deserialize (sr);
                    }
                } catch {
                    // Ignore exceptions while reading the recents file
                }
            }

            if (recentFiles == null)
                recentFiles = new RecentFiles ();

            BuildRecentMenu ();
        }