Пример #1
0
        /// <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();
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
        /// <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();
            }
        }
Пример #4
0
 /// <summary>
 /// 初始化时间片
 /// </summary>
 /// <param name="delayTimeSpan">延迟的时间</param>
 public BaseAITrigger( long iAIEventType, AIProcessPriority processPriority )
     : this( iAIEventType, processPriority, TimeSpan.Zero )
 {
 }
Пример #5
0
 /// <summary>
 /// 初始化时间片
 /// </summary>
 /// <param name="delayTimeSpan">延迟的时间</param>
 public BaseAIEvent( long iAIEventType, AIProcessPriority processPriority )
 {
     m_iAIEventType = iAIEventType;
     m_ProcessPriority = processPriority;
 }
Пример #6
0
 /// <summary>
 /// 初始化时间片
 /// </summary>
 /// <param name="delayTimeSpan">延迟的时间</param>
 public BaseAIEvent(long iAIEventType, AIProcessPriority processPriority)
 {
     m_iAIEventType    = iAIEventType;
     m_ProcessPriority = processPriority;
 }
Пример #7
0
        /// <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;
        }
Пример #8
0
 /// <summary>
 /// 初始化时间片
 /// </summary>
 /// <param name="delayTimeSpan">延迟的时间</param>
 public BaseAITrigger(long iAIEventType, AIProcessPriority processPriority)
     : this(iAIEventType, processPriority, TimeSpan.Zero)
 {
 }