public static FieldDef FromString(string flddef) { if (string.IsNullOrEmpty(flddef)) { return(null); } try { string[] parts = flddef.Replace("{", string.Empty).Replace("}", string.Empty).Split(','); enumFieldTypes type = enumFieldTypes.Text; foreach (enumFieldTypes t in Enum.GetValues(typeof(enumFieldTypes))) { if (t.ToString() == parts[1]) { type = t; break; } } return(new FieldDef(parts[0], type, int.Parse(parts[2]))); } catch { return(null); } }
public FieldDef(string fieldName, enumFieldTypes fieldType, int fieldLength) : this(fieldName, fieldType) { _fieldLength = fieldLength; }
public FieldDef(string fieldName, enumFieldTypes fieldType) : this(fieldName) { _fieldType = fieldType; }