private object doProtocolMethod(TProtocol oprot, string type, object obj, string wr) { string methodName = null; MethodInfo method = null; Object result = null; if (wr.Equals(WRITE)) { methodName = TypeChange.TPWriteMethodMap[type.ToUpper()]; Type clazz = TypeChange.TPParamsMap[type.ToUpper()]; method = oprot.GetType().GetMethod(methodName, new Type[] { clazz }); method.Invoke(oprot, new object[] { obj }); return(result); } if (wr.Equals(READ)) { methodName = TypeChange.TPReadMethodMap[type.ToUpper()]; method = oprot.GetType().GetMethod(methodName); result = method.Invoke(oprot, null); return(result); } Console.WriteLine("protocol method : " + method.Name); return(result); }
private string GetProtocolTransportName(TProtocol proto) { var name = Transport.GetType().Name; if (name.Equals(MemBuffer.GetType().Name)) { name = string.Empty; } else { name = " + " + name; } name = proto.GetType().Name + name; return(name); }