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 19\Bin\DotNet\Win32 folder and select the following DLLS:
Click the OK button to add the above DLLs to the application.
Open the AddInOptions.cs file and add the following using statements:
using Leadtools.Dicom.AddIn;
using Leadtools.Dicom.AddIn.Interfaces;
using Systems.Windows.Forms;
Add IAddInOptions to the AddInOptions class derivation list. Your class should look like the following:
public class AddInOptions : IAddInOptions
{
}
Right-click on SampleOptions and select Add-> New Item... from the context menu. In the Add New Item dialog select Resources File. In the Name: textbox change the name to Resource.resx. Click the Add button.
The LEADTOOLS PACS Framework admin makes use of separate application domains to enable the loading of the same IAddOptions for individual services. To enable this behavior the AddInOptions class needs to be derived from MarshalByRefObject and marked as Serializable. After making these changes your class should now look as follows:
[Serializable]
public class AddInOptions : MarshalByRefObject,IAddInOptions
{
}
Right-click on IAddInOptions and select "Implement Interface-> Implement Interface" from the context menu. Your class should now look as follows:
[Serializable]
public class AddInOptions : MarshalByRefObject,IAddInOptions
{
#region IAddInOptions Members
public void Configure(System.Windows.Forms.IWin32Window Parent, Leadtools.Dicom.AddIn.Common.ServerSettings Settings, string ServerDirectory)
{
throw new Exception(The method or operation is not implemented.);
}
public AddInImage Image
{
get
{
throw new Exception(The method or operation is not implemented.);
}
}
public string Text
{
get
{
throw new Exception(The method or operation is not implemented.);
}
}
#endregion
}
Make the following changes to the AddInOptions class:
After making these changes your class should look as follows:
[Serializable]
public class AddInOptions : MarshalByRefObject,IAddInOptions
{
#region IAddInOptions Members
public void Configure(System.Windows.Forms.IWin32Window Parent, Leadtools.Dicom.AddIn.Common.ServerSettings Settings, string ServerDirectory)
{
// For a production application you would call a user
// defined dialog box to configure the add-in options.
MessageBox.Show(Configure called);
}
public AddInImage Image
{
get
{
// The image has to be converted to AddInImage so that it is safe
// to cross appdomains. Png allows us to keep transparency
// intact.
using(System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
SampleOptions.Resource.OptionImage.ToBitmap().Save(ms, System.Drawing.Imaging.ImageFormat.Png);
ms.Position = 0;
return new System.Drawing.Bitmap(ms);
}
}
}
public string Text
{
get
{
return Sample AddIn;
}
}
#endregion
}
Build the class library and take the output and put it in the AddIn directory of your previously created server.
Products |
Support |
Feedback: Implementing Add in Options |
Introduction |
Help Version 19.0.2017.6.21
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.