示例#1
0
 public void Write()
 {
     writeLocker.Wait();
     try
     {
         StoreStream.SetLength(0);
         var sw = new StreamWriter(StoreStream);
         foreach (var item in Lines.Skip(SkipCount).Distinct())
         {
             sw.WriteLine(item);
         }
     }
     finally
     {
         writeLocker.Release();
     }
 }
示例#2
0
        public async Task WriteAsync()
        {
            await writeLocker.WaitAsync();

            try
            {
                StoreStream.SetLength(0);
                var sw = new StreamWriter(StoreStream);
                foreach (var item in Lines.Skip(SkipCount).Distinct())
                {
                    await sw.WriteLineAsync(item);
                }
            }
            finally
            {
                writeLocker.Release();
            }
        }