void t_csharp_generator::generate_csharp_struct_definition(ofstream &out, t_struct* tstruct, bool is_exception, bool in_class, bool is_result) {
- if (!in_class)
- {
+ if (!in_class) {
start_csharp_namespace(out);
}
out << endl;
indent(out) << "[Serializable]" << endl;
- indent(out) << "public class " << tstruct->get_name() << " ";
+ indent(out) << "public class " << tstruct->get_name() << " : ";
if (is_exception) {
- out << ": Exception ";
+ out << "Exception, ";
}
+ out << "TBase";
out << endl;
--- /dev/null
+//
+// TBase.cs
+//
+// Distributed under the Thrift Software License
+//
+// See accompanying file LICENSE or visit the Thrift site at:
+// http://developers.facebook.com/thrift/using
+
+namespace Thrift.Protocol
+{
+ public interface TBase
+ {
+ ///
+ /// Reads the TObject from the given input protocol.
+ ///
+ void Read(TProtocol tProtocol);
+
+ ///
+ /// Writes the objects out to the protocol
+ ///
+ void Write(TProtocol tProtocol);
+ }
+}
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Protocol\TBase.cs" />
<Compile Include="Protocol\TBinaryProtocol.cs" />
<Compile Include="Protocol\TField.cs" />
<Compile Include="Protocol\TList.cs" />