Catel.Reflection.TypeInfoExtensions.GetField C# (CSharp) Method

GetField() public static method

Gets the field with the specified name.
The is null. The is null or whitespace.
public static GetField ( this typeInfo, string name, BindingFlags bindingFlags ) : FieldInfo
typeInfo this The .
name string The name of the member to retrieve.
bindingFlags BindingFlags The binding flags.
return System.Reflection.FieldInfo
        public static FieldInfo GetField(this TypeInfo typeInfo, string name, BindingFlags bindingFlags)
        {
            Argument.IsNotNull("typeInfo", typeInfo);
            Argument.IsNotNullOrWhitespace("name", name);
            
            return (from x in GetFields(typeInfo, bindingFlags)
                    where x.Name == name
                    select x).FirstOrDefault();
        }