MonoDevelop.Components.Commands.CommandManager.CanUseBinding C# (CSharp) Method

CanUseBinding() private method

private CanUseBinding ( KeyboardShortcut chords, KeyboardShortcut accels, KeyBinding &binding, bool &isChord ) : bool
chords KeyboardShortcut
accels KeyboardShortcut
binding KeyBinding
isChord bool
return bool
		bool CanUseBinding (KeyboardShortcut[] chords, KeyboardShortcut[] accels, out KeyBinding binding, out bool isChord)
		{
			if (chords != null) {
				foreach (var chord in chords) {
					foreach (var accel in accels) {
						binding = new KeyBinding (chord, accel);
						if (bindings.BindingExists (binding)) {
							isChord = false;
							return true;
						}
					}
				}
			} else {
				foreach (var accel in accels) {
					if (bindings.ChordExists (accel)) {
						// Chords take precedence over bindings with the same shortcut.
						binding = null;
						isChord = true;
						return false;
					}
					
					binding = new KeyBinding (accel);
					if (bindings.BindingExists (binding)) {
						isChord = false;
						return true;
					}
				}
			}
			
			isChord = false;
			binding = null;
			
			return false;
		}