FindIndexModule Example for C#

//LEADDICOM1 is a DICOM Dataset defined outside this method
private void TestFindIndexModule()
{
   int lCount = 0;
   string szOut = null;
   int x = 0;
   LEADDICOM1.EnableMethodErrors = false;
   lCount = LEADDICOM1.GetModuleCount();
   LEADDICOM1.GetInfoDS();
   szOut = "Found " + System.Convert.ToString(lCount) + " Modules" + "\n" + "\r";
   for (x = 0; x < lCount; x++)
   {
      LEADDICOM1.FindIndexModule(x);
      LEADDICOM1.FindModuleIOD(LEADDICOM1.InfoClass, LEADDICOM1.get_CurrentModule().Module);
      szOut = szOut + "Module " + LEADDICOM1.get_CurrentIOD().Name + "\n" + "\r";
   }
   MessageBox.Show(szOut);
   LEADDICOM1.EnableMethodErrors = true;
}