Exemplo n.º 1
0
        /// <summary>
        /// Gets a specified registered Zyan transport adapter.
        /// </summary>
        /// <param name="adapterName">Unique adapter name</param>
        /// <returns>Registered transport adapter</returns>
        public IServerTransportAdapter GetTransportAdapter(string adapterName)
        {
            IServerTransportAdapter adapter = null;

            _transportAdapters.TryGetValue(adapterName, out adapter);
            return(adapter);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Registers a specified Zyan transport adapter.
        /// </summary>
        /// <param name="adapter">Zyan transport adapter</param>
        public void Register(IServerTransportAdapter adapter)
        {
            if (adapter == null)
            {
                throw new ArgumentNullException("adapter");
            }

            if (_transportAdapters.ContainsKey(adapter.UniqueName))
            {
                throw new ArgumentException(string.Format(LanguageResource.ArgumentException_DuplicateChannelName, adapter.UniqueName), "channel");
            }

            _transportAdapters.TryAdd(adapter.UniqueName, adapter);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Registers a specified Zyan transport adapter.
        /// </summary>
        /// <param name="adapter">Zyan transport adapter</param>
        public void Register(IServerTransportAdapter adapter)
        {
            if (adapter==null)
                throw new ArgumentNullException("adapter");

            if (_transportAdapters.ContainsKey(adapter.UniqueName))
                throw new ArgumentException(string.Format(LanguageResource.ArgumentException_DuplicateChannelName, adapter.UniqueName), "channel");

            _transportAdapters.TryAdd(adapter.UniqueName, adapter);
        }