/// <summary>
        /// should be called from derived class since registering task list will call us back to enumerate existing task items.
        /// </summary>
        protected void InitializeTaskList()
        {
            _tasklist = ServiceProvider.GetService(typeof(SVsTaskList)) as IVsTaskList3;

            Contract.ThrowIfNull(_tasklist);
            Contract.ThrowIfNull(_tasklist as IVsTaskList); // IVsTaskList3 doesn't implement IVsTaskList.
            Contract.ThrowIfFalse(((IVsTaskList)_tasklist).RegisterTaskProvider(this, out _providerCookie) == VSConstants.S_OK);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// should be called from derived class since registering task list will call us back to enumerate existing task items.
        /// </summary>
        protected void InitializeTaskList()
        {
            _tasklist = ServiceProvider.GetService(typeof(SVsTaskList)) as IVsTaskList3;

            Contract.ThrowIfNull(_tasklist);
            Contract.ThrowIfNull(_tasklist as IVsTaskList); // IVsTaskList3 doesn't implement IVsTaskList.
            Contract.ThrowIfFalse(((IVsTaskList)_tasklist).RegisterTaskProvider(this, out _providerCookie) == VSConstants.S_OK);
        }