ConformanceStatus example for C#

//LEADDICOM1 is a DICOM Dataset defined outside this method
private void LEADDICOM1_ConformanceStatus(short nFlags)
{
      string msg = null;
      short nRet = 0;
      string szTag = null;
      string szTagL = null;
      string szTagR = null;
      short nLen = 0;
      short x = 0;
      //display info about non-standard element
   switch (nFlags)
   {
   case (short) LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_UNKNOWN_CLASS:
         msg = "Unknown Class" + "\r";
         break;
   case (short) LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_UNKNOWN_TAG:
         msg = "Unknown Tag" + "\r";
         break;
   case (short) LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_UNKNOWN_VR:
         msg = "Unknown VR" + "\r";
         break;
   case (short) LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_WRONG_VR:
         msg = "Error in VR" + "\r";
         break;
   case (short) LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_MIN_VM:
         msg = "Error in MinVM" + "\r";
         break;
   case (short) LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_MAX_VM:
         msg = "Error in MaxVM" + "\r";
         break;
   case (short) LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_DIVIDE_VM:
         msg = "Error in DivideVM" + "\r";
         break;
   case (short) LTDICLib.DicomConformanceStatusFlags.CALLBACK_ERROR_IMAGE:
         msg = "Error in Image" + "\r";
         break;
   default:
         return;
   }
   szTag = System.Convert.ToString(LEADDICOM1.get_CurrentElement().Tag, 16).ToUpper();
   nLen = (short)szTag.Length;
   szTagR = szTag.Substring(0, nLen - 4);
   szTagL = "";
   for (x = nLen; x <= 7; x++)
   {
      szTagL = szTagL + System.Convert.ToString(0);
   }
   szTagL = szTagL + szTag.Substring(0, nLen - 4);
   szTag = szTagL + ":" + szTagR;
   msg = msg + "Tag: " + szTag;
   nRet = (short)MessageBox.Show(msg, "Non-Standard Element", MessageBoxButtons.OKCancel );
   if (nRet == (short)DialogResult.Cancel)
      LEADDICOM1.EnableConformanceStatus = false;
   }