WIP: EDMI Service
This commit is contained in:
@@ -52,7 +52,7 @@ Public Class Form1
|
||||
Await oStream.ReadAsync(oContents, 0, oFileInfo.Length)
|
||||
End Using
|
||||
|
||||
Dim oResult As EDMIServiceReference.DocumentResult2 = Await _Channel.ImportFileAsync(oFileInfo.Name, oContents, Environment.UserName)
|
||||
Dim oResult As EDMIServiceReference.DocumentResult = Await _Channel.ImportFileAsync(oFileInfo.Name, oContents, Environment.UserName)
|
||||
If oResult.OK Then
|
||||
listboxLog.Items.Add($"File [{oFileInfo.Name}] with Id [{oResult.Document.FileId}] imported!")
|
||||
Else
|
||||
@@ -121,14 +121,14 @@ Public Class Form1
|
||||
|
||||
Dim oObjectId As Integer = TextboxObejctId.EditValue
|
||||
|
||||
Dim oStream = Await _Channel.GetFileByObjectIdAsync(oObjectId)
|
||||
Dim oResponse = Await _Channel.GetFileByObjectIdAsync(New EDMIServiceReference.DocumentStreamRequest() With {.ObjectId = oObjectId})
|
||||
Dim oMemoryStream As New MemoryStream()
|
||||
oStream.CopyTo(oMemoryStream)
|
||||
oResponse.FileContents.CopyTo(oMemoryStream)
|
||||
oMemoryStream.Position = 0
|
||||
|
||||
listboxLog.Items.Add("Stream read!")
|
||||
|
||||
DocumentViewer1.LoadFile("textfile.png", oMemoryStream)
|
||||
DocumentViewer1.LoadFile(oResponse.FileName, oMemoryStream)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!")
|
||||
End Try
|
||||
|
||||
Reference in New Issue
Block a user