Ejemplo n.º 1
0
        protected override void UseSample()
        {
            TypeIDisposable instance = new TypeIDisposable();

            Logger.Info("Disposing the object");
            instance.Dispose();
            Logger.Info("Object disposed");
        }
Ejemplo n.º 2
0
 protected override void UseSample()
 {
     try
     {
         using (TypeIDisposable instance = new TypeIDisposable())
         {
             throw new Exception();
         }
     }
     catch (Exception ex)
     {
         Logger.Info("Even though an exception was thrown, the Dispose method was called");
     }
 }