attributeimpl.cs

来自「基于DotNet的开源工作流引擎」· CS 代码 · 共 64 行

CS
64
字号
using System;
using NetBpm.Util.Xml;
using NetBpm.Workflow.Delegation;
using NetBpm.Workflow.Delegation.Impl;

namespace NetBpm.Workflow.Definition.Impl
{
	public class AttributeImpl : DefinitionObjectImpl, IAttribute
	{
		private IProcessBlock _scope = null;
		private String _initialValue = null;
		private DelegationImpl _serializerDelegation = null;

		public IProcessBlock Scope
		{
			set { _scope = value; }
			get { return _scope; }
		}

		public String InitialValue
		{
			set { _initialValue = value; }
			get { return _initialValue; }
		}

		public IDelegation SerializerDelegation
		{
			set { _serializerDelegation = (DelegationImpl) value; }
			get { return _serializerDelegation; }
		}

		public AttributeImpl()
		{
		}

		public AttributeImpl(IProcessDefinition processDefinition) : base(processDefinition)
		{
		}

		public DelegationImpl CreateSerializerDelegation()
		{
			_serializerDelegation = new DelegationImpl(_processDefinition);
			return _serializerDelegation;
		}

		public override void ReadProcessData(XmlElement xmlElement, CreationContext creationContext)
		{
			base.ReadProcessData(xmlElement, creationContext);
			this._scope = creationContext.ProcessBlock;
			this._initialValue = xmlElement.GetProperty("initial-value");

			creationContext.DelegatingObject = this;
			this._serializerDelegation = new DelegationImpl();
			this._serializerDelegation.ReadProcessData(xmlElement, creationContext);
			creationContext.DelegatingObject = null;
			creationContext.AddReferencableObject(_name, (ProcessBlockImpl) this._scope, typeof (IAttribute), this);
		}

		public override void Validate(ValidationContext validationContext)
		{
			base.Validate(validationContext);
		}
	}
}

⌨️ 快捷键说明

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