示例#1
0
        protected AsyncMethod(MethodInfo syncMethod, AsyncType type)
        {
            if (syncMethod == null)
            {
                throw new ArgumentNullException("syncMethod");
            }

            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            if (type.SyncType != syncMethod.DeclaringType)
            {
                throw new ArgumentException("The given method is not defined on given type", "syncMethod");
            }

            VerifyContract(syncMethod);

            SyncMethod = syncMethod;
            AsyncType  = type;
            handle     = ObtainNewHandle(syncMethod);
        }
示例#2
0
 public BeginMethod(MethodInfo syncMethod, AsyncType type)
     : base(syncMethod, type)
 {
     parameters = ObtainParameters(syncMethod);
 }