本文整理汇总了C#中TimerType类的典型用法代码示例。如果您正苦于以下问题:C# TimerType类的具体用法?C# TimerType怎么用?C# TimerType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimerType类属于命名空间,在下文中一共展示了TimerType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: create
public static HRTimer create(TimerType type)
{
HRTimer timer = null;
switch (type)
{
case TimerType.DEFAULT:
{
timer = new DefaultTimer();
break;
}
case TimerType.MULTI_MEDIA:
{
timer = new MultiMediaTimer();
break;
}
case TimerType.TIMER_QUEUE:
{
timer = new TimerQueueTimer();
break;
}
}
return (timer);
}
示例2: PutTimerType
public async Task<IHttpActionResult> PutTimerType(int id, TimerType timerType)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
if (id != timerType.TimerTypeID)
{
return BadRequest();
}
db.Entry(timerType).State = EntityState.Modified;
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!TimerTypeExists(id))
{
return NotFound();
}
else
{
throw;
}
}
return StatusCode(HttpStatusCode.NoContent);
}
示例3: CreateTimer
public Timer CreateTimer(float duration, TimerType type = TimerType.Once, int times = -1)
{
++timerid;
Timer t = new Timer(duration, timerid, type, times);
timers.Add(timerid, t);
return t;
}
示例4: Timer
public Timer(float time, float time2)
{
Time1 = time;
Time2 = time2;
MyType = TimerType.RANDOM_TWO_CONSTANTS;
Reset();
}
示例5: Add
public static Timer Add(TimerType timerType, TimerCycles timerCycles, double timerLength)
{
string timerID = Guid.NewGuid().ToString();
Timer timer = Add(timerID, timerType, timerCycles, timerLength);
timer.TimerID = timerID;
return timer;
}
示例6: Event
public Event(object actor, int delay, TimerType type, string method, object[] arguments)
{
Actor = actor;
Delay = delay;
Type = type;
Method = method;
Arguments = arguments;
}
示例7: Timer
internal Timer(TimerType timerType, TimerCycles timerCycles, long startTick, double len)
{
Type = timerType;
Cycles = timerCycles;
StartTick = startTick;
LastEventTick = startTick;
Length = (long)(len * (double)HighResTimer.TicksPerSecond);
Paused = false;
}
示例8: Timer
public Timer(float duration, int timerId, TimerType type = TimerType.Once, int times = -1)
{
countDown = 0.0f;
this.duration = duration;
this.timerId = timerId;
this.type = type;
state = Phase.NeverStart;
this.times = times;
}
示例9: GetTimer
public static ITimer GetTimer(TimerType timerType)
{
switch (timerType)
{
case TimerType.Inverted:
return new FwTimer(1, TimerType.Inverted);
default:
return new FwTimer(1, TimerType.Normal);
}
}
示例10: Timer
public Timer(double duration, TimerType timerType, string parameter, bool failContract)
: base("")
{
this.duration = duration;
this.timerType = timerType;
this.parameter = parameter;
this.fakeFailures = !failContract;
disableOnStateChange = false;
}
示例11: TimerElement
public TimerElement (string text, float duration, TimerType type, System.Action onEnd=null) {
Text = text;
this.duration = duration
#if FAST_TIME
* 0.1f
#endif
;
this.type = type;
this.onEnd = onEnd;
Reset ();
}
示例12: FwTimer
public FwTimer()
{
// to be sure everything is initialized
_running = false;
_interval = DEFAULT_INTERVAL;
_timer = new Timer {AutoReset = false};
_timer.Elapsed += OnElapse;
_status = TimerLogStatus.Disabled;
_type = TimerType.Inverted;
_startTime = DateTime.Now;
_endTime = _startTime.AddSeconds(_interval);
}
示例13: PostTimerType
public async Task<IHttpActionResult> PostTimerType(TimerType timerType)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
db.TimerTypes.Add(timerType);
await db.SaveChangesAsync();
return CreatedAtRoute("DefaultApi", new { id = timerType.TimerTypeID }, timerType);
}
示例14: SetAffect
public void SetAffect(string name, Mob afflicted, Mob owner, TimerType durationType, int duration, bool tickmethod, bool endmethod)
{
Name = name;
HandlingName = name.ToLower().Trim();
Duration = duration;
DurationType = durationType;
Owner = owner;
Afflicted = afflicted;
Level = Owner.Level;
CanHasTickMethod = tickmethod;
CanHasEndMethod = endmethod;
}
示例15: StartTimer
static public void StartTimer (TimerType which)
{
timer_start [(int) which] = DateTime.Now;
}