private static void OnQueryCachedTeamInfoCompleted(string tid, string result, string jsonExtension, IntPtr userData) { if (userData != IntPtr.Zero) { var tinfo = NIMTeamInfo.Deserialize(result); NimUtility.DelegateConverter.InvokeOnce <QueryCachedTeamInfoResultDelegate>(userData, tid, tinfo); } }
/// <summary> /// 本地查询群信息(同步版本,堵塞NIM内部线程,谨慎使用) /// </summary> /// <param name="tid"></param> /// <returns></returns> public static NIMTeamInfo QueryCachedTeamInfo(string tid) { var ptr = TeamNativeMethods.nim_team_query_team_info_block(tid); if (ptr != IntPtr.Zero) { NimUtility.Utf8StringMarshaler marshaler = new NimUtility.Utf8StringMarshaler(); var tobj = marshaler.MarshalNativeToManaged(ptr); var tinfo = NIMTeamInfo.Deserialize(tobj.ToString()); GlobalAPI.FreeStringBuffer(ptr); return(tinfo); } return(null); }