static VarArgsInvoke() { if (delType.BaseType != typeof(MulticastDelegate)) { throw new TypeLoadException("TDelegate must be a delegate type."); } Invoke = new InvokeCache(); MethodInfo invoke = delType.GetMethod("Invoke"); argTypes = invoke.GetParameters().Select(p => p.ParameterType).ToArray(); Type last = argTypes[argTypes.Length - 1]; retType = invoke.ReturnType; if (last == typeof(MethodInfo)) { passmethod = true; argTypes[argTypes.Length - 1] = typeof(IntPtr); dynType = ReflectionTools.GetDelegateType(retType, argTypes); } else if (last != typeof(IntPtr)) { throw new TypeLoadException("Last parameter of the delegate type must be System.IntPtr or System.Reflection.MethodInfo."); } else { dynType = delType; } }
public IndexGetAccessor(IIndexGet <TKey, TValue> indexable, TKey key) { Indexable = indexable; Key = key; }
/*public static ReferenceAccessor<T> Access<T>(ref T value) * { * return new ReferenceAccessor<T>(ref value); * }*/ public static IndexGetAccessor <TKey, TValue> Access <TKey, TValue>(this IIndexGet <TKey, TValue> indexable, TKey key) { return(new IndexGetAccessor <TKey, TValue>(indexable, key)); }