Saving instruments to database

I have code written to save various elements to a database and it is working well. I is something like this:

foreach (GoObject obj in MyView.Document) {

GoIconicNode iN = obj as GoIconicNode;
if (iN != null)
. . .
However, I am at the stage where I need to add a thermometer and save it. So I am just wondering if the thermometer works the same and I just need to add something like:
Thermometer th = obj as Thermometer;
if (th !=null) . . .
I have pulled the thermometer.cs from the inst. demo app and put it in my app_code dir and it seems to recognize the code so I wondering if it is just that simple or will there more to saving the instruments? Thanks, Mark

As long as you save/restore the relevant properties, it should work.
Jake