Vorrei implementare un'istanza di IRandomAccessStream
in C# (restituirà i dati generati in tempo reale). Lo streaming non ha realmente bisogno di essere scrivibile o ricercabile, ma voglio restituire i miei dati nel metodo ReadAsync
(che è in realtà parte di IInputStream
).Come posso implementare IRandomAccessStream in C#?
public IAsyncOperationWithProgress<IBuffer, uint> ReadAsync(IBuffer buffer, uint count, InputStreamOptions options)
{
throw new NotImplementedException("To be done");
}
Le mie due domande principali sono:
- Come faccio a restituire qualcosa che implementa
IAsyncOperationWithProgress
? C'è qualcosa di costruito nel framework per aiutare con questo? - Come si scrivono i dati nel buffer?
IBuffer
ha solo le proprietàLength
eCapacity
(anche la classe Buffer concreta non offre più).
Duplicato di http://stackoverflow.com/questions/10112696/how-to-implement-iasyncoperationwithprogress? –
@ RenéWolferink Ho visto questa domanda, ma la risposta non risolve il mio problema. –