private void InitializeSqm() { this.sqmCommandHandler = new SonarLintSqmCommandTarget(); // Initialize SQM, can be initialized from multiple places (will no-op once initialized) SonarLintSqmFacade.Initialize(this); }
private void InitializeSqm() { this.sqmCommandHandler = new SonarLintSqmCommandTarget(); // Initialize SQM, can be initialized from multiple places (will no-op once initialized) SonarLintSqmFacade.Initialize(this); }
int IOleCommandTarget.Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) { Debug.Assert(this.sqmCommandHandler != null, "SQM handler should not be null"); // Delegate to SQM handler if commandIds are in SQM range. if (SonarLintSqmCommandTarget.IsSqmCommand(pguidCmdGroup, (int)nCmdID)) { return(this.sqmCommandHandler.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut)); } // Otherwise delegate to the package's default implementation. IOleCommandTarget target = this.GetService(typeof(IOleCommandTarget)) as IOleCommandTarget; if (target != null) { return(target.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut)); } return((int)OLEConstants.OLECMDERR_E_NOTSUPPORTED); }