/// <summary> /// Add a field to this class /// </summary> /// <param name="f">Descriptor for the field to be added</param> public void AddField(FieldDef f) { FieldDef field = (FieldDef)FindField(f.Name()); if (field != null) throw new DescriptorException("Field " + field.NameString()); f.SetParent(this); fields.Add(f); }