Beispiel #1
0
 static public Type GetType(TypeIndex index)
 {
     if (!TypesByIndex.TryGetValue(index, out Type type))
     {
         throw new System.Exception("Type index is not set: " + index.ToString());
     }
     return(type);
 }
Beispiel #2
0
 public static DarkMeta Get(TypeIndex typeIndex)
 {
     if (typeIndex != TypeIndex.Invalid)
     {
         DarkMeta meta;
         if (MetasByIndex.TryGetValue(typeIndex, out meta))
         {
             return(meta);
         }
         else
         {
             Type type;
             if (TypeRegistry.TryGetType(typeIndex, out type))
             {
                 return(Get(type));
             }
         }
     }
     return(null);
 }
 public DarkContractAttribute(TypeIndex typeIndex, DarkFlags flags = DarkFlags.Serializable)
 {
     this.TypeIndex = typeIndex;
     this.Flags     = flags;
 }
Beispiel #4
0
 static public bool TryGetType(TypeIndex index, out Type type)
 {
     return(TypesByIndex.TryGetValue(index, out type));
 }