提交更新
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BITKit;
|
||||
@@ -8,7 +9,6 @@ namespace BITKit;
|
||||
|
||||
public class SqlLiteContext<T> : DbContext,IDatabaseContext<T> where T : class
|
||||
{
|
||||
|
||||
public DbSet<T> context { get; private set; }
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
@@ -20,6 +20,12 @@ public class SqlLiteContext<T> : DbContext,IDatabaseContext<T> where T : class
|
||||
context.Add(entity);
|
||||
SaveChanges();
|
||||
}
|
||||
|
||||
public UniTask AddAsync(T entity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual void Remove(T entity)
|
||||
{
|
||||
context.Remove(entity);
|
||||
|
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Godot;
|
||||
|
||||
@@ -8,11 +9,23 @@ public static class LabelExtensions
|
||||
public static async void SetTextAsync(this Label self, string text)
|
||||
{
|
||||
await UniTask.SwitchToSynchronizationContext(BITApp.SynchronizationContext);
|
||||
self.Text = text;
|
||||
if (self is not null)
|
||||
self.Text = text;
|
||||
}
|
||||
public static async void SetTextAsync(this RichTextLabel self,string text)
|
||||
|
||||
public static async void SetTextAsync(this RichTextLabel self, string text)
|
||||
{
|
||||
var path = self.SceneFilePath;
|
||||
await UniTask.SwitchToSynchronizationContext(BITApp.SynchronizationContext);
|
||||
self.Text = text;
|
||||
try
|
||||
{
|
||||
self.Text = text;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
BIT4Log.Warnning(path);
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user