protected void InitRegister()
 {
     EasyInject.Put <AppCenter, AppCenter>().Singleton();
     EasyInject.Put <IFileManager, FileManager>().Common();
     EasyInject.Put <ILogger, Logger>().Singleton();
     EasyInject.Put <IServerConfig, ConfigManager>().Singleton();
     EasyInject.Put <ClientCenter, ClientCenter>().Singleton();
 }
 protected void InitRegister()
 {
     EasyInject.Put <AppCenter, AppCenter>().Singleton();
     EasyInject.Put <TcpCenter, TcpCenter>().Singleton();
     EasyInject.Put <IFileManager, FileManager>().Common();
     EasyInject.Put <ILogger, Logger>().Singleton();
     EasyInject.Put <IConfig, ConfigManager>().Singleton();
     EasyInject.Put <IPipeServer, PipeServer>().Singleton();
     EasyInject.Put <P2PClient, P2PClient>().Singleton();
 }
Exemple #3
0
 protected virtual void InitRegister()
 {
     //应用中心,用于存放配置、全局变量等信息
     EasyInject.Put <AppCenter, AppCenter>().Singleton();
     //Tcp管理,用于保存当前tcp连接和端口监听实例
     EasyInject.Put <TcpCenter, TcpCenter>().Singleton();
     //文件IO接口,不同系统的文件读写方式有区别,可重载此接口实现定制
     EasyInject.Put <IFileManager, FileManager>().Common();
     //日志接口,用于日志写入
     EasyInject.Put <ILogger, Logger>().Singleton();
     //配置管理,用于读写配置文件
     EasyInject.Put <IConfig, ConfigManager>().Singleton();
     //内网穿透客户端实例
     EasyInject.Put <P2PClient, P2PClient>().Singleton();
 }
 public void Init()
 {
     //命名管道,用于与第三方进程通讯
     EasyInject.Put <IPipeServer, ClientPipe>().Singleton();
     EasyInject.Get <IPipeServer>().Start("P2PSocket.Client");
 }