public static PropertyInstance FindByTemplate(String propertyName, NewType propertyType, bool tryOnly) { IBytecodeBehaviorState state = BytecodeBehaviorState.State; PropertyInstance pi = state.GetProperty(propertyName, propertyType); if (pi != null) { return(pi); } if (tryOnly) { return(null); } throw new ArgumentException("No property found on class hierarchy: " + propertyName + ". Start type: " + state.NewType); }
public static PropertyInstance FindByTemplate(PropertyInstance propertyTemplate, bool tryOnly) { return(FindByTemplate(propertyTemplate.Name, propertyTemplate.PropertyType, tryOnly)); }