Skip to content

Instantly share code, notes, and snippets.

@njonsson
Created September 6, 2011 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njonsson/1198118 to your computer and use it in GitHub Desktop.
Save njonsson/1198118 to your computer and use it in GitHub Desktop.
// (Do this up front somewhere else.)
var closeMethod = typeof(OpenNETCF.Phone.Sim.Sim).GetMethod("Close");
// (Do this many times.)
using (var disposer = new Disposer<OpenNETCF.Phone.Sim.Sim>(OpenNETCF.Phone.Sim.Sim(), closeMethod))
{
// Use the 'disposer.Object' property ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment