コード例 #1
0
        private static NIMSignalingNotityInfo NotityInfoFromIntPtr(IntPtr src_data)
        {
            NIMSignalingNotityInfo_C info_c = (NIMSignalingNotityInfo_C)Marshal.PtrToStructure(src_data, typeof(NIMSignalingNotityInfo_C));
            NIMSignalingNotityInfo   info   = null;
            object notity_objtect           = null;

            switch (info_c.event_type_)
            {
            case NIMSignalingEventType.kNIMSignalingEventTypeClose:
            case NIMSignalingEventType.kNIMSignalingEventTypeLeave:
            case NIMSignalingEventType.kNIMSignalingEventTypeCtrl:
                notity_objtect = info_c;
                info           = SignalHelper.NIMSignalingNotityInfoFromC(info_c);
                break;

            case NIMSignalingEventType.kNIMSignalingEventTypeJoin:
                notity_objtect = (NIMSignalingNotityInfoJoin_C)Marshal.PtrToStructure(src_data, typeof(NIMSignalingNotityInfoJoin_C));
                info           = SignalHelper.NIMSignalingNotityInfoFromC((NIMSignalingNotityInfoJoin_C)notity_objtect);
                break;

            case NIMSignalingEventType.kNIMSignalingEventTypeInvite:
                notity_objtect = (NIMSignalingNotityInfoInvite_C)Marshal.PtrToStructure(src_data, typeof(NIMSignalingNotityInfoInvite_C));
                info           = SignalHelper.NIMSignalingNotityInfoFromC((NIMSignalingNotityInfoInvite_C)notity_objtect);
                break;

            case NIMSignalingEventType.kNIMSignalingEventTypeCancelInvite:
                notity_objtect = (NIMSignalingNotityInfoCancelInvite_C)Marshal.PtrToStructure(src_data, typeof(NIMSignalingNotityInfoCancelInvite_C));
                info           = SignalHelper.NIMSignalingNotityInfoFromC((NIMSignalingNotityInfoCancelInvite_C)notity_objtect);
                break;

            case NIMSignalingEventType.kNIMSignalingEventTypeReject:
                notity_objtect = (NIMSignalingNotityInfoReject_C)Marshal.PtrToStructure(src_data, typeof(NIMSignalingNotityInfoReject_C));
                info           = SignalHelper.NIMSignalingNotityInfoFromC((NIMSignalingNotityInfoReject_C)notity_objtect);
                break;

            case NIMSignalingEventType.kNIMSignalingEventTypeAccept:
                notity_objtect = (NIMSignalingNotityInfoAccept_C)Marshal.PtrToStructure(src_data, typeof(NIMSignalingNotityInfoAccept_C));
                info           = SignalHelper.NIMSignalingNotityInfoFromC((NIMSignalingNotityInfoAccept_C)notity_objtect);
                break;
            }
            return(info);
        }