public void OpenSettings()
        {
            try
            {
                // Open Settings and get response
                var settings = GetCurrentSettings();

                // Update/Save Settings
                var updatedSettings = Retrospection.Handler.GetInstance().OpenSettings(settings);

                if (updatedSettings.PopUpEnabled.HasValue)
                {
                    if (GetUserEfficiencyTracker() != null)
                    {
                        GetUserEfficiencyTracker().PopUpEnabled = updatedSettings.PopUpEnabled.Value;
                    }
                }
                if (updatedSettings.PopUpInterval.HasValue)
                {
                    if (GetUserEfficiencyTracker() != null)
                    {
                        GetUserEfficiencyTracker().PopUpIntervalInMins = TimeSpan.FromMinutes(updatedSettings.PopUpInterval.Value);
                    }
                }
                if (updatedSettings.UserInputTrackerEnabled.HasValue)
                {
                    if (GetUserInputTracker() != null)
                    {
                        GetUserInputTracker().UserInputTrackerEnabled = updatedSettings.UserInputTrackerEnabled.Value;
                    }
                }
                if (updatedSettings.TimeSpentShowEmailsEnabled.HasValue)
                {
                    if (GetTimeSpentVisualizerVisualizer() != null)
                    {
                        GetTimeSpentVisualizerVisualizer().TimeSpentShowEmailsEnabled = updatedSettings.TimeSpentShowEmailsEnabled.Value;
                    }
                }
                if (updatedSettings.TimeSpentShowProgramsEnabled.HasValue)
                {
                    if (GetTimeSpentVisualizerVisualizer() != null)
                    {
                        GetTimeSpentVisualizerVisualizer().TimeSpentShowProgramsEnabled = updatedSettings.TimeSpentShowProgramsEnabled.Value;
                    }
                }
                if (updatedSettings.OpenRetrospectionInFullScreen.HasValue)
                {
                    Retrospection.Handler.GetInstance().OpenRetrospectionInFullScreen = updatedSettings.OpenRetrospectionInFullScreen.Value;
                }
                if (updatedSettings.Office365ApiEnabled.HasValue)
                {
                    if (GetMSOfficeTracker() != null)
                    {
                        GetMSOfficeTracker().MsOfficeTrackerEnabled = updatedSettings.Office365ApiEnabled.Value;
                    }
                    //if (GetPeopleVisualizer() != null) GetPeopleVisualizer().PeopleVisualizerEnabled = updatedSettings.Office365ApiEnabled.Value;
                }
                if (updatedSettings.FlowLightEnabled.HasValue)
                {
                    FlowLight.Handler.GetInstance().FlowLightEnabled = updatedSettings.FlowLightEnabled.Value;
                }
                if (updatedSettings.FlowLightSkypeForBusinessEnabled.HasValue)
                {
                    FlowLight.Handler.GetInstance().SkypeForBusinessEnabled = updatedSettings.FlowLightSkypeForBusinessEnabled.Value;
                }
                if (updatedSettings.FlowLightAutomaticEnabled.HasValue)
                {
                    FlowLight.Handler.GetInstance().AutomaticEnabled = updatedSettings.FlowLightAutomaticEnabled.Value;
                }
                if (updatedSettings.FlowLightDnDEnabled.HasValue)
                {
                    FlowLight.Handler.GetInstance().DnDEnabled = updatedSettings.FlowLightDnDEnabled.Value;
                }
                if (updatedSettings.FlowLightSensitivityLevel.HasValue)
                {
                    FlowLight.Handler.GetInstance().SensitivityLevel = updatedSettings.FlowLightSensitivityLevel.Value;
                }
                if (updatedSettings.FlowLightBlacklist != null)
                {
                    GetFlowTracker().SetSetting_Application_Blacklist(updatedSettings.FlowLightBlacklist);
                }
                if (updatedSettings.PolarTrackerEnabled.HasValue)
                {
                    if (GetPolarTracker() != null)
                    {
                        GetPolarTracker().ChangeEnableState(updatedSettings.PolarTrackerEnabled);
                    }
                }

                if (updatedSettings.FitbitTrackerEnabled.HasValue)
                {
                    if (GetFitbitTracker() != null)
                    {
                        GetFitbitTracker().ChangeEnabledState(updatedSettings.FitbitTrackerEnabled);
                    }
                }

                if (updatedSettings.FitbitTokenRevoked.HasValue)
                {
                    FitbitConnector.RevokeAccessToken(SecretStorage.GetAccessToken());
                }
            }
            catch (Exception e)
            {
                Logger.WriteToLogFile(e);
            }
        }
        public void OpenSettings()
        {
            try
            {
                // Open Settings and get response
                var settings = GetCurrentSettings();

                // Update/Save Settings
                var updatedSettings = Retrospection.Handler.GetInstance().OpenSettings(settings);

                if (updatedSettings.PopUpEnabled.HasValue)
                {
                    if (GetUserEfficiencyTracker() != null)
                    {
                        GetUserEfficiencyTracker().PopUpEnabled = updatedSettings.PopUpEnabled.Value;
                    }
                }
                if (updatedSettings.PopUpInterval.HasValue)
                {
                    if (GetUserEfficiencyTracker() != null)
                    {
                        GetUserEfficiencyTracker().PopUpIntervalInMins = TimeSpan.FromMinutes(updatedSettings.PopUpInterval.Value);
                    }
                }
                if (updatedSettings.UserInputTrackerEnabled.HasValue)
                {
                    if (GetUserInputTracker() != null)
                    {
                        GetUserInputTracker().UserInputTrackerEnabled = updatedSettings.UserInputTrackerEnabled.Value;
                    }
                }
                if (updatedSettings.TimeSpentShowEmailsEnabled.HasValue)
                {
                    if (GetTimeSpentVisualizerVisualizer() != null)
                    {
                        GetTimeSpentVisualizerVisualizer().TimeSpentShowEmailsEnabled = updatedSettings.TimeSpentShowEmailsEnabled.Value;
                    }
                }
                if (updatedSettings.TimeSpentHideMeetingsWithoutAttendeesEnabled.HasValue)
                {
                    if (GetTimeSpentVisualizerVisualizer() != null)
                    {
                        GetTimeSpentVisualizerVisualizer().TimeSpentHideMeetingsWithoutAttendeesEnabled = updatedSettings.TimeSpentHideMeetingsWithoutAttendeesEnabled.Value;
                    }
                }
                if (updatedSettings.TimeSpentShowProgramsEnabled.HasValue)
                {
                    if (GetTimeSpentVisualizerVisualizer() != null)
                    {
                        GetTimeSpentVisualizerVisualizer().TimeSpentShowProgramsEnabled = updatedSettings.TimeSpentShowProgramsEnabled.Value;
                    }
                }
                if (updatedSettings.OpenRetrospectionInFullScreen.HasValue)
                {
                    Retrospection.Handler.GetInstance().OpenRetrospectionInFullScreen = updatedSettings.OpenRetrospectionInFullScreen.Value;
                }
                if (updatedSettings.Office365ApiEnabled.HasValue)
                {
                    if (GetMSOfficeTracker() != null)
                    {
                        GetMSOfficeTracker().MsOfficeTrackerEnabled = updatedSettings.Office365ApiEnabled.Value;
                    }
                    //if (GetPeopleVisualizer() != null) GetPeopleVisualizer().PeopleVisualizerEnabled = updatedSettings.Office365ApiEnabled.Value;
                }
                if (updatedSettings.PolarTrackerEnabled.HasValue)
                {
                    if (GetPolarTracker() != null)
                    {
                        GetPolarTracker().ChangeEnableState(updatedSettings.PolarTrackerEnabled);
                    }
                }

                if (updatedSettings.FitbitTrackerEnabled.HasValue)
                {
                    if (GetFitbitTracker() != null)
                    {
                        GetFitbitTracker().ChangeEnabledState(updatedSettings.FitbitTrackerEnabled);
                    }
                }

                if (updatedSettings.FitbitTokenRevoked.HasValue)
                {
                    FitbitConnector.RevokeAccessToken(SecretStorage.GetAccessToken());
                }
            }
            catch (Exception e)
            {
                Logger.WriteToLogFile(e);
            }
        }