/// <summary> /// Generates code for the specified field information. /// </summary> /// <param name="fieldInfo">The field information.</param> /// <param name="options">The generator options.</param> /// <returns>System.String.</returns> public string Generate(FieldInfo fieldInfo, FieldGeneratorOptions options) { var sb = new StringBuilder(); if (options.Access) { sb.Append(Generator.Access((MethodAttributes)fieldInfo.Attributes)); } if (options.Modifiers) { sb.Append(Generator.Modifier(fieldInfo.Attributes)); } if (options.Type) { sb.Append(Generator.Generate(fieldInfo.FieldType) + " "); } if (options.Name) { sb.Append(fieldInfo.Name); } //TODO Value; return(sb.ToString()); }
/// <summary> /// Generates code for the specified field information. /// </summary> /// <param name="fieldInfo">The field information.</param> /// <returns>System.String.</returns> public string Generate(FieldInfo fieldInfo) => Generate(fieldInfo, FieldGeneratorOptions.Create(GeneratorMode));