Beispiel #1
0
        public static void Initialize(OptionsPage optionsPage)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(GlobalExceptionHandlerEvent);

            DTE = (DTE2)SmartAttachPackage.GetGlobalService(typeof(SDTE));

            Settings = new GlobalSettings();
            Settings.Load();

            OptionsPage = optionsPage;
        }
Beispiel #2
0
        public static string[] FindSolutionDirectories(DTE2 app)
        {
            var basePaths = new List <string>();

            if (app.Solution != null)
            {
                for (var i = 1; i <= app.Solution.Projects.Count; i++)
                {
                    var projectItem = app.Solution.Projects.Item(i);
                    AddPathFromProjectItem(basePaths, projectItem);
                }

                return(basePaths.ToArray());
            }

            app.StatusBar.Text = "No solution or project is identified. app.Solution is " +
                                 (app.Solution?.GetType().Name).Or("NULL");

            App.DTE = (DTE2)SmartAttachPackage.GetGlobalService(typeof(SDTE));

            return(null);
        }