当前位置: 首页>>代码示例>>C#>>正文


C# CommandProcessor.AddCommand方法代码示例

本文整理汇总了C#中ClearCanvas.Dicom.Utilities.Command.CommandProcessor.AddCommand方法的典型用法代码示例。如果您正苦于以下问题:C# CommandProcessor.AddCommand方法的具体用法?C# CommandProcessor.AddCommand怎么用?C# CommandProcessor.AddCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ClearCanvas.Dicom.Utilities.Command.CommandProcessor的用法示例。


在下文中一共展示了CommandProcessor.AddCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Apply

		public void Apply(ServerRuleApplyTimeEnum applyTime, CommandProcessor theProcessor)
		{
			try
			{
				if (_studyRulesEngine == null || !_studyRulesEngine.RuleApplyTime.Equals(applyTime))
				{
					_studyRulesEngine = new ServerRulesEngine(applyTime, _location.ServerPartitionKey);
					_studyRulesEngine.Load();
				}

				List<string> files = GetFirstInstanceInEachStudySeries();
				if (files.Count == 0)
				{
					string message =
						String.Format("Unexpectedly unable to find SOP instances for rules engine in each series in study: {0}",
						              _location.StudyInstanceUid);
					Platform.Log(LogLevel.Error, message);
					throw new ApplicationException(message);
				}

				Platform.Log(LogLevel.Info, "Processing Study Level rules for study {0} on partition {1} at {2} apply time",
				             _location.StudyInstanceUid, _partition.Description, applyTime.Description);

				foreach (string seriesFilePath in files)
				{
					var theFile = new DicomFile(seriesFilePath);
					theFile.Load(DicomReadOptions.Default);
					var context =
						new ServerActionContext(theFile, _location.FilesystemKey, _partition, _location.Key, theProcessor){ RuleEngine = _studyRulesEngine};
					_studyRulesEngine.Execute(context);

					ProcessSeriesRules(theFile, theProcessor);
				}

				if (applyTime.Equals(ServerRuleApplyTimeEnum.StudyProcessed))
				{
					// This is a bit kludgy, but we had a problem with studies with only 1 image incorectlly
					// having archive requests inserted when they were scheduled for deletion.  Calling
					// this command here so that if a delete is inserted at the study level, we will remove
					// the previously inserted archive request for the study.  Note also this has to be done
					// after the rules engine is executed.
					theProcessor.AddCommand(new InsertArchiveQueueCommand(_location.ServerPartitionKey, _location.Key));
				}
			}
			finally
			{
				if (_studyRulesEngine!=null)
					_studyRulesEngine.Complete(_studyRulesEngine.RulesApplied);
			}


			
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:53,代码来源:StudyRulesEngine.cs


注:本文中的ClearCanvas.Dicom.Utilities.Command.CommandProcessor.AddCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。