private void Validate(IHasFields holder, IList <IField> fields) { foreach (var fiel in fields.ToArray()) { if (fiel.Name.Contains("__BackingField") || fiel.Name.Contains("<>") || fiel.Type.Contains("Dictionary2")) { holder.Fields.Remove(fiel); } } }
public static IEnumerable <SyntaxNode> GetFldNodes(this SyntaxGenerator gen, IHasFields holder) => holder.Fields.OfType <IHasSyntaxNodes>().SelectMany(n => n.GetNodes(gen));
public static IEnumerable <ICommonField> GetFields(this IHasFields hasFields, string parameterTypeFullName) { return(hasFields.Fields.Where(field => field.Is(parameterTypeFullName))); }
public static IEnumerable <ICommonField> GetFields(this IHasFields hasFields, IHasType hasType) { return(hasFields.GetFields(hasType.Type)); }
public static ICommonField GetField(this IHasFields hasFields, string fieldName, bool throwExceptionIfNotFound = false) { return((hasFields.FieldNameToFields.TryGetValue(fieldName, out var commonFields) ? commonFields : Enumerable.Empty <ICommonField>()).SingleOrDefault(throwExceptionIfNotFound, fieldName)); }
public static bool TryGetField(this IHasFields hasFields, string fieldName, out ICommonField foundCommonField) { return((foundCommonField = hasFields.GetField(fieldName)) != null); }