GetTimer() public méthode

public GetTimer ( System.Guid timerGuid ) : JiraTimer
timerGuid System.Guid
Résultat JiraTimer
Exemple #1
0
        public Backend(InstanceType instanceType)
        {
            settingsCollection = SettingsCollectionSerializer.DeSerialize();
            trackUsage = new TrackUsage(settingsCollection.AppSettings, settingsCollection.InternalSettings, instanceType);
            versionControl = new VersionControl(instanceType, trackUsage);
            jiraTimerCollection = new JiraTimerCollection(settingsCollection.ExportSettings, trackUsage);
            jiraTimerCollection.exportPrompt += OnExportPromptEvent;
            jiraConnection = new JiraConnection(trackUsage);
            idleTimerCollection = new IdleTimerCollection();
            ActivityChecker = new ActivityChecker(jiraTimerCollection, settingsCollection.AppSettings);
            withThanksCreator = new WithThanksCreator();
            premiumChecker = new PremiumChecker();

            ActivityChecker.NoActivityEvent += OnNoActivityEvent;
            var cleanUpAndTrackingHearbeat = new Timer(TimeSpan.FromMinutes(15).TotalMilliseconds);
            cleanUpAndTrackingHearbeat.Elapsed += CleanUpAndTrackingHearbeatOnElapsed;
            cleanUpAndTrackingHearbeat.Start();

            exportedHeartbeatMutex = new Mutex(false);
            var jiraExportHearbeat = new Timer(TimeSpan.FromMinutes(10).TotalMilliseconds);
            jiraExportHearbeat.Elapsed += JiraExportHearbeatHearbeatOnElapsed;
            jiraExportHearbeat.Start();

            if (Settings.AppSettings.TimerRunningOnShutdown.HasValue)
            {
                var timer = jiraTimerCollection.GetTimer(Settings.AppSettings.TimerRunningOnShutdown.Value);
                if (timer != null && timer.DateStarted.Date == DateTime.Now.Date)
                {
                    JiraTimerCollection.StartTimer(Settings.AppSettings.TimerRunningOnShutdown.Value);
                }

                Settings.AppSettings.TimerRunningOnShutdown = null;
                SaveSettings(false);
            }
        }
Exemple #2
0
        public Backend(InstanceType instanceType, AppType appType)
        {
            settingsCollection = SettingsCollectionSerializer.DeSerialize();
            trackUsage = new TrackUsage(settingsCollection.AppSettings, settingsCollection.InternalSettings, instanceType, appType);
            versionControl = new VersionControl(instanceType, appType, trackUsage);
            jiraTimerCollection = new JiraTimerCollection(settingsCollection.ExportSettings);
            jiraTimerCollection.exportPrompt += OnExportPromptEvent;
            jiraConnection = new JiraConnection(trackUsage);
            idleTimerCollection = new IdleTimerCollection();
            ActivityChecker = new ActivityChecker(jiraTimerCollection, settingsCollection.AppSettings);
            ActivityChecker.NoActivityEvent += OnNoActivityEvent;
            hearbeat = new Timer(1800000);
            hearbeat.Elapsed += HearbeatOnElapsed;
            hearbeat.Start();

            if (Settings.AppSettings.TimerRunningOnShutdown.HasValue)
            {
                var timer = jiraTimerCollection.GetTimer(Settings.AppSettings.TimerRunningOnShutdown.Value);
                if (timer != null && timer.DateStarted.Date == DateTime.Now.Date)
                {
                    JiraTimerCollection.StartTimer(Settings.AppSettings.TimerRunningOnShutdown.Value);
                }

                Settings.AppSettings.TimerRunningOnShutdown = null;
                SaveSettings(false);
            }

            HearbeatOnElapsed(this, null);
        }