public TD(ValueManglingFeature f, InjectableType t) { Fields = new List <FieldDef>(); foreach (var field in t.TypeMapping.Source.Fields) { if (!field.IsStatic && !field.IsInitOnly && (field.IsPublic || field.IsFamilyOrAssembly)) { var ft = field.FieldType; if (f.IsSuitableInput(ft)) { Fields.Add(field); } } } Score = t.Ctors.Count + Fields.Count; }
public IEnumerable <Var> GetIOVars(ValueManglingFeature feature, IContextImpl ctx) { foreach (var a in _arglist) { yield return(new Var.Arg(Method.Parameters[a])); } var t = Type; while (t != null) { foreach (var f in TD.Get(feature, t).Fields) { yield return(new Var.Fld(f, fld => ctx.BasicImporter.Import(fld))); } t = t.Base; } }
public static TD Get(ValueManglingFeature f, InjectableType t) => t.Details(f, () => new TD(f, t));