public void SetFormat(string fieldName, Type fieldType, string format, int width) { if (!string.IsNullOrWhiteSpace(fieldName)) { if (!string.IsNullOrWhiteSpace(format)) { if (!FormatFields.ContainsKey(fieldName)) { FormatFields.Add(fieldName, format); } } if (fieldType != null) { if (!TypeFields.ContainsKey(fieldName)) { TypeFields.Add(fieldName, fieldType); } } if (width > 0) { if (!SizeFields.ContainsKey(fieldName)) { SizeFields.Add(fieldName, width); } } } }
public IFieldBuilder DefineField(string name, IType fieldType, FieldAttributes attributes) { var builder = new AsmFieldBuilder(this, fieldType, attributes, name); TypeFields.Add(builder); return(builder); }
private void ReadEmbedded(UnityBinaryReader reader, int version, int typeVersion) { int fieldCount = reader.ReadInt32(); int stringTableLength = reader.ReadInt32(); TypeFields.Capacity = fieldCount; TypeFields.Clear(); for (int i = 0; i < fieldCount; i++) { var field = new Field(reader); TypeFields.Add(field); } ReadStringTable(reader, stringTableLength); }