Ejemplo n.º 1
0
 public static void Initialize(UserInfo info)
 {
     _info = info;
 }
        /// <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 initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", ToString()));
            base.Initialize();

            // 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.guidObjectExporter_CmdSet, (int)PkgCmdIDList.cmdidExportObjects);
                var menuItem = new OleMenuCommand(MenuItemCallback, menuCommandID);

                menuItem.BeforeQueryStatus += menuItem_BeforeQueryStatus;
                mcs.AddCommand(menuItem);
            }

            //Initialize Object Exporter settings for use with Aspects (can't pass any objects into constructor)
            _packageSettings = (PackageSettings)GetDialogPage(typeof(PackageSettings));
            GlobalPackageSettings.Initialize(_packageSettings);

            //Add user information for exception handling with raygun
            UserInfo info = new UserInfo()
            {
                VisualStudioVersion = _dte2.Version
            };

            Raygun.Initialize(info);

            //Load Scintilla dependencies (SciLexer.dll)
            LoadUnmanagedLibraries();
        }