internal OneofAccessor(PropertyInfo caseProperty, MethodInfo clearMethod, OneofDescriptor descriptor) { if (!caseProperty.CanRead) { throw new ArgumentException("Cannot read from property"); } this.descriptor = descriptor; caseDelegate = ReflectionUtil.CreateFuncObjectT <int>(caseProperty.GetGetMethod()); this.descriptor = descriptor; clearDelegate = ReflectionUtil.CreateActionObject(clearMethod); }