///** // * Autogenerated by Thrift Compiler (0.12.0) // * // * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING // * @generated // */ //using System; //using System.Collections; //using System.Collections.Generic; //using System.Text; //using System.IO; //using Thrift; //using Thrift.Collections; //using System.Runtime.Serialization; //using Thrift.Protocol; //using Thrift.Transport; //public partial class ShareLog //{ // public interface ISync // { // string SendMessage(string message, string type = ""); // } // public interface Iface : ISync // { //#if SILVERLIGHT // IAsyncResult Begin_SendMessage(AsyncCallback callback, object state, string message); // string End_SendMessage(IAsyncResult asyncResult); //#endif // } // public class Client : IDisposable, Iface // { // public Client(TProtocol prot) : this(prot, prot) // { // } // public Client(TProtocol iprot, TProtocol oprot) // { // iprot_ = iprot; // oprot_ = oprot; // } // protected TProtocol iprot_; // protected TProtocol oprot_; // protected int seqid_; // public TProtocol InputProtocol // { // get { return iprot_; } // } // public TProtocol OutputProtocol // { // get { return oprot_; } // } // #region " IDisposable Support " // private bool _IsDisposed; // // IDisposable // public void Dispose() // { // Dispose(true); // } // protected virtual void Dispose(bool disposing) // { // if (!_IsDisposed) // { // if (disposing) // { // if (iprot_ != null) // { // ((IDisposable)iprot_).Dispose(); // } // if (oprot_ != null) // { // ((IDisposable)oprot_).Dispose(); // } // } // } // _IsDisposed = true; // } // #endregion //#if SILVERLIGHT // public IAsyncResult Begin_SendMessage(AsyncCallback callback, object state, string message) // { // return send_SendMessage(callback, state, message); // } // public string End_SendMessage(IAsyncResult asyncResult) // { // oprot_.Transport.EndFlush(asyncResult); // return recv_SendMessage(); // } //#endif // public string SendMessage(string message) // { //#if SILVERLIGHT // var asyncResult = Begin_SendMessage(null, null, message); // return End_SendMessage(asyncResult); //#else // return "ok"; //#endif // } //#if SILVERLIGHT // public IAsyncResult send_SendMessage(AsyncCallback callback, object state, string message) // { // oprot_.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Call, seqid_)); // SendMessage_args args = new SendMessage_args(); // args.Message = message; // args.Write(oprot_); // oprot_.WriteMessageEnd(); // return oprot_.Transport.BeginFlush(callback, state); // } //#else // public void send_SendMessage(string message, string type) // { // oprot_.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Call, seqid_)); // SendMessage_args args = new SendMessage_args(); // args.Message = message; // args.Type = type; // args.Write(oprot_); // oprot_.WriteMessageEnd(); // oprot_.Transport.Flush(); // } //#endif // public string recv_SendMessage() // { // TMessage msg = iprot_.ReadMessageBegin(); // if (msg.Type == TMessageType.Exception) // { // TApplicationException x = TApplicationException.Read(iprot_); // iprot_.ReadMessageEnd(); // throw x; // } // SendMessage_result result = new SendMessage_result(); // result.Read(iprot_); // iprot_.ReadMessageEnd(); // if (result.__isset.success) // { // return result.Success; // } // throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "SendMessage failed: unknown result"); // } // public string SendMessage(string message, string type = "") // { // send_SendMessage(message, type); // return "ok"; // } // } // public class Processor : TProcessor // { // public Processor(ISync iface) // { // iface_ = iface; // processMap_["SendMessage"] = SendMessage_Process; // } // protected delegate void ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot); // private ISync iface_; // protected Dictionary processMap_ = new Dictionary(); // public bool Process(TProtocol iprot, TProtocol oprot) // { // try // { // TMessage msg = iprot.ReadMessageBegin(); // ProcessFunction fn; // processMap_.TryGetValue(msg.Name, out fn); // if (fn == null) // { // TProtocolUtil.Skip(iprot, TType.Struct); // iprot.ReadMessageEnd(); // TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.UnknownMethod, "Invalid method name: '" + msg.Name + "'"); // oprot.WriteMessageBegin(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID)); // x.Write(oprot); // oprot.WriteMessageEnd(); // oprot.Transport.Flush(); // return true; // } // fn(msg.SeqID, iprot, oprot); // } // catch (IOException) // { // return false; // } // return true; // } // public void SendMessage_Process(int seqid, TProtocol iprot, TProtocol oprot) // { // SendMessage_args args = new SendMessage_args(); // args.Read(iprot); // iprot.ReadMessageEnd(); // SendMessage_result result = new SendMessage_result(); // try // { // result.Success = iface_.SendMessage(args.Message); // //oprot.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Reply, seqid)); // //result.Write(oprot); // } // catch (TTransportException) // { // throw; // } // catch (Exception ex) // { // Console.Error.WriteLine("Error occurred in processor:"); // Console.Error.WriteLine(ex.ToString()); // TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error."); // oprot.WriteMessageBegin(new TMessage("SendMessage", TMessageType.Exception, seqid)); // x.Write(oprot); // } // oprot.WriteMessageEnd(); // oprot.Transport.Flush(); // } // } //#if !SILVERLIGHT // [Serializable] //#endif // public partial class SendMessage_args : TBase // { // private string _message; // private string _type; // public string Message // { // get // { // return _message; // } // set // { // __isset.message = true; // this._message = value; // } // } // public string Type // { // get // { // return _type; // } // set // { // __isset.type = true; // this._type = value; // } // } // public Isset __isset; //#if !SILVERLIGHT // [Serializable] //#endif // public struct Isset // { // public bool message; // public bool type; // } // public SendMessage_args() // { // } // public void Read(TProtocol iprot) // { // iprot.IncrementRecursionDepth(); // try // { // TField field; // iprot.ReadStructBegin(); // while (true) // { // field = iprot.ReadFieldBegin(); // if (field.Type == TType.Stop) // { // break; // } // switch (field.ID) // { // case 1: // if (field.Type == TType.String) // { // Message = iprot.ReadString(); // } // else // { // TProtocolUtil.Skip(iprot, field.Type); // } // break; // case 2: // if (field.Type == TType.String) // { // Type = iprot.ReadString(); // } // else // { // TProtocolUtil.Skip(iprot, field.Type); // } // break; // default: // TProtocolUtil.Skip(iprot, field.Type); // break; // } // iprot.ReadFieldEnd(); // } // iprot.ReadStructEnd(); // } // finally // { // iprot.DecrementRecursionDepth(); // } // } // public void Write(TProtocol oprot) // { // oprot.IncrementRecursionDepth(); // try // { // TStruct struc = new TStruct("SendMessage_args"); // oprot.WriteStructBegin(struc); // TField field = new TField(); // if (Message != null && __isset.message) // { // field.Name = "message"; // field.Type = TType.String; // field.ID = 1; // oprot.WriteFieldBegin(field); // oprot.WriteString(Message); // oprot.WriteFieldEnd(); // } // if (Type != null && __isset.type) // { // field.Name = "type"; // field.Type = TType.String; // field.ID = 2; // oprot.WriteFieldBegin(field); // oprot.WriteString(Type); // oprot.WriteFieldEnd(); // } // oprot.WriteFieldStop(); // oprot.WriteStructEnd(); // } // finally // { // oprot.DecrementRecursionDepth(); // } // } // public override string ToString() // { // StringBuilder __sb = new StringBuilder("SendMessage_args("); // bool __first = true; // if (Message != null && __isset.message) // { // if (!__first) { __sb.Append(", "); } // __first = false; // __sb.Append("Message: "); // __sb.Append(Message); // } // if (Type != null && __isset.type) // { // if (!__first) { __sb.Append(", "); } // __first = false; // __sb.Append("Type: "); // __sb.Append(Type); // } // __sb.Append(")"); // return __sb.ToString(); // } // } //#if !SILVERLIGHT // [Serializable] //#endif // public partial class SendMessage_result : TBase // { // private string _success; // public string Success // { // get // { // return _success; // } // set // { // __isset.success = true; // this._success = value; // } // } // public Isset __isset; //#if !SILVERLIGHT // [Serializable] //#endif // public struct Isset // { // public bool success; // } // public SendMessage_result() // { // } // public void Read(TProtocol iprot) // { // iprot.IncrementRecursionDepth(); // try // { // TField field; // iprot.ReadStructBegin(); // while (true) // { // field = iprot.ReadFieldBegin(); // if (field.Type == TType.Stop) // { // break; // } // switch (field.ID) // { // case 0: // if (field.Type == TType.String) // { // Success = iprot.ReadString(); // } // else // { // TProtocolUtil.Skip(iprot, field.Type); // } // break; // default: // TProtocolUtil.Skip(iprot, field.Type); // break; // } // iprot.ReadFieldEnd(); // } // iprot.ReadStructEnd(); // } // finally // { // iprot.DecrementRecursionDepth(); // } // } // public void Write(TProtocol oprot) // { // oprot.IncrementRecursionDepth(); // try // { // TStruct struc = new TStruct("SendMessage_result"); // oprot.WriteStructBegin(struc); // TField field = new TField(); // if (this.__isset.success) // { // if (Success != null) // { // field.Name = "Success"; // field.Type = TType.String; // field.ID = 0; // oprot.WriteFieldBegin(field); // oprot.WriteString(Success); // oprot.WriteFieldEnd(); // } // } // oprot.WriteFieldStop(); // oprot.WriteStructEnd(); // } // finally // { // oprot.DecrementRecursionDepth(); // } // } // public override string ToString() // { // StringBuilder __sb = new StringBuilder("SendMessage_result("); // bool __first = true; // if (Success != null && __isset.success) // { // if (!__first) { __sb.Append(", "); } // __first = false; // __sb.Append("Success: "); // __sb.Append(Success); // } // __sb.Append(")"); // return __sb.ToString(); // } // } //}