/// <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); }
/// <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); }
/// <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); }