2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-04-29 06:48:41 +00:00

TryRegisterTypeDef

This commit is contained in:
2026-04-06 03:08:19 +03:00
parent f225e29f87
commit 9f322e5be5
6 changed files with 26 additions and 110 deletions
+13
View File
@@ -519,6 +519,19 @@ public class Warehouse
}
}
public bool TryRegisterTypeDef(TypeDef typeDef)
{
lock (typeDefsLock)
{
if (typeDefs[typeDef.Kind].ContainsKey(typeDef.Id))
return false;
typeDefs[typeDef.Kind][typeDef.Id] = typeDef;
return true;
}
}
/// <summary>
/// Get a TypeDef by type from the warehouse. If not in the warehouse, a new TypeDef is created and added to the warehouse.