/////////////////////////////////////////////////////////////////////////////
        // 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();

            var langService = new DjangoLanguageInfo(this);

            ((IServiceContainer)this).AddService(langService.GetType(), langService, true);

            //Create Editor Factory. Note that the base Package class will call Dispose on it.
            RegisterEditorFactory(new DjangoEditorFactory(this));
#if !DEV12_OR_LATER
            RegisterEditorFactory(new DjangoEditorFactoryPromptForEncoding(this));
#endif
            RegisterProjectFactory(new DjangoProjectFactory(this));

            // 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.guidDjangoCmdSet, (int)PkgCmdIDList.cmdidGotoTemplateSource);
                MenuCommand menuItem      = new MenuCommand(GotoTemplateSourceCode, menuCommandID);
                mcs.AddCommand(menuItem);
            }
        }
Exemple #2
0
        /////////////////////////////////////////////////////////////////////////////
        // 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();

            var langService = new DjangoLanguageInfo(this);
            ((IServiceContainer)this).AddService(langService.GetType(), langService, true);

            //Create Editor Factory. Note that the base Package class will call Dispose on it.
            RegisterEditorFactory(new DjangoEditorFactory(this));
            RegisterProjectFactory(new DjangoProjectFactory(this));
            
            // 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.guidDjangoCmdSet, (int)PkgCmdIDList.cmdidGotoTemplateSource);
                MenuCommand menuItem = new MenuCommand(GotoTemplateSourceCode, menuCommandID);
                mcs.AddCommand(menuItem);
            }
        }