public virtual void Export(TextWriter writer, int intent) { if (IsSerializable) { writer.WriteIntent(intent); writer.WriteLine("[{0}]", ScriptExportAttribute.SerializableName); } writer.WriteIntent(intent); writer.Write("{0} {1} {2}", Keyword, IsStruct ? "struct" : "class", TypeName); if (Base != null && !ScriptType.IsBasic(Base.Namespace, Base.Name)) { writer.Write(" : {0}", Base.GetTypeNestedName(DeclaringType)); } writer.WriteLine(); writer.WriteIntent(intent++); writer.WriteLine('{'); foreach (ScriptExportType nestedType in NestedTypes) { nestedType.Export(writer, intent); writer.WriteLine(); } foreach (ScriptExportEnum nestedEnum in NestedEnums) { nestedEnum.Export(writer, intent); writer.WriteLine(); } foreach (ScriptExportDelegate @delegate in Delegates) { @delegate.Export(writer, intent); } if (Delegates.Count > 0) { writer.WriteLine(); } foreach (ScriptExportField field in Fields) { field.Export(writer, intent); } writer.WriteIntent(--intent); writer.WriteLine('}'); }