public void RunStarted(object automationObject,
          Dictionary<string, string> replacementsDictionary,
          WizardRunKind runKind, object[] customParams)
        {
            _dte = automationObject as EnvDTE80.DTE2;
            _runKind = runKind;

            if(runKind.HasFlag(WizardRunKind.AsNewProject))
            {
                _solutionDir = replacementsDictionary["$solutiondirectory$"];
                _destinationDirectory = replacementsDictionary["$destinationdirectory$"];           
            }         

            try
            {
                // Display a form to the user. The form collects 
                // input for the custom message.
                //inputForm = new UserInputForm();
                //inputForm.ShowDialog();

                //customMessage = inputForm.get_CustomMessage();

                //// Add custom parameters.
                //replacementsDictionary.Add("$custommessage$",
                //    customMessage);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            //Console.Write("Wizard!!!");
        }
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initilaization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            Trace.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            Dte = Package.GetGlobalService(typeof(EnvDTE.DTE)) as DTE2;

            // Add our command handlers for menu (commands must exist in the .vsct file)
            _attachToIIS = new AttachToIIS(Dte);
            OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if ( null != mcs )
            {
                // Create the command for the menu item.
                CommandID menuCommandID = new CommandID(GuidList.guidAlkampferVsix2010CmdSet, (int)PkgCmdIDList.cmdidAttachToIIS);
                MenuCommand menuItem = new MenuCommand(_attachToIIS.MenuItemCallback, menuCommandID);
                mcs.AddCommand( menuItem );
            }

            //Stop at first error command.
            _stopBuildAtFirstErrorCommand = new StopBuildAtFirstError(Dte);
            mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (null != mcs)
            {
                // Create the command for the menu item.
                CommandID menuCommandID = new CommandID(GuidList.guidAlkampferVsix2010CmdSet, (int)PkgCmdIDList.stopBuildAtFirstError);
                MenuCommand menuItem = new MenuCommand(_stopBuildAtFirstErrorCommand.MenuItemCallback, menuCommandID);
                _stopBuildAtFirstErrorCommand.ManageMenuItem(menuItem);
                mcs.AddCommand(menuItem);
            }
        }
        /////////////////////////////////////////////////////////////////////////////
        // Overriden Package Implementation
        #region Package Members

        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initilaization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            Trace.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            this._serviceProvider = this;
            _dte = this.GetService(typeof(DTE)) as DTE2;

            // Add our command handlers for menu (commands must exist in the .vsct file)
            OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if ( null != mcs )
            {
                // Create the command for the menu item.
                CommandID menuCommandID = new CommandID(GuidList.guidTransformTemplatesToolCmdSet, (int)PkgCmdIDList.cmdidTransformProjectsTemplates);
                //MenuCommand menuItem = new MenuCommand(MenuItemCallback, menuCommandID );
                //mcs.AddCommand( menuItem );
                CommandID menuItemID = new CommandID(GuidList.guidTransformTemplatesToolCmdSet, (int)PkgCmdIDList.cmdidTransformProjectsTemplates);
                OleMenuCommand menuItem = new OleMenuCommand(this.OnTransformSelectedExec, menuItemID);
                menuItem.BeforeQueryStatus += new EventHandler(OnTransformSelectedStatus);
                mcs.AddCommand(menuItem);
            }
        }
 public EnvironmentLocator(Environment environment)
 {
     this.environment = environment;
 }
        private void frmMain_Load(object sender, EventArgs e)
        {
            try
            {
                dte2 = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.
                GetActiveObject("VisualStudio.DTE.9.0");

                //dte3 =(EnvDTE90.Debugger3)dte2.Debugger;

                linkLabel1.Links.Add(0, 32, "mailto:[email protected]");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n" + ex.StackTrace);
            }
            finally
            {
            }
        }
Beispiel #6
0
 public SSMS(object addin_instance, string assembly_location)
 {
     _addin = (AddIn)addin_instance;
     _DTE2 = (DTE2)_addin.DTE;
     _DTE = (DTE)_addin.DTE;
     addin_location = assembly_location;
     _command_manager = new command_manager(this);
     _window_manager = new window_manager(this);
     _event_manager = new event_manager(this);
 }
Beispiel #7
0
        public static ArrayList GetProjectList(DTE dte)
        {
            ArrayList projectList = new ArrayList();

            try
            {
            if (dte.Solution.IsOpen)
            {
                foreach (Project project in dte.Solution.Projects)
                {
                    GetProjectListRecursive(ref projectList, project);
                }
            }
            }
            catch (System.Runtime.InteropServices.COMException ex)
            {

            }
            return projectList;
        }
Beispiel #8
0
 public DTE(EnvDTE80.DTE2 dte2)
 {
     _DTE = dte2;
 }
Beispiel #9
0
 public SolutionCollapser(
     [Import] DTE2 dte)
 {
     _dte = dte;
 }