コード例 #1
0
        private void LoadEntriesFromSettings(ISettings settings)
        {
            fileEntries.Clear();

            string prefix = Environment.Version.Major >= 2
                                ? "RecentProjects.V2"
                                : "RecentProjects.V1";

            for (int index = 1; index <= MaxFiles; index++)
            {
                string fileSpec = settings.GetSetting(GetRecentFileKey(prefix, index)) as string;
                if (fileSpec != null)
                {
                    fileEntries.Add(new RecentFileEntry(fileSpec));
                }
            }

            // Try legacy entries if nothing was found
            if (fileEntries.Count == 0)
            {
                for (int index = 1; index <= MaxFiles; index++)
                {
                    string fileSpec = settings.GetSetting(GetRecentFileKey("RecentProjects", index)) as string;
                    if (fileSpec != null)
                    {
                        RecentFileEntry entry = RecentFileEntry.Parse(fileSpec);
                        if (entry.CLRVersion.Major <= Environment.Version.Major)
                        {
                            fileEntries.Add(entry);
                        }
                    }
                }
            }
            ;
        }
コード例 #2
0
		public void SetMostRecent( RecentFileEntry entry )
		{
			int index = fileEntries.IndexOf(entry.Path);

			if(index != -1)
				fileEntries.RemoveAt(index);

			fileEntries.Insert( 0, entry );
			if( fileEntries.Count > MaxFiles )
				fileEntries.RemoveAt( MaxFiles );
		}
コード例 #3
0
        public void SetMostRecent(RecentFileEntry entry)
        {
            int index = fileEntries.IndexOf(entry.Path);

            if (index != -1)
            {
                fileEntries.RemoveAt(index);
            }

            fileEntries.Insert(0, entry);
            if (fileEntries.Count > MaxFiles)
            {
                fileEntries.RemoveAt(MaxFiles);
            }
        }
コード例 #4
0
        private void AddEntriesForPrefix(string prefix)
        {
            for (int index = 1; index < MaxFiles; index++)
            {
                if (fileEntries.Count >= MaxFiles)
                {
                    break;
                }

                string fileSpec = settings.GetSetting(GetRecentFileKey(prefix, index)) as string;
                if (fileSpec != null)
                {
                    fileEntries.Add(RecentFileEntry.Parse(fileSpec));
                }
            }
        }
コード例 #5
0
 public void Insert(int index, RecentFileEntry entry)
 {
     InnerList.Insert(index, entry);
 }
コード例 #6
0
 public void Add(RecentFileEntry entry)
 {
     InnerList.Add(entry);
 }
コード例 #7
0
			public void SetMostRecent( RecentFileEntry entry )
			{
				files.Insert( 0, entry );
			}
コード例 #8
0
		public void Insert( int index, RecentFileEntry entry )
		{
			InnerList.Insert( index, entry );
		}
コード例 #9
0
		public void Add( RecentFileEntry entry )
		{
			InnerList.Add( entry );
		}