コード例 #1
0
ファイル: ServerBase.cs プロジェクト: zmk523/ServerSuperIO
        internal ServerBase(IServerConfig config, IDeviceContainer deviceContainer = null, ILogContainer logContainer = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("配制信息", "参数为空");
            }
            ServerConfig = config;

            _deviceContainer = deviceContainer;
            if (_deviceContainer != null)
            {
                _deviceContainer.MouseRightContextMenu += Device_MouseRightContextMenu;
            }

            if (logContainer == null)
            {
                logContainer = new ConsoleContainer();
            }

            Logger = (new LogFactory()).GetLog(ServerName, logContainer);

            _monitorException = new MonitorException();

            ServiceManager      = new ServiceManager(Logger);
            GraphicsShowManager = new GraphicsShowManager(Logger);
            DeviceManager       = new DeviceManager(Logger);
            ChannelManager      = new ChannelManager(Logger);
            ControllerManager   = new ControllerManager(Logger);

            IsDisposed = false;
        }
コード例 #2
0
ファイル: ServerManager.cs プロジェクト: zhouwb168/CodeHub
 public IServer CreateServer(IServerConfig config, IDeviceContainer deviceContainer = null, ILogContainer logContainer = null)
 {
     try
     {
         return(new Server(config, deviceContainer, logContainer));
     }
     catch
     {
         throw;
     }
 }
コード例 #3
0
        protected List <DeviceNode> GetDevices(IDeviceContainer node, bool recurse)
        {
            var devices = node.Devices;

            if (node is IGroupContainer && recurse)
            {
                foreach (var group in ((IGroupContainer)node).Groups)
                {
                    devices.AddRange(GetDevices(group, true));
                }
            }

            return(devices);
        }
コード例 #4
0
ファイル: SocketServer.cs プロジェクト: zhouwb168/CodeHub
 internal SocketServer(IServerConfig config, IDeviceContainer deviceContainer = null, ILogContainer logContainer = null)
     : base(config, deviceContainer, logContainer)
 {
 }