using BPA.Helper; using BPASmart.Model; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace BPASmart.Server { public class Main { private volatile static Main _Instance; public static Main GetInstance => _Instance ?? (_Instance = new Main()); private Main() { } public void Init() { Json.Read(); Assembly.GetExecutingAssembly().GetTypes()?.ToList()?.ForEach(item => { if (item.GetInterfaces().Contains(typeof(IServer))) { (Activator.CreateInstance(item) as IServer)?.Init(); } }); } } }