deadline.cs

来自「xpdl的c#解析器 完全依照xpdl标准」· CS 代码 · 共 76 行

CS
76
字号
using System;
using System.Collections;
using Nucleus.Common.Util;

namespace com.use.wfp.xpdl.elements
{
	/// <summary>
	/// Deadline 的摘要说明。
	/// </summary>
	public class Deadline:BaseElement
	{
		/// <remarks/>
		private Node DeadlineCondition = NodeFactory.CreateNode();
		public Node GetDeadlineCondition()
		{
			if(DeadlineCondition.IsEmpty()){
				Init();
			}
			return DeadlineCondition;
		}
        
		/// <remarks/>
		private Node ExceptionName = NodeFactory.CreateNode();
		public Node GetExceptionName()
		{
			if(ExceptionName.IsEmpty()){
				Init();
			}
			return ExceptionName;
		}
        
		private String gc;
		private static Hashtable modes;
		public DeadlineExecution GetDeadlineExecution()
		{
			if(IsExecutionSpecified())
			{
				return (DeadlineExecution)modes[gc];
			}
			throw new ObjectNotFound("DeadlineExecution is not specified");
		}

		public Deadline()
		{
			if(modes == null)
			{
				modes = new Hashtable();
				modes.Add("ASYNCHR", DeadlineExecution.ASYNCHR);
				modes.Add("SYNCHR", DeadlineExecution.SYNCHR);
			}
		}

		private void Init()
		{
			IList nodes = null;
			GetChildren(nodes, out nodes);
			foreach(Node node in nodes)
			{
				if(node.GetName().Equals("DeadlineCondition"))
				{
					DeadlineCondition = node;
				}
				else if(node.GetName().Equals("ExceptionName"))
				{
					ExceptionName = node;
				}
			}
		}
        
		public bool IsExecutionSpecified()
		{
			return GetAttribute(gc, out gc, "Execution") != "";
		}
	}
}

⌨️ 快捷键说明

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