public static void SetKeyBindings(this DTE2 environment, OleMenuCommand command, params object[] bindings) { var dteCommand = environment.GetCommand(command); if (dteCommand == null) { return; } dteCommand.Bindings = bindings; }
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()); } }
public static object[] GetKeyBindings(this DTE2 environment, OleMenuCommand command) { return(environment.GetCommand(command)?.Bindings as object[]); }