本文整理汇总了C#中ITimer类的典型用法代码示例。如果您正苦于以下问题:C# ITimer类的具体用法?C# ITimer怎么用?C# ITimer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITimer类属于命名空间,在下文中一共展示了ITimer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GraphController
public GraphController(Graph viewModel,
IDownloadStringService downloadStringService,
ITimer timer,
Configuration configuration,
IProgressbar progressbarService)
{
Guard.Requires<ArgumentNullException>(viewModel != null);
Guard.Requires<ArgumentNullException>(downloadStringService != null);
Guard.Requires<ArgumentNullException>(timer != null);
Guard.Requires<ArgumentNullException>(progressbarService != null);
Guard.Requires<ArgumentNullException>(configuration != null);
graphConfig = new GraphConfig(configuration);
Guard.Requires<ArgumentException>(graphConfig.IsValid, graphConfig.ErrorMsg);
this.ViewModel = viewModel;
ViewModel.Refresh.AfterExecute += new EventHandler(Refresh_AfterExecute);
this.downloadStringService = downloadStringService;
this.timer = timer;
this.timer.Elapsed += new EventHandler(timer_Elapsed);
this.progressbarService = progressbarService;
StartFetchingDataInBackground();
DownloadDataAndAddToViewModel();
}
开发者ID:ArildF,项目名称:Smeedee,代码行数:27,代码来源:GraphController.cs
示例2: SipInviteServerDialog
public SipInviteServerDialog(
ISipTransaction transaction,
SipDialogTable dialogTable,
ITimerFactory timerFactory,
SipHeaderFactory headerFactory,
SipMessageFactory messageFactory,
SipAddressFactory addressFactory,
ISipMessageSender messageSender,
ISipListener listener,
IPEndPoint listeningPoint)
: base(headerFactory, messageFactory, addressFactory, messageSender, listener, listeningPoint, transaction)
{
Check.Require(transaction, "transaction");
Check.Require(dialogTable, "dialogTable");
Check.Require(timerFactory, "timerFactory");
_logger = NLog.LogManager.GetCurrentClassLogger();
_dialogTable = dialogTable;
_state = DialogState.Null;
_timerFactory = timerFactory;
//(only ?) localtag is set on firstresponse
//localtarget is not defined, because is has no use, (every user agent knows it local address)
_retransmitOkTimer = _timerFactory.CreateInviteCtxRetransmitTimer(OnOkReTransmit);
//_endWaitForAckTimer = _timerFactory.CreateInviteCtxTimeOutTimer(OnWaitForAckTimeOut);
if (_logger.IsInfoEnabled) _logger.Info("ServerDialog[Id={0}] created.", GetId());
}
开发者ID:HNeukermans,项目名称:Hallo,代码行数:30,代码来源:SipInviteServerDialog.cs
示例3: hide_the_splash_screen
public hide_the_splash_screen(ITimer timer, ISplashScreenView view, ISplashScreenPresenter presenter)
{
this.timer = timer;
this.view = view;
this.presenter = presenter;
timer.start_notifying(presenter, new TimeSpan(50));
}
开发者ID:mokhan,项目名称:mo.money,代码行数:7,代码来源:hide_the_splash_screen.cs
示例4: SolutionBuild
public SolutionBuild(ITimer timer, string configuration, ISolution solution)
: base(timer)
{
Solution = solution;
this.configuration = configuration;
projects = new List<IProjectBuild>();
}
开发者ID:jonaskje,项目名称:BuildMonitor,代码行数:7,代码来源:SolutionBuild.cs
示例5: Aktivitetsdetektor
public Aktivitetsdetektor(ITimer timer, IAnvändaraktivitet användaraktivitet, IStrömspararkontroll strömspararkontroll)
{
timer.Tick += (s, e) =>
{
if (användaraktivitet.ÄrAktiv())
{
if (!_aktivEventKastat)
{
AktivitetUpptäckt(this, new EventArgs());
_aktivEventKastat = true;
_inaktivEventKastat = false;
}
}
else
{
if (!_inaktivEventKastat)
{
InaktivitetUpptäckt(this, new EventArgs());
_inaktivEventKastat = true;
_aktivEventKastat = false;
}
}
};
strömspararkontroll.GårNerIStrömsparläge += (s, e) => InaktivitetUpptäckt(this, new EventArgs());
}
开发者ID:fredrikakesson,项目名称:Activity-Monitor,代码行数:26,代码来源:Aktivitetsdetektor.cs
示例6: BasePlayer
public BasePlayer(IPlayerSettings playerSettings, IPhysicsComponent physicsComponent, IBoundaryCollider boundaryCollider, IWeapons weapons, ITimer timer)
{
this.PlayerSettings = playerSettings;
this.PlayerScore = new PlayerScore();
if (physicsComponent == null)
this.PhysicsComponent = new DummyPhysicsComponent();
else
this.PhysicsComponent = physicsComponent;
this.PhysicsComponent.CollidedWithWorld += () => InContactWithLevel = true;
this.PhysicsComponent.WasShot += Damage;
this.Weapons = weapons;
this.Weapons.DamagedAPlayer += (damage, physicsComp) => physicsComp.OnWasShot(this, damage);
this.Timer = timer;
this.BoundaryCollider = boundaryCollider;
this.Health = BasePlayer.StartHealth;
this.Status = PlayerStatus.Alive;
this.Position = new Vector2(400, 100);
this.PhysicsComponent.CollisionGroup = BasePlayer.CollisionGroup;
}
开发者ID:zakvdm,项目名称:Frenetic,代码行数:25,代码来源:BasePlayer.cs
示例7: WorkingDaysLeftController
public WorkingDaysLeftController(
WorkingDaysLeftViewModel leftViewModel,
WorkingDaysLeftSettingsViewModel settingsViewModel,
IAsyncRepository<ProjectInfoServer> projectInforepository,
IAsyncRepository<Holiday> holidayRepository,
ITimer refreshNotifier,
ILog logger,
IProgressbar loadingNotifier,
Configuration config)
{
this.leftViewModel = leftViewModel;
this.settingsViewModel = settingsViewModel;
this.holidayRepository = holidayRepository;
this.projectInforepository = projectInforepository;
this.logger = logger;
this.loadingNotifier = loadingNotifier;
this.refreshNotifier = refreshNotifier;
this.Rand = new Random((int)DateTime.Now.Ticks).Next();
projectInforepository.GetCompleted += GotProjectInfo;
holidayRepository.GetCompleted += GotHolidays;
this.settingsViewModel.RefreshAvailableServers.ExecuteDelegate = OnRefreshAvailableServers;
this.settingsViewModel.ReloadSettings.ExecuteDelegate = settingsViewModel.Reset;
refreshNotifier.Elapsed += refreshNotifier_Elapsed;
settingsViewModel.PropertyChanged += RefreshAvailableProjectsWhenSelectedServerChanges;
refreshNotifier.Start(10000);
OnRefreshAvailableServers();
SetConfigAndUpdate(config);
}
开发者ID:ArildF,项目名称:Smeedee,代码行数:33,代码来源:WorkingDaysLeftController.cs
示例8: CorkboardController
public CorkboardController(CorkboardViewModel viewModel,
CorkboardSettingsViewModel settingsViewModel,
IRepository<RetrospectiveNote> retrospectiveNoteRepository,
IPersistDomainModelsAsync<RetrospectiveNote> persistRetrospectiveNoteRepository,
IDeleteDomainModelsAsync<RetrospectiveNote> deleteRetrospectiveNoteRepository,
ITimer timer,
IUIInvoker uiInvoker,
IInvokeBackgroundWorker asyncClient,
ILog logger,
IProgressbar progressbar,
Configuration config
)
{
_viewModel = viewModel;
_settingsViewModel = settingsViewModel;
_asyncClient = asyncClient;
_repository = retrospectiveNoteRepository;
_persistRepository = persistRetrospectiveNoteRepository;
_uiInvoker = uiInvoker;
_refreshNotifier = timer;
_logger = logger;
_progressBar = progressbar;
_currentConfig = config;
_deleteRepository = deleteRetrospectiveNoteRepository;
_persistRepository.SaveCompleted += PersisterSaveCompleted;
_refreshNotifier.Elapsed += (o, e) => UpdateViewModels();
_settingsViewModel.Save.ExecuteDelegate = Save;
_settingsViewModel.ReloadSettings.ExecuteDelegate = ReloadSettings;
UpdateViewModels();
}
开发者ID:ArildF,项目名称:Smeedee,代码行数:34,代码来源:CorkboardController.cs
示例9: PeriodicTask
public PeriodicTask(Action action, ITimer timer) {
if (action == null) throw new ArgumentNullException("action");
if (timer == null) throw new ArgumentNullException("timer");
_action = action;
_timer = timer;
_isDisposed = false;
}
开发者ID:DavidLievrouw,项目名称:Nancy.Session.InProc,代码行数:7,代码来源:PeriodicTask.cs
示例10: RssPlugin
public RssPlugin(IBitTorrentEngine torrentEngine, IDataRepository dataRepository, ITimerFactory timerFactory, IWebClient webClient)
{
_torrentEngine = torrentEngine;
_dataRepository = dataRepository;
_timer = timerFactory.CreateTimer();
_webClient = webClient;
}
开发者ID:randacc,项目名称:hdkn,代码行数:7,代码来源:RssPlugin.cs
示例11: TeamPictureViewModel
public TeamPictureViewModel(
IRepository<DomainModel.TeamPicture.TeamPicture> teamPictureRepository,
IPersistDomainModelsAsync<DomainModel.TeamPicture.TeamPicture> teamPicturePersister,
ITimer refreshTimer,
IInvokeBackgroundWorker<IEnumerable<DomainModel.TeamPicture.TeamPicture>> backgroundWorker,
ILog log,
IWebcamService webcam,
IProgressbar progressbarService)
: this()
{
_teamPictureRepository = teamPictureRepository;
_teamPicturePersister = teamPicturePersister;
_refreshTimer = refreshTimer;
_backgroundWorker = backgroundWorker;
_log = log;
_webcamService = webcam;
_webcamService.CaptureImageCompleted += ImageCapturedFromWebCam;
_refreshTimer.Start(REFRESH_INTERVAL);
_progressbarService = progressbarService;
_refreshTimer.Elapsed += _refreshTimer_Elapsed;
_teamPicturePersister.SaveCompleted += ConfigPersisterSaveCompleted;
LoadDataFromDatabaseIntoViewModel();
}
开发者ID:ArildF,项目名称:Smeedee,代码行数:25,代码来源:TeamPictureViewModel.cs
示例12: RaiseFakeTimerEvents
public void RaiseFakeTimerEvents(int numEvents, ITimer fakeTimer)
{
for (int eventCount = 1; eventCount <= numEvents; eventCount++)
{
fakeTimer.Raise(x => x.Elapsed += null, fakeTimer, new EventArgs() as ElapsedEventArgs);
}
}
开发者ID:claresudbery,项目名称:XpManLiftKata,代码行数:7,代码来源:TimerTestHelper.cs
示例13: CreateTimerCommandFactory
internal static TimerCommandFactory CreateTimerCommandFactory(IGeneralRegisters generalRegisters = null,
ITimer delayTimer = null, ITimer soundTimer = null)
{
return new TimerCommandFactory(generalRegisters ?? Substitute.For<IGeneralRegisters>(),
delayTimer ?? Substitute.For<ITimer>(),
soundTimer ?? Substitute.For<ITimer>());
}
开发者ID:valmaev,项目名称:wonky-chip-8,代码行数:7,代码来源:TimerCommandFactoryFixture.cs
示例14: Initialize
public static void Initialize(
IConsole console,
ISurface surface,
IStyle style,
IDrawings drawing,
IShapes shapes,
IImages images,
IControls controls,
ISounds sounds,
IKeyboard keyboard,
IMouse mouse,
ITimer timer,
IFlickr flickr,
ISpeech speech,
CancellationToken token)
{
TextWindow.Init(console);
Desktop.Init(surface);
GraphicsWindow.Init(style, surface, drawing, keyboard, mouse);
Shapes.Init(shapes);
ImageList.Init(images);
Turtle.Init(surface, drawing, shapes);
Controls.Init(controls);
Sound.Init(sounds);
Timer.Init(timer);
Stack.Init();
Flickr.Init(flickr);
Speech.Init(speech);
Program.Init(token);
}
开发者ID:mrange,项目名称:funbasic,代码行数:30,代码来源:_Library.cs
示例15: TaskScheduler
public TaskScheduler(ITimer timer, ITaskRunner taskRunner)
{
_timer = timer;
_taskRunner = taskRunner;
ProcessTimeout = 1000 * 60 * 10;
Granularity = 1000 * 5;
}
开发者ID:simax,项目名称:EmbeddedTaskScheduler,代码行数:8,代码来源:TaskScheduler.cs
示例16: SetUp
protected override void SetUp()
{
timer = NewMock<ITimer>();
clock = NewMock<IClock>();
eventFactory = NewMock<IScheduledEventFactory>();
scheduler = new Scheduler(clock, timer, eventFactory);
}
开发者ID:EwenH,项目名称:vicfirereader,代码行数:8,代码来源:SchedulerTests.cs
示例17: SimpleTimerLiftEngine
public SimpleTimerLiftEngine(ITimer timer)
{
_myTimer = timer;
MakeTimerKeepFiringForTheLifeOfThisObject();
_moving = false;
}
开发者ID:vincelee888,项目名称:XpManLiftKata,代码行数:8,代码来源:SimpleTimerLiftEngine.cs
示例18: ProcessPerformer
public ProcessPerformer(IMessenger messenger, ITimer timer, IProcessLoader processLoader)
{
_messenger = messenger;
_timer = timer;
_processLoader = processLoader;
_processes = new List<IProcess>();
}
开发者ID:wurdum,项目名称:mops,代码行数:8,代码来源:ProcessPerformer.cs
示例19: TimerBasedScheduler
public TimerBasedScheduler(ITimer timer, ITimeProvider timeProvider)
{
Ensure.NotNull(timer, "timer");
Ensure.NotNull(timeProvider, "timeProvider");
_timer = timer;
_timeProvider = timeProvider;
}
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:8,代码来源:TimerBasedScheduler.cs
示例20: OddSecondHandler
public static void OddSecondHandler(ITimer toHandle)
{
if (toHandle.ElapsedSeconds % 2 == 0)
{
var msg = string.Format("{0} seconds have passed, which is even.", toHandle.ElapsedSeconds);
Console.WriteLine(msg);
}
}
开发者ID:jduv,项目名称:WOS-Advanced-CSharp-Winter-2013,代码行数:8,代码来源:Program.cs
注:本文中的ITimer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论