Exemplo n.º 1
0
        private void DetermineContentDependenciesFromMethods()
        {
            BindingFlags flags = BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public;

            MethodInfo[] methods = m_forType.GetMethods(flags);
            foreach (MethodInfo info in methods)
            {
                // return type
                Type returnType = info.ReturnType;
                if (!m_manager.IsDefaultMapped(returnType) && !returnType.Equals(m_forType))
                {
                    AddToDepList(m_dependenciesContent, CreateMapTypeInfo(returnType,
                                                                          ReflectionHelper.CollectReturnParameterAttributes(info)),
                                 false);
                }

                ParameterInfo[] methodParams = info.GetParameters();
                foreach (ParameterInfo paramInfo in methodParams)
                {
                    if (!m_manager.IsDefaultMapped(paramInfo.ParameterType) && !paramInfo.ParameterType.Equals(m_forType))
                    {
                        // only add to dependencies, if not default mapped and not the same as type which is checked
                        AddToDepList(m_dependenciesContent, CreateMapTypeInfo(paramInfo.ParameterType,
                                                                              ReflectionHelper.CollectParameterAttributes(paramInfo, info)),
                                     false);
                    }
                }

                if ((ClsToIdlMapper.IsMappedToAbstractInterface(m_forType) ||
                     ClsToIdlMapper.IsMappedToConcreteInterface(m_forType)))
                {
                    DetermineContentDependenciesFromExceptions(info);
                }
            }
        }