コード例 #1
0
        private void gotoView(OutlineItem item)
        {
            // get the regions

            var activeProjectItem = DTE.ActiveDocument.ProjectItem;
            var d = activeProjectItem.Document;

            var vp = new ViewParser();

            var viewTask = vp.GetViews(d, item.StartLineOfCode, item.StartLineOfCodeOffset, item.EndLineOfCode);

            viewTask.Wait();

            var views = viewTask.Result;

            vp.FindView(activeProjectItem, views);
        }
コード例 #2
0
        private void UpdateViewItems(object src, UpdateViewsEventArgs args)
        {
            // get the regions
            var item = src as OutlineItem;

            if (item == null)
            {
                return;
            }

            var activeProjectItem = item.ProjectItem;
            var d = activeProjectItem.Document;

            if (d == null)
            {
                Debug.WriteLine("No Document found for the selected item");
                return;
            }
            var c  = new RegionParser();
            var vp = new ViewParser();

            var viewTask = vp.GetViews(d, item.StartLineOfCode, item.StartLineOfCodeOffset, item.EndLineOfCode);

            viewTask.Wait();

            var views = viewTask.Result;

            if (views == null)
            {
                return;
            }

            vp.FindView(activeProjectItem, views);

            item.AddViews(views.Select(
                              x =>
                              new OutlineItem.ViewReference()
            {
                CodeElement = x.CodeElement,

                ViewTypeName = x.TypeName
            }));
        }