MoveFirstIOD Example for C#

//LEADDICOM1 is a DICOM Dataset defined outside this method
private void TestMoveFirstIOD()
{
   try
   {
      int hIOD = 0;
      LEADDICOM1.EnableMethodErrors = true;
      //Move to the First IOD in the list
      LEADDICOM1.MoveFirstIOD(false);
      hIOD = LEADDICOM1.get_CurrentIOD().hIOD;      //store it
      MessageBox.Show(LEADDICOM1.get_CurrentIOD().Name);
      //Move to the Last IOD at this same level
      LEADDICOM1.MoveLastIOD(true);
      MessageBox.Show(LEADDICOM1.get_CurrentIOD().Name);
      //Move to the Previous IOD at this same level
      LEADDICOM1.MovePrevIOD(true);
      MessageBox.Show(LEADDICOM1.get_CurrentIOD().Name);
      //Move back to First IOD
      LEADDICOM1.SetCurrentIOD(hIOD);
      //Move to the Next IOD at this same level
      LEADDICOM1.MoveNextIOD(true);
      MessageBox.Show(LEADDICOM1.get_CurrentIOD().Name);
      return;
   }
   catch
   {
      MessageBox.Show("Error");
   }
}