private void onGoToDef(object sender, RoutedEventArgs e)
        {
            MenuItem     item = sender as MenuItem;
            ContextMenu  menu = item.CommandParameter as ContextMenu;
            FunctionInfo fi   = (menu.PlacementTarget as StackPanel).Tag as FunctionInfo;

            if (fi != null)
            {
                IDEView.inst().ideTabs.OpenFile(new FileLeafItem {
                    Path = fi.SourceFile,
                    Name = System.IO.Path.GetFileName(fi.SourceFile)
                }, fi.SourceLine);
            }
            PropInfo pi = (menu.PlacementTarget as StackPanel).Tag as PropInfo;

            if (pi != null)
            {
                IDEView.inst().ideTabs.OpenFile(new FileLeafItem
                {
                    Path = pi.SourceFile,
                    Name = System.IO.Path.GetFileName(pi.SourceFile)
                }, pi.SourceLine);
            }
            TypeInfo ti = (menu.PlacementTarget as StackPanel).Tag as TypeInfo;

            if (ti != null)
            {
                IDEView.inst().ideTabs.OpenFile(new FileLeafItem
                {
                    Path = ti.SourceFile,
                    Name = System.IO.Path.GetFileName(ti.SourceFile)
                }, ti.SourceLine);
            }
        }
예제 #2
0
        public static void doSearch(string text, string path)
        {
            IDEView.inst().SearchResults.Clear();
            if (text.Trim().Length == 0)
            {
                return;
            }
            if (text.Contains(' '))
            {
                text = "\"" + text + "\"";
            }

            Thread thread = new Thread(delegate() {
                FileSearch search = new FileSearch(IDEView.inst().Dispatcher, IDEView.inst().SearchResults);
                search.ScanFolder(path, new string[] { text }, true);
            });

            thread.Start();
        }