当前位置: 首页>>代码示例>>C#>>正文


C# ITimer.Start方法代码示例

本文整理汇总了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);
        }
开发者ID:ArildF,项目名称:Smeedee,代码行数:33,代码来源:WorkingDaysLeftController.cs

示例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();
        }
开发者ID:ArildF,项目名称:Smeedee,代码行数:25,代码来源:TeamPictureViewModel.cs

示例3: SystemMetricsExecutor

        internal SystemMetricsExecutor(IList<SystemMetric> metrics, IVeStatsDClient client, ITimer timer)
        {
            _metrics = metrics;
            _client = client;
            _timer = timer;

            _timer.Elapsed += Invoke;
            _timer.Start();
        }
开发者ID:ve-interactive,项目名称:ve-metrics-statsdclient-csharp,代码行数:9,代码来源:SystemMetricsExecutor.cs

示例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);
        }
开发者ID:brunoklein99,项目名称:Klein.Wort,代码行数:10,代码来源:FakeWordTranslationManager.cs

示例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();
     
 }
开发者ID:ArildF,项目名称:Smeedee,代码行数:10,代码来源:ConfigurationManager.cs

示例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();
        }
开发者ID:randacc,项目名称:hdkn,代码行数:10,代码来源:AutoAddPlugin.cs

示例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);
        }
开发者ID:joilson-cisne,项目名称:xamarin,代码行数:11,代码来源:ProjectTrackerViewModel.cs

示例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();
        }
开发者ID:ArildF,项目名称:Smeedee,代码行数:42,代码来源:TeamMembersController.cs

示例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);
            });
        }
开发者ID:shawancyb,项目名称:VoiceTimeCounter,代码行数:37,代码来源:Performer.cs

示例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 ();
        }
开发者ID:nagyist,项目名称:TeaTimer,代码行数:15,代码来源:TeaTimer.cs


注:本文中的ITimer.Start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。