Пример #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;
        }
Пример #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());
            }
        }
Пример #3
0
 public static object[] GetKeyBindings(this DTE2 environment, OleMenuCommand command)
 {
     return(environment.GetCommand(command)?.Bindings as object[]);
 }