AttachToAnything.AttachToAnythingPackage.Initialize C# (CSharp) Method

Initialize() protected method

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 initialization code that rely on services provided by VisualStudio.
protected Initialize ( ) : void
return void
        protected override void Initialize()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this));
            base.Initialize();

            var logger = new DiagnosticLogger("AttachToAnything");

            var optionsPage = (AttachTargetOptionPage)GetDialogPage(typeof(AttachTargetOptionPage));
            _controller = new AttachToAnythingController(this, (DTE)GetService(typeof(DTE)), optionsPage, new ProcessWaitSource(logger), logger);

            // Add our command handlers for menu (commands must exist in the .vsct file)
            var menuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (null == menuCommandService)
                return;

            SetupAttachCommand(menuCommandService);
            SetupOptionsCommand(menuCommandService);
        }