private bool AdjustStringMembers(TypeGenerator generator, FileAnalyzer analyzer) { analyzer.Stream.Position = 0; var enumerableType = typeof(StorageEnumerable <>).MakeGenericType(analyzer.RecordType); var enumerable = (IEnumerable)Activator.CreateInstance(enumerableType, analyzer.Stream, analyzer.Options); var isValidString = new bool[analyzer.Members.Members.Count]; for (var itr = 0; itr < isValidString.Length; ++itr) { isValidString[itr] = false; } foreach (var node in enumerable) { var memberIndex = 0; foreach (var exMemberInfo in analyzer.Members.Members) { if (memberIndex == analyzer.Members.IndexColumn) { ++memberIndex; continue; } var memberInfo = (PropertyInfo)exMemberInfo.MemberInfo; var memberValue = memberInfo.GetValue(node); if (exMemberInfo.Type == typeof(string)) { isValidString[memberIndex] = exMemberInfo.MappedTo.BitSize > 16 && memberValue != null; } ++memberIndex; } } for (var itr = 0; itr < isValidString.Length; ++itr) { if (!isValidString[itr]) { generator.GetMember(itr).Type = typeof(int); } } if (isValidString.Any()) { generator.Generate(); } return(isValidString.Any()); }