public static bool ExistIndexerGet(Type type, params Type[] indexerParamTypes) { if (indexerParamTypes == null || indexerParamTypes.Length <= 0) { throw new ArgumentException("索引器必须要有参数.", "indexerParamTypes"); } IInvoke invoker = InvokerFactory.GetInvoker(type); return(invoker.ExistPropertyOrIndexerGet("Item", indexerParamTypes)); }
public static bool ExistProperty(Type type, string propertyName, bool ignoreCase) { IInvoke invoker = InvokerFactory.GetInvoker(type); if (ignoreCase) { propertyName = GetPropertyNameIgnoreCase(type, propertyName); } if (propertyName == null || propertyName.Trim().Length <= 0 || propertyName == "Item") { return(false); } return(invoker.ExistPropertyOrIndexerGet(propertyName) || invoker.ExistPropertyOrIndexerSet(propertyName)); }