GetPresentationAbstract Example for C#

//LEADDICOMNet1 is a predefined LEADDicomNet object
private void TestGetPresentationAbstract ()
{
   const string UID_CR_IMAGE_STORAGE = "1.2.840.10008.5.1.4.1.1.1";
   // Computed Radiography Image Storage
   int x = 0;
   string Out = null;
   string result = null;
   short nID = 0;
   //create the Associate Class as Request
   LEADDICOMNet1.CreateAssociate(true);
   //set the Associate to the default
   LEADDICOMNet1.DefaultAssociate(LEADDICOMNet1.hPDU);
   //get abstracts for each Presentation Context
   Out = "";
   for (x = 0; x < LEADDICOMNet1.GetPresentationCount(LEADDICOMNet1.hPDU); x++)
   {
      nID = LEADDICOMNet1.GetPresentationID(LEADDICOMNet1.hPDU, x);
      result = LEADDICOMNet1.GetPresentationAbstract(LEADDICOMNet1.hPDU, nID);
      Out = Out + result;
      Out = Out + "\r";
   }
   MessageBox.Show(Out);
   //change the abstracts
   for (x = 0; x < LEADDICOMNet1.GetPresentationCount(LEADDICOMNet1.hPDU); x++)
   {
      nID = LEADDICOMNet1.GetPresentationID(LEADDICOMNet1.hPDU, x);
      LEADDICOMNet1.SetPresentationAbstract(LEADDICOMNet1.hPDU, nID, UID_CR_IMAGE_STORAGE);
   }
   //redisplay
   Out = "";
   for (x = 0; x < LEADDICOMNet1.GetPresentationCount(LEADDICOMNet1.hPDU); x++)
   {
      nID = LEADDICOMNet1.GetPresentationID(LEADDICOMNet1.hPDU, x);
      Out = Out + LEADDICOMNet1.GetPresentationAbstract(LEADDICOMNet1.hPDU, nID);
      Out = Out + "\r";
   }
   MessageBox.Show(Out);
   LEADDICOMNet1.FreeAssociate(LEADDICOMNet1.hPDU);
}