GetPresentationResult Example for C#
//LEADDICOMNet1 is a predefined LEADDicomNet object
private void TestGetPresentationResult ()
{
int x = 0;
string Out = null;
short result = 0;
short nID = 0;
//create the Associate Class as Request
LEADDICOMNet1.CreateAssociate(true);
//set the Associate to the default
LEADDICOMNet1.DefaultAssociate(LEADDICOMNet1.hPDU);
//get current results for each Presentation Context
Out = "";
for (x = 0; x < LEADDICOMNet1.GetPresentationCount(LEADDICOMNet1.hPDU);
x++)
{
nID = LEADDICOMNet1.GetPresentationID(LEADDICOMNet1.hPDU,
x);
result = LEADDICOMNet1.GetPresentationResult(LEADDICOMNet1.hPDU,
nID);
Out = Out + result;
Out = Out + "\r";
}
MessageBox.Show(Out);
//change all results to 1
for (x = 0; x < LEADDICOMNet1.GetPresentationCount(LEADDICOMNet1.hPDU);
x++)
{
nID = LEADDICOMNet1.GetPresentationID(LEADDICOMNet1.hPDU,
x);
LEADDICOMNet1.SetPresentationResult(LEADDICOMNet1.hPDU,
nID, 1);
}
//redisplay
Out = "";
for (x = 0; x < LEADDICOMNet1.GetPresentationCount(LEADDICOMNet1.hPDU);
x++)
{
nID = LEADDICOMNet1.GetPresentationID(LEADDICOMNet1.hPDU,
x);
Out = Out + LEADDICOMNet1.GetPresentationResult(LEADDICOMNet1.hPDU,
nID);
Out = Out + "\r";
}
MessageBox.Show(Out);
LEADDICOMNet1.FreeAssociate(LEADDICOMNet1.hPDU);
}