Why is Action.GetDest() throwing an exception on some Action types?

Q: I am getting the following error while reading the "REMOTE BOOKMARK
1" of the bookmark_remote.pdf generated by the bookmark sample:

Exception: The method is not supperted on this Action type
Conditional expression: ActionGetType() == Action::e_GoTo

The error occurs when I iterate through the bookmarks at the following

Action action = item.GetAction();
if (action.IsValid()) {
       Destination dest = action.GetDest(); //Error occurrs here
A: The problem is that you are calling GetDest() on an Action that is
not a GoTo action.
To go around this exception, you need to check that the action is a
GoTo action. For example: if(action.IsValid() &&
action.GetType()==Action.Type.e_GoTo) ... action.GetDest();

In case you would also like to support "Remote GoTo (e_GoToR)" actions
you can fetch the name of the remote document as follows:

if (action is e_GoToR) ...
Obj file_dict = action.GetSDFObj().FindObj("F"); if (file_dict ==
null) return; FileSpec file_spec = new FileSpec(file_dict); String
file_path = file_spec.GetFilePath();

You can also obtain the page number of the remote document as
described in the following article: "How to get a page number from
e_gotoR action" in http://groups.google.com/group/pdfnet-sdk/.