public static Fragment GetMemberBindingFragmentType(MemberBinding memberBinding) { var fragmentType = Fragment.CreateEmpty(); if (memberBinding.BoundMember is Field) { Field field = (Field)memberBinding.BoundMember; fragmentType = FragmentUtility.GetFragmentType(field.Attributes); } return(fragmentType); }
public static Fragment[] GetAnnotatedParameterFragmentTypes(Method method) { var buffer = new List <Fragment>(); if (!IsAnnotatedPropertySetter(method)) { buffer.AddRange(method.Parameters.Select(parameter => FragmentUtility.GetFragmentType(parameter.Attributes))); } else { buffer.Add(FragmentUtility.GetFragmentType(method.DeclaringMember.Attributes)); } return(buffer.ToArray()); }
public static Fragment InferReturnFragmentType(Method method) { Fragment fragmentType; AttributeNodeCollection definingAttributes = GetDefiningAttributes(method); if (definingAttributes != null) { fragmentType = FragmentUtility.GetFragmentType(definingAttributes); } else { fragmentType = Fragment.CreateEmpty(); } return(fragmentType); }