本文整理汇总了C#中ITimer.Start方法的典型用法代码示例。如果您正苦于以下问题:C# ITimer.Start方法的具体用法?C# ITimer.Start怎么用?C# ITimer.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITimer
的用法示例。
在下文中一共展示了ITimer.Start方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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();
}
示例3: SystemMetricsExecutor
internal SystemMetricsExecutor(IList<SystemMetric> metrics, IVeStatsDClient client, ITimer timer)
{
_metrics = metrics;
_client = client;
_timer = timer;
_timer.Elapsed += Invoke;
_timer.Start();
}
示例4: FakeWordTranslationManager
public FakeWordTranslationManager(IWordTranslationProvider provider, ITimer timer)
{
if (provider == null) throw new ArgumentNullException(nameof(provider));
if (timer == null) throw new ArgumentNullException(nameof(timer));
_provider = provider;
_timer = timer;
_timer.Elapsed += (sender, args) => OnNewWords?.Invoke(this, _provider.Get(10));
_timer.Start(5000);
}
示例5: ConfigurationManager
public ConfigurationManager(ITimer timer, IAsyncRepository<Configuration> asyncRepository)
{
this.timer = timer;
timer.Start(REFRESH_INTERVAL_SECONDS * 1000);
this.asyncRepository = asyncRepository;
this.asyncRepository.GetCompleted += asyncRepository_GetCompleted;
timer.Elapsed += timer_Elapsed;
BeginGetConfigurations();
}
示例6: Load
public void Load()
{
int interval = _keyValueStore.Get("plugins.autoadd.updateInterval", 3000);
Logger.Info("Starting timer with {0}ms update interval", interval);
_timer = _timerFactory.CreateTimer();
_timer.SetCallback(interval, CheckFolders);
_timer.Start();
}
示例7: ProjectTrackerViewModel
public ProjectTrackerViewModel(ITimer timer)
{
_timer = timer;
AddCommand = new Command(addProject);
//ResetCommand = new Command(reset);
//ToggleCommand = new Command<Project>(toggleProject);
_timer.Start(TimeSpan.FromSeconds(1));
_timer.Elapsed += (sender, tickUtc) => _currentProject.Tick(tickUtc);
}
示例8: TeamMembersController
public TeamMembersController(
TeamMembersViewModel teamMembersViewModel,
TeamMembersSettingsViewModel teamMembersSettingsViewModel,
IRepository<Userdb> userdbRepository,
IRepository<Configuration> configRepo,
IPersistDomainModelsAsync<Configuration> configPersister,
IInvokeBackgroundWorker<IEnumerable<ProjectInfoServer>> asyncClient,
ILog logger,
ITimer timer,
IUIInvoker uiInvoker,
IProgressbar loadingNotifier, IMetadataService metadataService)
{
Guard.Requires<ArgumentException>(userdbRepository != null, "userdbRepository");
Guard.Requires<ArgumentException>(configRepo != null, "configRepository");
Guard.Requires<ArgumentException>(configPersister != null, "configPersisterRepository");
Guard.Requires<ArgumentException>(asyncClient != null, "asyncClient");
Guard.Requires<ArgumentException>(logger != null, "logger");
this.teamMembersViewModel = teamMembersViewModel;
this.teamMembersSettingsViewModel = teamMembersSettingsViewModel;
this.userdbRepository = userdbRepository;
this.metadataService = metadataService;
this.configRepository = configRepo;
this.configPersisterRepository = configPersister;
this.asyncClient = asyncClient;
this.logger = logger;
this.timer = timer;
this.uiInvoker = uiInvoker;
this.loadingNotifier = loadingNotifier;
timer.Start(REFRESH_INTERVAL);
timer.Elapsed += OnNotifiedToRefresh;
teamMembersSettingsViewModel.Save.AfterExecute += (s, e) => OnSave();
teamMembersSettingsViewModel.Refresh.AfterExecute += (s, e) => OnRefresh();
teamMembersSettingsViewModel.PropertyChanged += PropertyChanged;
configPersister.SaveCompleted += ConfigPersisterSaveCompleted;
LoadConfig();
LoadData();
}
示例9: Performer
public Performer(TimeSet timeSet)
{
this.TimeSet = timeSet;
currentSecond = this.TimeSet.Duration;
stages = this.TimeSet.ObservableStages.OrderByDescending(w => w.StagePoint).ToList();
//mxaStagePoint = stages.Max(w => w.StagePoint);
_readyCountDownCount = timeSet.SecendsToReady;
var tm = DependencyService.Get<ITimer>();
_heartBeatTimer = tm.New();
_readyCountDownTimer = tm.New();
_stageTimer = tm.New();
//var b = _heartBeatTimer.Equals(_readyCountDownTimer);
_heartBeatTimer.Interval = 1000;
_heartBeatTimer.OnTick(HeartBeats);
_readyCountDownTimer.Interval = 1000;
_readyCountDownTimer.OnTick((t) =>
{
ReadyCountDown(t, () =>
{
//stageTimer.Enabled = true;
//stageTimer.Start();
StartCountDown();
_heartBeatTimer.Enabled = true;
_heartBeatTimer.Start();
});
});
_stageTimer.Interval = 1000;
_stageTimer.OnTick((t) =>
{
StageCountDown(t);
});
}
示例10: StartNewTimer
/// <summary>
/// Starts the count down.
/// Gets the time interval corresponding to the selected option in the combo
/// </summary>
/// <author>Alexandra Marin</author>
private void StartNewTimer()
{
//Get the time
string varietyName = TeaChoicesCombo.DataSource.ObjectValueForItem (TeaChoicesCombo, TeaChoicesCombo.SelectedIndex).ToString(); //"Green tea"
TimeSpan time = teaOptions.GetDurationForTea(varietyName);
//Init a new counter
timer = new CountdownTimer (time, CountdownLabel, InfoLabel);
timer.Start ();
}