Esempio n. 1
0
        public FileChannel(string directory, string channelFileMask, IFileChannelFormatter channelFormatter, Action <object> onReceiveMessage)
        {
            if (string.IsNullOrEmpty(directory))
            {
                throw new ArgumentNullException(nameof(directory));
            }

            if (string.IsNullOrEmpty(channelFileMask))
            {
                throw new ArgumentNullException(nameof(channelFileMask));
            }

            if (channelFormatter == null)
            {
                throw new ArgumentNullException(nameof(channelFormatter));
            }

            if (onReceiveMessage == null)
            {
                throw new ArgumentNullException(nameof(onReceiveMessage));
            }

            _directory        = directory;
            _channelFileMask  = channelFileMask;
            _channelFormatter = channelFormatter;
            _onReceiveMessage = onReceiveMessage;
            _channelHistory   = new FileChannelHistory();
        }
Esempio n. 2
0
        public FileChannel(string directory, string channelFileMask, IFileChannelFormatter channelFormatter, Action<object> onReceiveMessage)
        {
            if (string.IsNullOrEmpty(directory))
            {
                throw new ArgumentNullException(nameof(directory));
            }

            if (string.IsNullOrEmpty(channelFileMask))
            {
                throw new ArgumentNullException(nameof(channelFileMask));
            }

            if (channelFormatter == null)
            {
                throw new ArgumentNullException(nameof(channelFormatter));
            }

            if (onReceiveMessage == null)
            {
                throw new ArgumentNullException(nameof(onReceiveMessage));
            }

            _directory = directory;
            _channelFileMask = channelFileMask;
            _channelFormatter = channelFormatter;
            _onReceiveMessage = onReceiveMessage;
            _channelHistory = new FileChannelHistory();
        }