internal ImageResourceType(string name) { if (ImageUtils.TryParseId(name, out int type_id)) { NamePtr = new IntPtr(type_id); Name = $"#{type_id}"; if (Enum.IsDefined(typeof(WellKnownImageResourceType), type_id)) { WellKnownType = (WellKnownImageResourceType)type_id; } else { WellKnownType = WellKnownImageResourceType.Unknown; } } else { NamePtr = IntPtr.Zero; Name = name; WellKnownType = WellKnownImageResourceType.Unknown; } }
internal ImageResourceType(WellKnownImageResourceType name) { NamePtr = new IntPtr((int)name); Name = $"#{(int)name}"; WellKnownType = name; }
internal ImageResourceType(IntPtr ptr) { NamePtr = ptr; Name = ImageUtils.GetResourceString(ptr); WellKnownType = ImageUtils.GetWellKnownType(ptr); }