Example #1
0
        private void ValidateIndex(bool force)
        {
            //Index = null;
            var sln     = GetService(typeof(SVsSolution)) as IVsSolution;
            var slnName = SolutionIndex.GetSlnFileName(sln);

            if (slnName == null)
            {
                Index = null;
                return;
            }

            if (Index == null || !Index.SolutionName.Equals(slnName, StringComparison.OrdinalIgnoreCase))
            {
                Index             = new SolutionIndex(slnName);
                textBoxQuery.Text = "";
                Found             = new List <ItemInfo>();

                var cacheLoaded = !force && Index.LoadFromCache();
                if (!cacheLoaded)
                {
                    ReindexWorker(sln);
                }
                else
                {
                    // Lazy reindex
                    var t = new System.Timers.Timer(3000)
                    {
                        AutoReset = false
                    };
                    t.Elapsed += (s, e) => BeginInvoke(new Action(() => ReindexWorker(sln)));
                    t.Start();
                }
            }
            listViewResults.SmallImageList = Index.IconCache.ImageList;
        }
Example #2
0
        private void ValidateIndex(bool force)
        {
            //Index = null;
            var sln = GetService(typeof(SVsSolution)) as IVsSolution;
            var slnName = SolutionIndex.GetSlnFileName(sln);

            if (slnName == null) {
                Index = null;
                return;
            }

            if (Index == null || !Index.SolutionName.Equals(slnName, StringComparison.OrdinalIgnoreCase)) {
                Index = new SolutionIndex(slnName);
                textBoxQuery.Text = "";
                Found = new List<ItemInfo>();

                var cacheLoaded = !force && Index.LoadFromCache();
                if (!cacheLoaded) {
                    ReindexWorker(sln);
                } else {
                    // Lazy reindex
                    var t = new System.Timers.Timer(3000) { AutoReset = false };
                    t.Elapsed += (s, e) => BeginInvoke(new Action(() => ReindexWorker(sln)));
                    t.Start();
                }
            }
            listViewResults.SmallImageList = Index.IconCache.ImageList;
        }
Example #3
0
 private void reindexToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Index = null;
     ValidateIndex(true);
     textBoxQuery_TextChanged(this, EventArgs.Empty);
 }
Example #4
0
 private void reindexToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Index = null;
     ValidateIndex(true);
     textBoxQuery_TextChanged(this, EventArgs.Empty);
 }