public void OutputProxy(TextWriter writer, bool prettyPrint) { lock (this.SyncLock) { // locking because changing Formatter based upon debug switch if (prettyPrint) { this.formatter = new DebugJsonServiceProxyFormat(); } else { this.formatter = new JsonServiceProxyFormat(); } this.WriteNamespaces(writer); writer.Write(this.formatter.ProxyInstantiationFormat, this.ProxyNamespace, EcmaScriptWriter.Serialize(this.service.Address)); foreach (JsonMethodDescription method in this.Service.Methods) { this.WriteMethod(writer, method); } if (prettyPrint) { this.WriteProperty(writer, "isDebug", true); } } }