订单任务,现已修改成全局任务列表 包括 订单任务和礼品单任务

订单列表动态展示礼品单状态
This commit is contained in:
chfei committed 2026-08-24 18:11:44 +08:00
1 parent 78dc8a5d03
commit 7998a753cc
20 files changed
+2820 -2627

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
using System;
using System.Reflection;
namespace WxOrder.Framework;
/// <summary>
/// 单例,需要在当前类中定义
/// </summary>
/// <typeparam name="T"></typeparam>
public class SingleInstance<T> where T : class
{
private static readonly object lockObj = new();
private static T mySelf;//= default(T);
public static T Instance
{
get
{
lock (lockObj)
{
mySelf ??= InstanceCreator.CreateInstance<T>();
}
return mySelf;
}
}
}
public static class InstanceCreator
{
public static T CreateInstance<T>()
{
Type type = typeof(T);
try
{
return (T)type.Assembly.CreateInstance(type.FullName, true, BindingFlags.NonPublic | BindingFlags.Instance, null, null, null, null);
}
catch (MissingMethodException ex)
{
throw new Exception($"{ex.Message}\n(单例模式下,构造函数必须为 private)");
}
}
}