NServiceBus.XmlDeserialization.GetProperty C# (CSharp) Method

GetProperty() private method

private GetProperty ( Type t, string name ) : PropertyInfo
t System.Type
name string
return System.Reflection.PropertyInfo
        PropertyInfo GetProperty(Type t, string name)
        {
            IEnumerable<PropertyInfo> properties;
            if (!cache.typeToProperties.TryGetValue(t, out properties))
            {
                cache.InitType(t);
                cache.typeToProperties.TryGetValue(t, out properties);
            }

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

            var n = GetNameAfterColon(name);

            foreach (var prop in properties)
            {
                if (prop.Name == n)
                {
                    return prop;
                }
            }

            return null;
        }