示例#1
0
        public MethodMetadata(BaseMethodMetadata methodMetadata)
        {
            m_Name = methodMetadata.MethodName;
            if (methodMetadata.GenericArguments != null)
            {
                List <TypeMetadata> genericArguments = new List <TypeMetadata>();
                foreach (BaseTypeMetadata baseMetadata in methodMetadata.GenericArguments)
                {
                    TypeMetadata metadata;
                    if (TypeMetadata.m_typesMetadata.ContainsKey(baseMetadata.TypeName))
                    {
                        metadata = TypeMetadata.m_typesMetadata[baseMetadata.TypeName];
                    }
                    else
                    {
                        metadata = new TypeMetadata(baseMetadata);
                    }
                    genericArguments.Add(metadata);
                }
                m_GenericArguments = genericArguments;
            }

            if (methodMetadata.ReturnType != null)
            {
                if (TypeMetadata.m_typesMetadata.ContainsKey(methodMetadata.ReturnType.TypeName))
                {
                    m_ReturnType = TypeMetadata.m_typesMetadata[methodMetadata.ReturnType.TypeName];
                }
                else
                {
                    m_ReturnType = new TypeMetadata(methodMetadata.ReturnType);
                }
            }

            m_Extension = methodMetadata.Extension;

            if (methodMetadata.Parameters != null)
            {
                List <ParameterMetadata> parameters = new List <ParameterMetadata>();
                foreach (BaseParameterMetadata baseMetadata in methodMetadata.Parameters)
                {
                    ParameterMetadata metadata = new ParameterMetadata(baseMetadata);
                    parameters.Add(metadata);
                }
                m_Parameters = parameters;
            }

            m_Modifiers = methodMetadata.Modifiers;
        }