Ejemplo n.º 1
0
        public static bool ExistIndexerSet(Type type, params Type[] indexerParamTypes)
        {
            if (indexerParamTypes == null || indexerParamTypes.Length <= 0)
            {
                throw new ArgumentException("索引器必须要有参数.", "indexerParamTypes");
            }
            IInvoke invoker = InvokerFactory.GetInvoker(type);

            return(invoker.ExistPropertyOrIndexerSet("Item", indexerParamTypes));
        }
Ejemplo n.º 2
0
        public static bool ExistPropertySet(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.ExistPropertyOrIndexerSet(propertyName));
        }