// When the callback thead exist the native message will be destroy. To avoid such beh. we copy // the message for asyn. use internal MyXcapMessage(XcapMessage message) { if (message == null) { this.code = -1; this.phrase = String.Empty; this.contentType = String.Empty; } else { this.code = message.getCode(); this.phrase = message.getPhrase(); this.contentType = message.getXcapHeaderValue("Content-Type"); uint clen = message.getXcapContentLength(); if (clen > 0) { this.content = new byte[clen]; IntPtr ptr = Marshal.AllocHGlobal((int)clen); message.getXcapContent(ptr, clen); Marshal.Copy(ptr, this.content, 0, this.content.Length); Marshal.FreeHGlobal(ptr); } else { this.content = null; } } }
public XcapMessage getXcapMessage() { IntPtr cPtr = tinyWRAPPINVOKE.XcapEvent_getXcapMessage(swigCPtr); XcapMessage ret = (cPtr == IntPtr.Zero) ? null : new XcapMessage(cPtr, false); return(ret); }
// When the callback thead exist the native message will be destroy. To avoid such beh. we copy // the message for asyn. use internal MyXcapMessage(XcapMessage message) { if (message == null) { this.code = -1; this.phrase = String.Empty; this.contentType = String.Empty; } else { this.code = message.getCode(); this.phrase = message.getPhrase(); this.contentType = message.getXcapHeaderValue("Content-Type"); uint clen = message.getXcapContentLength(); if (clen > 0) { this.content = new byte[clen]; message.getXcapContent(this.content, clen); } else { this.content = null; } } }
internal static HandleRef getCPtr(XcapMessage obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
internal static HandleRef getCPtr(XcapMessage obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }