Ejemplo n.º 1
0
        public bool Build(IEnumerable <string> projects)
        {
            bool state = true;

            if (!SolutionStateHandler.IsDirty)
            {
                return(true);
            }
            prepareOutputPath();
            foreach (var project in projects)
            {
                if (project == null)
                {
                    continue;
                }
                _application.Solution.SolutionBuild.BuildProject(
                    getProjectConfiguration(project),
                    project,
                    true);
                state = _application.Solution.SolutionBuild.LastBuildInfo == 0;
                if (!state)
                {
                    break;
                }
            }
            if (state)
            {
                SolutionStateHandler.Reset();
            }
            return(state);
        }
Ejemplo n.º 2
0
        public bool Build()
        {
            if (!SolutionStateHandler.IsDirty)
            {
                return(true);
            }
            prepareOutputPath();
            _notify(new RunStartedMessage(new[] { new ChangedFile(Path.GetFileName(_application.Solution.FullName)) }));
            _application.Solution.SolutionBuild.Build(true);
            var state = _application.Solution.SolutionBuild.LastBuildInfo == 0;

            if (state)
            {
                SolutionStateHandler.Reset();
            }

            return(state);
        }
Ejemplo n.º 3
0
        /// <summary>Implements the OnConnection method of theIDTExtensibility2 interface. Receives notification that the Add-in isbeing loaded.</summary>
        /// <param term='application'>Root object of the hostapplication.</param>
        /// <param term='connectMode'>Describes how the Add-in isbeing loaded.</param>
        /// <param term='addInInst'>Object representing this Add-in.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
        {
            try
            {
                Logger.SetListener(new FileLogger());

                Logger.Write("Connecting to Visual Studio");
                _applicationObject = (DTE2)application;
                StartupHandler.SetApplication(_applicationObject);
                setupListener();
                bindWorkspaceEvents();
                SolutionStateHandler.BindEvents(_applicationObject);
                SaverOfFilesThatVSKeepsStashigInMem.BindEvents(_applicationObject);
                _addInInstance = (AddIn)addInInst;

                Logger.Write("Adding menu item");
                RegisterCommandHandlers();
                if (connectMode == ext_ConnectMode.ext_cm_UISetup || theShitIsNotThere())
                {
                    if (connectMode == ext_ConnectMode.ext_cm_UISetup)
                    {
                        Analytics.SendEvent("UI_SETUP");
                    }
                    else
                    {
                        Analytics.SendEvent("UI_SETUP_MANUAL");
                    }
                    AddMenuItems();
                    Logger.Write("Menu item added");
                    _initializedMenu = true;
                }
                AddContextMenue();
            }
            catch (Exception ex)
            {
                Logger.Write("OnConnect " + ex);
            }
        }