public InputBindingsCollection GetBindingByComponent(IComponent component) { InputBindingsCollection bindingsCollection = new InputBindingsCollection(); for (int index = 0; index < this.List.Count; ++index) { IComponent commandContext = ((InputBinding)this.List[index]).CommandContext as IComponent; if (commandContext != null && commandContext == component) { bindingsCollection.Add((InputBinding)this.List[index]); } } if (bindingsCollection.Count > 0) { return(bindingsCollection); } return((InputBindingsCollection)null); }
public InputBindingsCollection GetBindingByComponent(IComponent component) { InputBindingsCollection tempColection = new InputBindingsCollection(); for (int i = 0; i < List.Count; i++) { IComponent tempComponent = ((InputBinding)List[i]).CommandContext as IComponent; if (tempComponent != null && (tempComponent == component)) { tempColection.Add((InputBinding)List[i]); } } if (tempColection.Count > 0) { return(tempColection); } return(null); }