System.IO.TextWriter.WriteAsync C# (CSharp) Méthode

WriteAsync() public méthode

public WriteAsync ( char value ) : Task
value char
Résultat Task
        public virtual Task WriteAsync(char value)
        {
            var tuple = new Tuple<TextWriter, char>(this, value);
            return Task.Factory.StartNew(state =>
            {
                var t = (Tuple<TextWriter, char>)state;
                t.Item1.Write(t.Item2);
            },
            tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
        }

Same methods

TextWriter::WriteAsync ( char buffer, int index, int count ) : Task
TextWriter::WriteAsync ( string value ) : Task

Usage Example

Exemple #1
0
        internal static async Task CreateThumbnailAsync(StorageRepository repo, string fileName, TextWriter log)
        {
            using (var memStream = await repo.GetBlob(StorageConfig.PhotosBlobContainerName, fileName))
            {
                MemoryStream thumbnail = null;
                try
                {
                    thumbnail = PhotoEditor.ProcessImage(memStream);
                    await repo.UploadBlobAsync(thumbnail, StorageConfig.ThumbnailsBlobContainerName, fileName);
                }
                catch (Exception oops)
                {
                    await log.WriteAsync(oops.Message);
                    throw oops;
                }
                finally
                {
                    if (null != thumbnail)
                    {
                        thumbnail.Dispose();
                    }
                }

            }
        }
All Usage Examples Of System.IO.TextWriter::WriteAsync