Пример #1
0
 public void Dispose()
 {
     using (owner.trace.NewNamedFrame("Disposing {0}", DictionaryKey))
     {
         if (isDisposed)
         {
             owner.trace.Warning("Already disposed");
             return;
         }
         isDisposed = true;
         if (simpleMedia != null)
         {
             owner.trace.Info("Disposing SimpleMedia object");
             simpleMedia.Dispose();
         }
     }
 }
Пример #2
0
        public static async Task <SimpleFileMedia> Create(IFileSystem fileSystem, IConnectionParams connectParams)
        {
            var media = new SimpleFileMedia(fileSystem, connectParams);

            try
            {
                await media.Init();

                await media.Update();

                return(media);
            }
            catch
            {
                media.Dispose();
                throw;
            }
        }