public CStreamUpload CreateUpload(String AName, String AMimeType, eStreamContextType AContextType) { byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); byte[] byteMimeType = Encoding.UTF8.GetBytes(AMimeType + char.MinValue); Int32 enumContextType = (Int32)AContextType; IntPtr newInstance = IntPtr.Zero; CheckError(Internal.LibAMCFWrapper.Connection_CreateUpload(Handle, byteName, byteMimeType, enumContextType, out newInstance)); return(new CStreamUpload(newInstance)); }
public void GetContext(out eStreamContextType AContextType, out String AOwnerUUID) { Int32 resultContextType = 0; UInt32 sizeOwnerUUID = 0; UInt32 neededOwnerUUID = 0; CheckError(Internal.LibAMCFWrapper.DataStream_GetContext(Handle, out resultContextType, sizeOwnerUUID, out neededOwnerUUID, IntPtr.Zero)); sizeOwnerUUID = neededOwnerUUID; byte[] bytesOwnerUUID = new byte[sizeOwnerUUID]; GCHandle dataOwnerUUID = GCHandle.Alloc(bytesOwnerUUID, GCHandleType.Pinned); CheckError(Internal.LibAMCFWrapper.DataStream_GetContext(Handle, out resultContextType, sizeOwnerUUID, out neededOwnerUUID, dataOwnerUUID.AddrOfPinnedObject())); AContextType = (eStreamContextType)(resultContextType); dataOwnerUUID.Free(); AOwnerUUID = Encoding.UTF8.GetString(bytesOwnerUUID).TrimEnd(char.MinValue); }