HuwmanCode Namespace Highlights

  • Action.Try
    • This function is complementary to the System.Action type.
    • Enables the specifying of a compensation action should the execution of the action fail.
let action = new Action(fun _ -> System.IO.File.Delete(@"C:\test.txt"))
action |> Action.Try(fun e -> System.Windows.Forms.MessageBox.Show(sprintf "Error deleting file, %s" e.Message))
  • Environment.Shutdown
    • Enables the shutdown or reboot of the computer.
Environment.Shutdown(true) //reboots the computer

Last edited Oct 11, 2010 at 11:52 AM by huwman, version 2

Comments

No comments yet.