Advertisement
TLama

Untitled

Jan 12th, 2015
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.26 KB | None | 0 0
  1. constructor TEnumSettings<TKey>.Create(AKey: TKey);
  2. var
  3.   Value: TValue;
  4. begin
  5.   Value := TValue.From<TKey>(AKey);
  6.   if Value.Kind <> tkEnumeration then
  7.     raise Exception.CreateFmt('%s is not an enumeration.', [Value.TypeInfo.Name]);
  8.  
  9.   Key := AKey;
  10. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement