/// <summary> /// Initializes the policy. /// </summary> /// <param name="pendingCheckin">The <see cref="IPendingCheckin"/> to use during initialization.</param> public override void Initialize(IPendingCheckin pendingCheckin) { if (pendingCheckin == null) { ThrowHelper.ThrowArgumentNullException("pendingCheckin"); } // Get the reference to the VS ide. dte = (DTE)pendingCheckin.GetService(typeof(DTE)); if (taskProvider != null) { // Initialize zo clear the taskprovider. taskProvider.Clear(); } else { if (dte != null && dte.Application != null) { taskProvider = new ViolationTaskProvider( new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)dte.Application), this.Settings); } } base.Initialize(pendingCheckin); }
public override void Initialize(IPendingCheckin pendingCheckin) { if (this._taskProvider != null) { this._taskProvider.Clear(); } else { _DTE dte = (_DTE)pendingCheckin.GetService(typeof(_DTE)); if (dte != null && dte.Application != null) { this._taskProvider = new ViolationTaskProvider(new ServiceProvider((IServiceProvider)dte.Application)); } } base.Initialize(pendingCheckin); }