Exemplo n.º 1
0
        public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            commandInfo = new CommandInfo
            {
                CommandGroup = pguidCmdGroup,
                CommandId = nCmdID,
                ExecOpt = nCmdexecopt,
                PvaIn = pvaIn,
                PvaOut = pvaOut,
            };

            if (VsShellUtilities.IsInAutomationFunction(provider.ServiceProvider))
                return PassCommandAlong();

            if (IsCommitCharacter && IsSelection)
            {
                if (IsFullySelected)
                {
                    session.Commit();
                    return VSConstants.S_OK;
                }
                session.Dismiss();
            }

            var retVal = PassCommandAlong();
            var handled = false;
            if (!TypedCharacter.Equals(char.MinValue) && char.IsLetterOrDigit(TypedCharacter))
            {
                if (NoActiveSession)
                    TriggerCompletion();

                session.Filter();
                handled = true;
            }
            else if (IsDeletionCharacter)
            {
                if (IsSelection)
                    session.Filter();
                handled = true;
            }
            return handled ? VSConstants.S_OK : retVal;
        }
Exemplo n.º 2
0
 void SetUpCommandInfo(Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 {
     CommandInfo = new CommandInfo
     {
         CommandGroup = pguidCmdGroup,
         CommandId = nCmdID,
         ExecOpt = nCmdexecopt,
         PvaIn = pvaIn,
         PvaOut = pvaOut,
     };
 }