internal void PrintCSC(WsdlParser.WriterStream writerStream) { TextWriter outputStream = writerStream.OutputStream; bool flag = false; if (this._numURTComplexTypes > 0) { for (int i = 0; i < this._URTComplexTypes.Count; i++) { WsdlParser.URTComplexType type = (WsdlParser.URTComplexType) this._URTComplexTypes[i]; if ((type != null) && type.IsPrint) { flag = true; } } } if (this._numURTSimpleTypes > 0) { for (int j = 0; j < this._URTSimpleTypes.Count; j++) { if (((WsdlParser.URTSimpleType) this._URTSimpleTypes[j]) != null) { flag = true; } } } if (this._URTInterfaces.Count > 0) { flag = true; } if (flag) { string indentation = string.Empty; Stream baseStream = ((StreamWriter) outputStream).BaseStream; if (!writerStream.GetWrittenTo()) { outputStream.WriteLine("using System;"); outputStream.WriteLine("using System.Runtime.Remoting.Messaging;"); outputStream.WriteLine("using System.Runtime.Remoting.Metadata;"); outputStream.WriteLine("using System.Runtime.Remoting.Metadata.W3cXsd2001;"); outputStream.WriteLine("using System.Runtime.InteropServices;"); writerStream.SetWrittenTo(); } if ((this.Namespace != null) && (this.Namespace.Length != 0)) { outputStream.Write("namespace "); outputStream.Write(WsdlParser.IsValidCS(this.EncodedNS)); outputStream.WriteLine(" {"); indentation = " "; } StringBuilder sb = new StringBuilder(0x100); if (this._numURTComplexTypes > 0) { for (int m = 0; m < this._URTComplexTypes.Count; m++) { WsdlParser.URTComplexType type3 = (WsdlParser.URTComplexType) this._URTComplexTypes[m]; if ((type3 != null) && type3.IsPrint) { type3.PrintCSC(outputStream, indentation, this._encodedNS, sb); } } } if (this._numURTSimpleTypes > 0) { for (int n = 0; n < this._URTSimpleTypes.Count; n++) { WsdlParser.URTSimpleType type4 = (WsdlParser.URTSimpleType) this._URTSimpleTypes[n]; if (type4 != null) { type4.PrintCSC(outputStream, indentation, this._encodedNS, sb); } } } for (int k = 0; k < this._URTInterfaces.Count; k++) { ((WsdlParser.URTInterface) this._URTInterfaces[k]).PrintCSC(outputStream, indentation, this._encodedNS, sb); } if ((this.Namespace != null) && (this.Namespace.Length != 0)) { outputStream.WriteLine('}'); } } }