Open Source: C# Helper to initialize PVX & OSS

Hey all,

As I've been learning how to implement BOI within a C# project I was really bothered by the amount of code reuse in my project surrounding instantiating the main BOI connections. This led me to refactor out that common code into a helper class thathas been working for me and I wanted to share it with you.

I posted the class to a gist here: gist.github.com/.../66c5dfb9f825bd13b850.

The way I'm using it is I'm storing my home connection, company, username and password as variables in my config file. That was mainly while I had lots of reused code so I could put it in this file but I don't mind the separation. This cleans up all of my code to look something like this:

try {
        using (var pvx = BaseSage.CreateProvidex()) {
          using (DispatchObject oSS = BaseSage.CreateSession(pvx, "C/I", "CI_ItemCode_UI")) {
            using (DispatchObject CIObject = new DispatchObject(pvx.InvokeMethod("NewObject", "CI_ItemCode_bus", oSS.GetObject()))) {
              CIObject.InvokeMethod("nSetKey", newSku.ItemCode);
}
}
}
} catch {
}

I really like how much cleaner this makes things. Hopefully some of you can find it useful as well. Let me know if you have any suggestions to improve it at all. Thanks!
jared