public bool TryLookupEntity(string symbol, InfixNotation notation, int inputSignals, int outputSignals, int buses, out Entity entity) { entity = null; ReadOnlyCollection <Entity> entry; if (entityTable.TryLookupSymbol(symbol, notation, out entry)) { for (int i = 0; i < entry.Count; i++) { entity = entry[i]; if ((entity.InputSignals.Length == inputSignals && entity.OutputSignals.Length == outputSignals && entity.Buses.Length == buses) || entity.IsGeneric && entity.Buses.Length == buses) { return(true); } } } return(false); }