- 打开 Visual Studio 2005.
- 选择 文件->新建->项目.
- 在 新建项目 对话框中, 在项目类型列表中选择 Visual C# 或 VB , 并在模板列表中选择 类库.
- 在项目名称字段中键入项目名称为SampleOptions,然后单击 确定。 如果需要,键入项目的新位置或使用浏览按钮选择目录,然后单击确定。
-
在“解决方案资源管理器”窗口中,右键单击“引用”,然后从菜单中选择“添加引用”。 在“添加引用”对话框中,选择“浏览”选项卡,然后转至 LEADTOOLS 19 \ Bin \ DotNet \ Win32文件夹,选择以下DLLS:
- Leadtools.dll
- Leadtools.Dicom.dll
- Leadtools.Dicom.AddIn.dll
- System.Windows.Forms
-
单击确定按钮将上述DLL添加到应用程序。
- 在解决方案资源管理器窗口中,右键单击Class1.cs,然后从上下文菜单中选择重命名。 键入AddInOptions.cs,确定。
-
打开AddInOptions.cs文件并添加以下使用语句:
C#
using Leadtools.Dicom.AddIn;
using Leadtools.Dicom.AddIn.Interfaces;
using Systems.Windows.Forms;
-
将IAddInOptions添加到AddInOptions类派生列表中。你的类应该如下所示:
C#
public class AddInOptions : IAddInOptions
{
}
-
右键单击SampleOptions,然后从菜单中选择添加-> 新项目...。 在“添加新项”对话框中,选择“资源文件”。 在名称:文本框中将名称更改为Resource.resx。 单击添加按钮。
- 在解决方案资源管理器中,双击Resource.resx文件以打开资源编辑器。 单击添加资源按钮,然后选择添加现有文件...。 导航到要用作此插件的图像的图标文件。 将资源编辑器中的图标重命名为OptionImage。
-
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:LEADTOOLS PACS Framework管理员使用单独的应用程序域来启用单个服务的相同IAddOptions的加载。 要启用此行为,AddInOptions类需要从MarshalByRefObject派生并标记为Serializable。 进行这些更改后,你的类现在应如下所示:
C#
[Serializable]
public class AddInOptions : MarshalByRefObject,IAddInOptions
{
}
-
右键单击IAddInOptions,然后从上下文菜单中选择“实现接口 - >实现接口”。 你的类现在应该如下:
C#
[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
}
-
对AddInOptions类进行以下更改:
- 在配置方法中显示一个消息框。
- 分配AddInImage属性。
- 分配文本属性。
After making these changes your class should look as follows:
C#
[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
}
-
构建类库并获取输出,然后将其放在先前创建的服务器的AddIn目录中。
- 启动DICOM服务器管理器。 如果安装加载项的服务未列在“服务器”组合框中,请选择它。 可用选项应在AddIn Options列表框中显示为图标。 双击您创建的选项。 将出现一个消息框。
关于葡萄城
葡萄城是专业的软件开发技术和低代码平台提供商,以“赋能开发者”为使命,致力于通过表格控件、低代码和BI等各类软件开发工具和服务,一站式满足开发者需求,帮助企业提升开发效率并创新开发模式。葡萄城开发技术始于1980年,40余年来始终聚焦软件开发技术,有深厚的技术积累和丰富的产品线。是业界能够同时赋能软件开发和低代码开发的企业。凭借过硬的产品能力、活跃的用户社区和丰富的伙伴生态,与超过3000家合作伙伴紧密合作,产品广泛应用于信息和软件服务、制造、交通运输、建筑、金融、能源、教育、公共管理等支柱产业。
葡萄城热门产品
活字格
打通现有软件,快速定制面向未来的个性化应用

SpreadJS
可嵌入您系统的在线Excel的纯前端表格控件

Wyn商业智能
可与企业自有系统深度集成,增强数据分析的 BI 工具
