1
This commit is contained in:
@@ -161,7 +161,17 @@ namespace BITKit.Entities
|
||||
|
||||
if (instances.TryGetValue(h0, out var v0) is false)
|
||||
{
|
||||
instances[h0] = v0 = _entitiesInternal[id].ServiceProvider.GetRequiredService<T>();
|
||||
try
|
||||
{
|
||||
instances[h0] = v0 = _entitiesInternal[id].ServiceProvider.GetRequiredService<T>();
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
_logger.LogWarning($"Missing Entity {id},Ignore for now");
|
||||
|
||||
hashset.Remove(id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
array[i] = Unsafe.As<T>(v0);
|
||||
|
@@ -39,7 +39,7 @@ namespace BITKit.Entities
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_serviceProvider.Dispose();
|
||||
_serviceProvider?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
@@ -152,20 +152,11 @@ namespace BITKit
|
||||
list.Remove(t);
|
||||
return list.ToArray();
|
||||
}
|
||||
public static bool TryRemove<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey t)
|
||||
{
|
||||
return self.ContainsKey(t) && self.Remove(t);
|
||||
}
|
||||
|
||||
public static bool TryRemove<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey t) => self.Remove(t);
|
||||
public static void Set<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey key, TValue value)
|
||||
{
|
||||
if (self.ContainsKey(key))
|
||||
{
|
||||
self[key] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.Add(key, value);
|
||||
}
|
||||
self[key] = value;
|
||||
}
|
||||
public static TValue Get<TKey,TValue>(this IDictionary<Type,TValue> self)
|
||||
{
|
||||
|
16
Src/Core/UX/IUXSnackBar.cs
Normal file
16
Src/Core/UX/IUXSnackBar.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
namespace Net.BITKit.UX.SnackBar
|
||||
{
|
||||
public enum Severity
|
||||
{
|
||||
Normal,
|
||||
Info,
|
||||
Success,
|
||||
Warning,
|
||||
Error
|
||||
}
|
||||
public interface ISnackBar
|
||||
{
|
||||
void Add(string message, Severity severity = Severity.Normal);
|
||||
}
|
||||
}
|
11
Src/Core/UX/IUXSnackBar.cs.meta
Normal file
11
Src/Core/UX/IUXSnackBar.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c47bfae1d8985004181217f413fa6c64
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user