hi, ich hab da mal wieder ein prob.
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
| class FieldDefinition { private string mName; private string mDataTyp;
public string Name {
get { return mName; } set { if (!string.IsNullOrEmpty(value)) { mName = value; } else { throw new FieldDefinitionException("Der Feldname darf nicht leer sein", "???"); } } } public DatenTyp DataTyp { get { return mDataTyp; } set { mDataTyp = value; } } } |
folgendes problem habe ich.
ich soll überprüfen ob die eingabe des benutzers bezüglich des datentyps erlaub ist. (richtiger wert) deshalb hab ich eine enum erstellt.
mein frage ist, wie kann ich jetzt prüfen ob das was der benutzer eingegeben hat in meiner enum steht?
p.s:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7:
| public enum DatenTyp { VarChar, Integer, Boolean, Text } |
(das ist meine enum)