/// <summary> /// Installs a per channel module. /// </summary> /// <param name="channel"></param> public void Install(ISockNetChannel channel) { ISockNetChannelModule module = NewPerChannelModule(); if (channel.SetAttribute(ModuleName, module, false)) { module.Install(channel); } }
/// <summary> /// Adds a module into this channel. /// </summary> /// <param name="module"></param> /// <returns></returns> public ISockNetChannel AddModule(ISockNetChannelModule module) { ISockNetChannelModule tmp; if (modules.TryAdd(module.GetType().Name, module, out tmp, false)) { SockNetLogger.Log(SockNetLogger.LogLevel.DEBUG, this, "Adding module: [{0}]", module); if (ShouldInstallModule(module)) { SockNetLogger.Log(SockNetLogger.LogLevel.DEBUG, this, "Installing module: [{0}]", module); module.Install(this); } } else { throw new Exception("Module [" + module + "] already installed."); } return(this); }
public ISockNetChannel AddModule(ISockNetChannelModule module) { module.Install(this); return(this); }
public ISockNetChannel AddModule(ISockNetChannelModule module) { module.Install(this); return this; }