コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
 public static IEnumerable <SyntaxNode> GetFldNodes(this SyntaxGenerator gen, IHasFields holder)
 => holder.Fields.OfType <IHasSyntaxNodes>().SelectMany(n => n.GetNodes(gen));
コード例 #3
0
 public static IEnumerable <ICommonField> GetFields(this IHasFields hasFields, string parameterTypeFullName)
 {
     return(hasFields.Fields.Where(field => field.Is(parameterTypeFullName)));
 }
コード例 #4
0
 public static IEnumerable <ICommonField> GetFields(this IHasFields hasFields, IHasType hasType)
 {
     return(hasFields.GetFields(hasType.Type));
 }
コード例 #5
0
 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));
 }
コード例 #6
0
 public static bool TryGetField(this IHasFields hasFields, string fieldName, out ICommonField foundCommonField)
 {
     return((foundCommonField = hasFields.GetField(fieldName)) != null);
 }