示例#1
0
        private void osbideCommandBarEvent_Click(object CommandBarControl, ref bool Handled, ref bool CancelDefault)
        {
            ErrorListItem listItem = new ErrorListItem();
            DTE2          dte      = (DTE2)this.GetService(typeof(SDTE));

            if (dte != null)
            {
                Array selectedItems = (Array)dte.ToolWindows.ErrorList.SelectedItems;
                if (selectedItems != null)
                {
                    foreach (ErrorItem item in selectedItems)
                    {
                        listItem = ErrorListItem.FromErrorItem(item);
                    }
                }
            }

            if (string.IsNullOrEmpty(listItem.CriticalErrorName) == false)
            {
                string url = string.Format("{0}?errorTypeStr={1}&component={2}", StringConstants.ActivityFeedUrl, listItem.CriticalErrorName, OsbideVsComponent.FeedOverview);
                OpenActivityFeedWindow(url);
            }
            else
            {
                MessageBox.Show("OSBIDE only supports search for errors");
            }
        }
示例#2
0
        public override void OnBuildDone(vsBuildScope Scope, vsBuildAction Action)
        {
            base.OnBuildDone(Scope, Action);

            //this might take a while, so throw it in its own thread
            //System.Threading.Tasks.Task.Factory.StartNew(
            //    () =>
            //    {
            BuildEvent    build           = new BuildEvent();
            List <string> filesWithErrors = new List <string>();

            build.SolutionName = dte.Solution.FullName;
            build.EventDate    = DateTime.UtcNow;

            //start at 1 when iterating through Error List
            for (int i = 1; i <= dte.ToolWindows.ErrorList.ErrorItems.Count; i++)
            {
                ErrorItem item = dte.ToolWindows.ErrorList.ErrorItems.Item(i);
                BuildEventErrorListItem beli = new BuildEventErrorListItem();
                beli.BuildEvent    = build;
                beli.ErrorListItem = ErrorListItem.FromErrorItem(item);

                //only worry about critical errors
                if (beli.ErrorListItem.CriticalErrorName.Length > 0)
                {
                    build.ErrorItems.Add(beli);

                    //add the file with the error to our list of items that have errors
                    if (filesWithErrors.Contains(beli.ErrorListItem.File.ToLower()) == false)
                    {
                        filesWithErrors.Add(beli.ErrorListItem.File.ToLower());
                    }
                }
            }

            //add in breakpoint information
            for (int i = 1; i <= dte.Debugger.Breakpoints.Count; i++)
            {
                BreakPoint           bp   = new BreakPoint(dte.Debugger.Breakpoints.Item(i));
                BuildEventBreakPoint bebp = new BuildEventBreakPoint();
                bebp.BreakPoint = bp;
                bebp.BuildEvent = build;
                build.Breakpoints.Add(bebp);
            }

            //get all files in the solution
            List <CodeDocument> files = build.GetSolutionFiles(dte.Solution);

            //add in associated documents
            foreach (CodeDocument file in files)
            {
                BuildDocument bd = new BuildDocument();
                bd.Build    = build;
                bd.Document = file;
                build.Documents.Add(bd);
            }

            byte[] data = EventFactory.ToZippedBinary(build);

            //let others know that we have created a new event
            NotifyEventCreated(this, new EventCreatedArgs(build));
            //}
            //);
        }