Ejemplo n.º 1
0
        private IEnumerable <Recent> GetRecents(IVsDataSourceFactory factory)
        {
            // this can give... strange results including duplicates
            // not exactly what the menu gives - how come?!
            //
            // see also ~/AppData/Local/Microsoft/VisualStudio/.../ApplicationPrivateSettings.xml
            // which 'seems' to contain some recent stuff (and better than using the bin thing there?


            var kind = Kind.Project;

            factory.GetDataSource(
                new Guid("9099ad98-3136-4aca-a9ac-7eeeaee51dca"),
                (uint)kind,
                out IVsUIDataSource dataSource);

            var recents = GetRecents(dataSource, kind);

            if (recents.Count == 0)
            {
                return(Enumerable.Empty <Recent>());
            }
            var output = new List <Recent>();

            foreach (var recent in recents)
            {
                output.Add(new Recent {
                    Path = GetPath(recent)
                });
            }
            return(output);
        }
Ejemplo n.º 2
0
 internal RecentSource(IVsDataSourceFactory dataSourceFactory)
     : this()
 {
     _dataSourceFactory = dataSourceFactory;
 }