Beispiel #1
0
        protected virtual IEnumerable <MethodDesc> GetAllMethodsForValueType(TypeDesc valueType, bool virtualOnly)
        {
            TypeDesc valueTypeDefinition = valueType.GetTypeDefinition();

            if (RequiresGetFieldHelperMethod((MetadataType)valueTypeDefinition))
            {
                MethodDesc getFieldHelperMethod = _valueTypeMethodHashtable.GetOrCreateValue((DefType)valueTypeDefinition);

                if (valueType != valueTypeDefinition)
                {
                    yield return(GetMethodForInstantiatedType(getFieldHelperMethod, (InstantiatedType)valueType));
                }
                else
                {
                    yield return(getFieldHelperMethod);
                }
            }

            IEnumerable <MethodDesc> metadataMethods = virtualOnly ? valueType.GetVirtualMethods() : valueType.GetMethods();

            foreach (MethodDesc method in metadataMethods)
            {
                yield return(method);
            }
        }
Beispiel #2
0
 protected internal virtual IEnumerable <MethodDesc> GetAllVirtualMethods(TypeDesc type)
 {
     return(type.GetVirtualMethods());
 }