public IStatsOutputChannel CreateOutputChannelInstance(OutputSetting setting, params object[] args) { Type type = setting.GetType(); // Return if (!services.ContainsKey(type)) { throw new Exception(string.Format("OutputChannel is not found for {0}", type)); } return Activator.CreateInstance(services[type], args) as IStatsOutputChannel; }