⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imagecontroller.cs

📁 工作流的基本资料(文档资料
💻 CS
字号:
using System;
using log4net;
using NetBpm.Util.Client;
using NetBpm.Workflow.Definition;
using NetBpm.Workflow.Definition.EComp;

namespace NetBpm.Web.Presentation.Controllers
{
	public class ImageController : AbstractSecureController
	{
		private static readonly ILog log = LogManager.GetLogger(typeof (ImageController));

		public ImageController()
		{
		}

		public void ProcessImage(Int64 processDefinitionId)
		{
			IDefinitionSessionLocal definitionComponent = null;
			try
			{
				definitionComponent = ServiceLocator.Instance.GetService(typeof (IDefinitionSessionLocal)) as IDefinitionSessionLocal;
				Context.Response.ContentType = "image/gif";
				if (log.IsDebugEnabled)
				{
					log.Debug("show ProcessImage processDefinitionId:"+processDefinitionId);
				}
				IProcessDefinition processDefinition = definitionComponent.GetProcessDefinition(processDefinitionId);
				byte[] gifContents = processDefinition.Image;
					
				if (gifContents != null)
				{
					Context.Response.OutputStream.Write(gifContents,0,gifContents.Length);
				}
			} 
			finally
			{
				ServiceLocator.Instance.Release(definitionComponent);	
			}

		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -