コード例 #1
0
 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;
     }
 }
コード例 #2
0
 internal ImageResourceType(WellKnownImageResourceType name)
 {
     NamePtr       = new IntPtr((int)name);
     Name          = $"#{(int)name}";
     WellKnownType = name;
 }
コード例 #3
0
 internal ImageResourceType(IntPtr ptr)
 {
     NamePtr       = ptr;
     Name          = ImageUtils.GetResourceString(ptr);
     WellKnownType = ImageUtils.GetWellKnownType(ptr);
 }