public MyTraceContext(string component) { switch (component) { case "Server": this.Component = LogComponent.Server; break; case "Client": this.Component = LogComponent.Client; break; default: throw new Exception(); } }