[Showing a C# code example]
In the "Solution Explorer" window right-click on the "References" folder, and select "Add Reference..." from the context menu. In the "Add Reference" dialog box, select the "Browse" tab and browse to Leadtools for .NET "C:\LEADTOOLS 18\Bin\DotNet\Win32" folder and select the following DLLS:
[Showing a C# code example]Leadtools.Dicom.dll Leadtools.Dicom.AddIn.dll
Open the Module.cs file and add the following
using statements:
using Leadtools.Dicom.AddIn;
using System.IO;
using System.Diagnostics;
Define the module class as listed below:
public class Module : ModuleInit
{
public override void Load(string ServiceDirectory, string DisplayName)
{
// Do any add-in initialization here. For instance, set up
// the logging infrastructure.
//
}
}
Open the ReceiveNotify.cs file and add
the following using statements:
using Leadtools.Dicom.AddIn;
using Leadtools.Dicom.AddIn.Interfaces;
using System.Diagnostics;
Add NotifyReceiveMessageBase to the ReceiveNotify class derivation list. Your class should look like the following:
public class ReceiveNotify : NotifyReceiveMessageBase
{
}
Override the messages you are interested in logging. This tutorial only overrides two methods to show what is possible. For a more detailed
implementation of logging refer to the Leadtools.AddIn.DicomLog example.
public class ReceiveNotify : NotifyReceiveMessageBase
{
public override void OnReceiveAssociateAccept(DicomClient Client, Leadtools.Dicom.DicomAssociate association)
{
Debug.WriteLine("Receive Associate Accept");
}
public override void OnReceiveCEchoRequest(DicomClient Client, byte presentationID, int messageID, string affectedClass)
{
Debug.WriteLine("Receive Echo Request");
}
}
Open the SendNotify.cs file and add the following using
statements:
using Leadtools.Dicom;
using Leadtools.Dicom.AddIn;
using Leadtools.Dicom.AddIn.Interfaces;
using System.Diagnostics;
Add NotifySendMessageBase to the ReceiveNotify class derivation list. Your class should look like the following:
public class SendNotify : NotifySendMessageBase
{
}
Override the messages you are interested in logging. This tutorial only overrides two methods to show what is possible. For a more detailed implementation of logging refer to the Leadtools.AddIn.DicomLog example.
public class SendNotify : NotifySendMessageBase
{
public override void OnSendAssociateAccept(DicomClient Client, DicomAssociate associate)
{
base.OnSendAssociateAccept(Client, associate);
}
public override void OnSendCEchoRequest(DicomClient Client, byte presentationID, int messageID, string affectedClass)
{
base.OnSendCEchoRequest(Client, presentationID, messageID, affectedClass);
}
}