コード例 #1
0
            void IExchangeInfoProvider.Save(ExchangeBoard board)
            {
                if (board == null)
                {
                    throw new ArgumentNullException(nameof(board));
                }

                lock (_boards.SyncRoot)
                {
                    if (!_boards.TryAdd(board.Code, board))
                    {
                        return;
                    }
                }

                BoardAdded.SafeInvoke(board);
            }
コード例 #2
0
        /// <summary>
        /// To save the board.
        /// </summary>
        /// <param name="board">Trading board.</param>
        public void Save(ExchangeBoard board)
        {
            if (board == null)
            {
                throw new ArgumentNullException(nameof(board));
            }

            _entityRegistry.ExchangeBoards.Save(board);

            lock (_boards.SyncRoot)
            {
                if (!_boards.TryAdd(board.Code, board))
                {
                    return;
                }
            }

            BoardAdded.SafeInvoke(board);
        }