public static QQStatus ValueOfRaw(int status) { foreach (var s in qqStatus) { if (s.Status == status) { return s; } } throw new ArgumentException("unknown QQStatus enum: " + status); }