本文整理汇总了C#中ITrigger类的典型用法代码示例。如果您正苦于以下问题:C# ITrigger类的具体用法?C# ITrigger怎么用?C# ITrigger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITrigger类属于命名空间,在下文中一共展示了ITrigger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TriggerComplete
/// <summary>
/// Called by the <see cref="IScheduler" /> when a <see cref="ITrigger" />
/// has fired, it's associated <see cref="IJobDetail" />
/// has been executed, and it's <see cref="IOperableTrigger.Triggered" /> method has been
/// called.
/// </summary>
/// <param name="trigger"></param>
/// <param name="context"></param>
/// <param name="triggerInstructionCode"></param>
public void TriggerComplete(ITrigger trigger, IJobExecutionContext context, SchedulerInstruction triggerInstructionCode)
{
Logger.InfoFormat("TriggerComplete: {0}, {1}", trigger.Key.Name, trigger.Key.Group);
var auditLog = GetAuditLog(trigger, "TriggerComplete", context);
_persistanceStore.InsertAuditLog(auditLog);
}
示例2: AlarmBase
/// <summary>
/// Initializes a new instance of the AlarmBase class.
/// </summary>
/// <param name="action">Alarm action that should be triggered</param>
/// <param name="trigger">Trigger for this alarm</param>
protected AlarmBase(AlarmAction action, ITrigger trigger)
: base(VersitObjectType.VALARM)
{
this.Fields.Add(new Property<AlarmAction>("ACTION", action));
this.Fields.Add(new Duration("DURATION"));
this.Fields.Add(trigger);
}
示例3: TriggerMisfired
/// <summary>
/// Called by the Scheduler when a <see cref="ITrigger" /> has misfired.
/// </summary>
/// <param name="trigger"></param>
public void TriggerMisfired(ITrigger trigger)
{
Logger.InfoFormat("TriggerMisfired: {0}, {1}", trigger.Key.Name, trigger.Key.Group);
var auditLog = GetAuditLog(trigger, "TriggerMisfired");
_persistanceStore.InsertAuditLog(auditLog);
}
示例4: TriggerFired
public override void TriggerFired(ITrigger trigger, IJobExecutionContext context)
{
Log.DebugFormat("Trigger fired for job: {0} trigger key: {1}",
context.JobDetail.JobType,
trigger.Key.Name
);
}
示例5: MeetsCriteria
public bool MeetsCriteria(ITrigger trigger, object criteria)
{
Contract.Requires<ArgumentNullException>(trigger != null);
Contract.Requires<ArgumentNullException>(criteria != null);
throw new NotImplementedException();
}
示例6: TriggerComplete
public override void TriggerComplete(ITrigger trigger, IJobExecutionContext context, SchedulerInstruction triggerInstructionCode)
{
Log.TraceFormat("Trigger complete for job {0} with scheduler instruction {1}",
context.JobDetail.JobType,
triggerInstructionCode
);
}
示例7: RemoveTrigger
public void RemoveTrigger(string authKey, ITrigger trigger)
{
var profile = _profileRepository.GetProfile(authKey);
var triggerToRemove = profile.Triggers.Single(x => x.Id == trigger.Id);
profile.Triggers.Remove(triggerToRemove);
_profileRepository.Update(profile);
}
示例8: SetNextTrigger
private void SetNextTrigger(string id, ITrigger trigger, SchedulerCallback callback)
{
var milliSeconds = GetMilliSecondsToNextTrigger(trigger);
bool isNotIntermediateCallback = true;
long max = int.MaxValue * 2L;
if (milliSeconds > max)
{
isNotIntermediateCallback = false;
milliSeconds = max;
}
TimerCallback timerCallback = s =>
{
if (TimerIsNotCancelled(id))
{
if (isNotIntermediateCallback)
{
InvokeCallbackAndSetNextTrigger(id, trigger, callback);
}
else
{
SetNextTrigger(id, trigger, callback);
}
}
};
timers[id] = new System.Threading.Timer(timerCallback, null, milliSeconds, Timeout.Infinite);
}
示例9: TriggerFired
/// <summary>
/// Called by the Scheduler when a <see cref="ITrigger" /> has fired,
/// and it's associated JobDetail is about to be executed.
/// </summary>
/// <param name="trigger"></param>
/// <param name="context"></param>
public void TriggerFired(ITrigger trigger, IJobExecutionContext context)
{
Logger.InfoFormat("TriggerFired: {0}, {1}", trigger.Key.Name, trigger.Key.Group);
var auditLog = GetAuditLog(trigger, "TriggerFired", context);
_persistanceStore.InsertAuditLog(auditLog);
}
示例10: WithTrigger
public ConditionalTrigger WithTrigger(ITrigger trigger)
{
if (trigger == null) throw new ArgumentNullException(nameof(trigger));
trigger.Attach(ForwardTriggerEvent);
return this;
}
示例11: Create
public static TriggerDetailDto Create(ITrigger trigger, ICalendar calendar)
{
var simpleTrigger = trigger as ISimpleTrigger;
if (simpleTrigger != null)
{
return new SimpleTriggerDetailDto(simpleTrigger, calendar);
}
var cronTrigger = trigger as ICronTrigger;
if (cronTrigger != null)
{
return new CronTriggerDetailDto(cronTrigger, calendar);
}
var calendarIntervalTrigger = trigger as ICalendarIntervalTrigger;
if (calendarIntervalTrigger != null)
{
return new CalendarIntervalTriggerDetailDto(calendarIntervalTrigger, calendar);
}
var dailyTimeIntervalTrigger = trigger as IDailyTimeIntervalTrigger;
if (dailyTimeIntervalTrigger != null)
{
return new DailyTimeIntervalTriggerDetailDto(dailyTimeIntervalTrigger, calendar);
}
return new TriggerDetailDto(trigger, calendar);
}
示例12: AddTrigger
public void AddTrigger(ITrigger trigger)
{
if (trigger != null)
{
this.triggers.Add(trigger);
}
}
示例13: Add
///////////////////////////////////////////////////////////////////////
public void Add(ITrigger trigger)
{
lock (_triggers) {
trigger.Fire += SubTrigger_OnFire;
_triggers.Add(trigger);
}
}
示例14: ProjectIntegrator
public ProjectIntegrator(ITrigger trigger, IIntegratable integratable, IProject project)
{
_trigger = trigger;
_project = project;
_integratable = integratable;
this.resultManager = project.IntegrationResultManager;
}
示例15: UpdateTrigger
public void UpdateTrigger(string authKey, ITrigger trigger)
{
var profile = _profileRepository.GetProfile(authKey);
var index = profile.Triggers.IndexOf(profile.Triggers.Single(x => x.Id == trigger.Id));
profile.Triggers[index] = trigger;
_profileRepository.Update(profile);
}