Exemplo n.º 1
0
        public static void SetKeyBindings(this DTE2 environment, OleMenuCommand command, params object[] bindings)
        {
            var dteCommand = environment.GetCommand(command);

            if (dteCommand == null)
            {
                return;
            }

            dteCommand.Bindings = bindings;
        }
Exemplo n.º 2
0
        public static void SetKeyBindings(this DTE2 environment, OleMenuCommand command, params object[] bindings)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            var dteCommand = environment.GetCommand(command);

            if (dteCommand == null)
            {
                return;
            }

            try
            {
                dteCommand.Bindings = bindings;
            }
            catch (System.Runtime.InteropServices.COMException ex)
            {
                Debug.Assert(false, nameof(SetKeyBindings), ex.ToString());
            }
        }
Exemplo n.º 3
0
 public static object[] GetKeyBindings(this DTE2 environment, OleMenuCommand command)
 {
     return(environment.GetCommand(command)?.Bindings as object[]);
 }