public void StartService(string serverPath, int serverPort, string requestPath, int requestPort) { switch (RunMode) { case 1: RunContext.TryAdd(() => new Client.Client(requestPath, requestPort)); break; case 2: RunContext.TryAdd(() => new ServiceAfter(StartEmbeded, serverPath, serverPort)); RunContext.Get <ServiceAfter>().Run(); break; case 3: RunContext.TryAdd(() => new Client.Client(requestPath, requestPort)); RunContext.TryAdd(() => new ServiceAfter(StartEmbeded, serverPath, serverPort)); RunContext.Get <ServiceAfter>().Run(); break; } }