本文整理汇总了C#中Association.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Association.SendMessage方法的具体用法?C# Association.SendMessage怎么用?C# Association.SendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Association
的用法示例。
在下文中一共展示了Association.SendMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendRequest
///// <summary>
///// Sends a request for DIMSE association to a DICOM service
///// </summary>
///// <param name="asc">the underlying association</param>
///// <param name="abstractSyntax">the proposed abstract syntaxes (what should the service be able to do)</param>
public static void SendRequest(Association asc, params string[] abstractSyntaxes)
{
var request = new Request {CalledEntityTitle = asc.AeTitle, CallingEntityTitle = asc.ServiceClass.ApplicationEntity.AeTitle};
abstractSyntaxes.Select((a, i) => new {a, i})
.ToList()
.ForEach(a =>
{
var pres = new PresentationContext
{
AbstractSyntax = a.a,
Id = a.i*2 + 1, //Convention of odd numbers
Reason = PresentationContextReason.ACCEPTANCE,
TransferSyntaxes = asc.ServiceClass.SupportedTransferSyntaxes
};
request.PresentationContexts.Add(pres);
});
asc.PresentationContexts.AddRange(request.PresentationContexts);
request.UserInfo = new UserInfo();
asc.Logger.Log("--> " + request);
asc.SendMessage(request);
}