private static ICollection <ParameterExpectation> AsExpectations(IEnumerable <IParameterValue> paramaters) { var offered = new HashSet <ParameterExpectation>(); paramaters.ToList().ForEach(p => offered.Add(ParameterExpectation.Expect(p))); return(offered); }
private ICollection <ParameterExpectation> CollectAvailableParameters() { var options = new HashSet <ParameterExpectation>(); foreach (MethodInfo info in AllMethods) { info.GetParameters().ToList().ForEach(p => options.Add(ParameterExpectation.Expect(p.Name))); } return(options); }
public IEnumerable <MethodInfo> CandidateMethods() { ICollection <ParameterExpectation> offered = AsExpectations(Parameters); offered.Add( ParameterExpectation.Expect(Html.HTMLHELPER_PARAM_NAME).Of(Html.HTMLHELPER_PARAM_TYPE).And(). ItMustBeAnExactMatch()); return(FindMethods(offered)); }
public static ICollection <IParameterValue> ExtractHtmlAttributes(ICollection <IParameterValue> offered, ICollection <ParameterExpectation> with) { var attributes = new Dictionary <String, IParameterValue>(); foreach (IParameterValue param in offered.ToList()) { if (with.Contains(ParameterExpectation.Expect(param.Name))) { continue; } offered.Remove(param); attributes.Add(param.Name, param); } if (attributes.Count > 0) { offered.Add(new HtmlAttributesParameterValue(attributes)); } return(offered); }