Example #1
0
        private void AnalyzeProject()
        {
            ts.TraceInformation("AnalyzeProject");

            try
            {
                Solution solution = _applicationObject.Solution;
                Array    projects = (Array)_applicationObject.ActiveSolutionProjects;
                if (projects.Length > 0)
                {
                    Project   project   = (Project)projects.GetValue(0);
                    VCProject vcProject = project.Object as VCProject;
                    if (vcProject != null)
                    {
                        ClangAnalyzer.AnalyzeProject(solution, vcProject);
                    }
                    else
                    {
                        ts.TraceInformation("AnalyzeProject not a vc project: " + project.Name);
                    }
                }
            }

            catch (Exception exception)
            {
                ts.TraceData(TraceEventType.Error, 1, "AnalyzeProject exception: " + exception.Message);
                MessageBox.Show(exception.Message, _addInName + " System Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void AnalyzeProjectStartup()
        {
            ts.TraceInformation("AnalyzeProjectStartup");

            try
            {
                Solution  solution  = _applicationObject.Solution;
                VCProject vcProject = DTE2Utils.GetVcProjectStartup(solution);
                if (vcProject == null)
                {
                    ts.TraceInformation("AnalyzeProjectStartup cannot get startup vc project from solution");
                    return;
                }

                ClangAnalyzer.AnalyzeProject(solution, vcProject);
            }
            catch (Exception exception)
            {
                ts.TraceData(TraceEventType.Error, 1, "AnalyzeProjectStartup exception: " + exception.Message);
                MessageBox.Show(exception.Message, _addInName + " System Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }