/// <summary> /// 初始化时间片 /// </summary> /// <param name="delayTimeSpan">延迟的时间</param> /// <param name="intervalTimeSpan">间隔的时间</param> /// <param name="iCount">调用的次数</param> public BaseAITrigger( long iAIEventType, AIProcessPriority processPriority, TimeSpan expirationTimeSpan ) { m_iAITriggerType = iAIEventType; m_ProcessPriority = processPriority; m_ExpirationTimeSpan = expirationTimeSpan; if ( m_ExpirationTimeSpan == TimeSpan.Zero ) m_ExpirationDateTime = DateTime.MaxValue; // 如果是零,这表示为永久触发器信号 else m_ExpirationDateTime = DateTime.Now + expirationTimeSpan; if ( DefRegCreation == true ) RegCreation(); }
/// <summary> /// /// </summary> /// <param name="iTriggerType"></param> /// <param name="processPriority"></param> /// <returns></returns> public BaseAITrigger RegisterAITrigger(long iAIEventType, AIProcessPriority processPriority, TimeSpan expirationTimeSpan) { BaseAITrigger l_newBaseAITrigger = new BaseAITrigger(iAIEventType, processPriority, expirationTimeSpan); l_newBaseAITrigger.InternalSerial = m_AITriggerExclusiveSerial.GetExclusiveSerial(); Monitor.Enter(m_LockAITrigger); { m_AITrigger.Add(l_newBaseAITrigger.AITriggerType, l_newBaseAITrigger); } Monitor.Exit(m_LockAITrigger); return(l_newBaseAITrigger); }
/// <summary> /// 初始化时间片 /// </summary> /// <param name="delayTimeSpan">延迟的时间</param> /// <param name="intervalTimeSpan">间隔的时间</param> /// <param name="iCount">调用的次数</param> public BaseAITrigger(long iAIEventType, AIProcessPriority processPriority, TimeSpan expirationTimeSpan) { m_iAITriggerType = iAIEventType; m_ProcessPriority = processPriority; m_ExpirationTimeSpan = expirationTimeSpan; if (m_ExpirationTimeSpan == TimeSpan.Zero) { m_ExpirationDateTime = DateTime.MaxValue; // 如果是零,这表示为永久触发器信号 } else { m_ExpirationDateTime = DateTime.Now + expirationTimeSpan; } if (DefRegCreation == true) { RegCreation(); } }
/// <summary> /// 初始化时间片 /// </summary> /// <param name="delayTimeSpan">延迟的时间</param> public BaseAITrigger( long iAIEventType, AIProcessPriority processPriority ) : this( iAIEventType, processPriority, TimeSpan.Zero ) { }
/// <summary> /// 初始化时间片 /// </summary> /// <param name="delayTimeSpan">延迟的时间</param> public BaseAIEvent( long iAIEventType, AIProcessPriority processPriority ) { m_iAIEventType = iAIEventType; m_ProcessPriority = processPriority; }
/// <summary> /// 初始化时间片 /// </summary> /// <param name="delayTimeSpan">延迟的时间</param> public BaseAIEvent(long iAIEventType, AIProcessPriority processPriority) { m_iAIEventType = iAIEventType; m_ProcessPriority = processPriority; }
/// <summary> /// /// </summary> /// <param name="iTriggerType"></param> /// <param name="processPriority"></param> /// <returns></returns> public BaseAITrigger RegisterAITrigger( long iAIEventType, AIProcessPriority processPriority, TimeSpan expirationTimeSpan ) { BaseAITrigger l_newBaseAITrigger = new BaseAITrigger( iAIEventType, processPriority, expirationTimeSpan ); l_newBaseAITrigger.InternalSerial = m_AITriggerExclusiveSerial.GetExclusiveSerial(); Monitor.Enter( m_LockAITrigger ); { m_AITrigger.Add( l_newBaseAITrigger.AITriggerType, l_newBaseAITrigger ); } Monitor.Exit( m_LockAITrigger ); return l_newBaseAITrigger; }
/// <summary> /// 初始化时间片 /// </summary> /// <param name="delayTimeSpan">延迟的时间</param> public BaseAITrigger(long iAIEventType, AIProcessPriority processPriority) : this(iAIEventType, processPriority, TimeSpan.Zero) { }