本文整理汇总了C#中ITimer类的典型用法代码示例。如果您正苦于以下问题:C# ITimer类的具体用法?C# ITimer怎么用?C# ITimer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITimer类属于命名空间,在下文中一共展示了ITimer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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());
}
示例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));
}
示例4: SolutionBuild
public SolutionBuild(ITimer timer, string configuration, ISolution solution)
: base(timer)
{
Solution = solution;
this.configuration = configuration;
projects = new List<IProjectBuild>();
}
示例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());
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例10: RssPlugin
public RssPlugin(IBitTorrentEngine torrentEngine, IDataRepository dataRepository, ITimerFactory timerFactory, IWebClient webClient)
{
_torrentEngine = torrentEngine;
_dataRepository = dataRepository;
_timer = timerFactory.CreateTimer();
_webClient = webClient;
}
示例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();
}
示例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);
}
}
示例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>());
}
示例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);
}
示例15: TaskScheduler
public TaskScheduler(ITimer timer, ITaskRunner taskRunner)
{
_timer = timer;
_taskRunner = taskRunner;
ProcessTimeout = 1000 * 60 * 10;
Granularity = 1000 * 5;
}