An enumeration is simply an integer that you can represent with a name. And enumerations are not limited to the known values. The following example will demonstrate this:
It will produce the following output:
using System; publicclass Program { privateenum IptcTag { Title = 5 } publicstaticvoid Main() { Write(5); Write(6); } privatestaticvoid Write(byte value) { IptcTag tag = (IptcTag) value; Console.WriteLine("{0} = {1}", (int)tag, tag.ToString()); } }
5 = Title
6 = 6
This means that changing IptcTag tag = EnumHelper.Parse((int)Data[i++], IptcTag.Unknown);
to IptcTag tag = (IptcTag)Data[i++];
should solve your issue.