예제 #1
0
        /// <summary>
        /// Resolve member
        /// </summary>
        public MemberNode Resolve(Assembly ownerAssembly)
        {
            if (_type == null)
            {
                return(null);
            }

            if (string.IsNullOrEmpty(_name))
            {
                return(null);
            }

            var type = _type.Resolve(ownerAssembly);

            if (type == null)
            {
                return(null);
            }

            var property = type.Properties.Find(_name);

            if (property != null)
            {
                return(property);
            }

            var e = type.Events.Find(_name);

            if (e != null)
            {
                return(e);
            }

            return(type.Fields.Find(_name));
        }
        public static TypeDeclaration Resolve(this IBamlType bamlType, Assembly ownerAssembly, bool throwOnFailure = false)
        {
            var type = bamlType.Resolve(ownerAssembly);

            if (type == null)
            {
                if (throwOnFailure)
                {
                    throw new ResolveReferenceException(string.Format(Net.SR.TypeResolveError, bamlType.ToString()));
                }

                return(null);
            }

            return(type);
        }
 private TypeDeclaration Resolve(IBamlType bamlType)
 {
     return(bamlType.Resolve(_assembly));
 }