private static void Logon() { var config = new JsonReader(ConfigurationManager.AppSettings["TCPConnector"].Replace('\'', '"')).Read(); ConnectorOptions options = new ConnectorOptions(config) { SecureRequest = SecureRequest.Show }; try { ClientGate.Logon(options); } catch (Exception ex) { if (ex.GetType() == typeof(TCPConnectorException)) { options.ForcePassword = true; ClientGate.Logon(options); } else { throw; } } }
public UnsubscribeTrigger(FeatureOptions options, ConnectorOptions connectorOptions, ISecretsService secretsService, IScheduleConnectorService scheduleConnectorService) { _options = options ?? throw new ArgumentNullException(nameof(options)); _secretsService = secretsService ?? throw new ArgumentNullException(nameof(secretsService)); _scheduleConnectorService = scheduleConnectorService ?? throw new ArgumentNullException(nameof(scheduleConnectorService)); _connectorOptions = connectorOptions ?? throw new ArgumentNullException(nameof(connectorOptions)); }
public static bool Logon(ConnectorOptions connectorOptions) { if (_connector != null && _connector.Connected) { return(true); } string userName = $@"{Environment.UserDomainName}\{Environment.UserName}"; bool isPrompt = false; var sInfo = CredentialManager.ReadCredential(_appName); bool forcePassword = connectorOptions.ForcePassword || sInfo == null || sInfo.Password.IsEmpty() || !connectorOptions.SavePassword; string password; if (forcePassword) { password = connectorOptions.SecureRequest(userName); if (password.IsEmpty()) { return(false); } isPrompt = true; } else { password = sInfo.Password; } _connector = TCPConnector.Create(connectorOptions); _connector.Connect(userName, password); if (isPrompt && connectorOptions.SavePassword) { CredentialManager.WriteCredential(_appName, userName, password); } return(true); }
public TeamHealthTrigger(ConnectorOptions options, ISecretsService secretsService, IScheduleSourceService scheduleSourceService, IScheduleConnectorService scheduleConnectorService, IScheduleDestinationService scheduleDestinationService, IScheduleCacheService scheduleCacheService) { _options = options ?? throw new ArgumentNullException(nameof(options)); _secretsService = secretsService ?? throw new ArgumentNullException(nameof(secretsService)); _scheduleSourceService = scheduleSourceService ?? throw new ArgumentNullException(nameof(scheduleSourceService)); _scheduleConnectorService = scheduleConnectorService ?? throw new ArgumentNullException(nameof(scheduleConnectorService)); _scheduleDestinationService = scheduleDestinationService ?? throw new ArgumentNullException(nameof(scheduleDestinationService)); _scheduleCacheService = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService)); }
public TeamHealthTrigger(FeatureOptions featureOptions, ConnectorOptions options, IWfmDataService wfmDataService, IScheduleConnectorService scheduleConnectorService, ITeamsService teamsService, IScheduleCacheService scheduleCacheService, ICacheService cacheService) { _featureOptions = featureOptions ?? throw new ArgumentNullException(nameof(featureOptions)); _options = options ?? throw new ArgumentNullException(nameof(options)); _wfmDataService = wfmDataService ?? throw new ArgumentNullException(nameof(wfmDataService)); _scheduleConnectorService = scheduleConnectorService ?? throw new ArgumentNullException(nameof(scheduleConnectorService)); _teamsService = teamsService ?? throw new ArgumentNullException(nameof(teamsService)); _scheduleCacheService = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService)); _cacheService = cacheService ?? throw new ArgumentNullException(nameof(cacheService)); }
public static ScheduleModel Create(ConnectorOptions options, string workforceIntegrationId, string timeZoneInfoId) { var model = new ScheduleModel { TimeZone = TZConvert.WindowsToIana(timeZoneInfoId), IsEnabled = true, TimeClockEnabled = options.TimeClockEnabled, OpenShiftsEnabled = options.OpenShiftsEnabled, SwapShiftsRequestsEnabled = options.SwapShiftsRequestsEnabled, OfferShiftRequestsEnabled = options.OfferShiftRequestsEnabled, TimeOffRequestsEnabled = options.TimeOffRequestsEnabled }; if (!string.IsNullOrEmpty(workforceIntegrationId)) { model.WorkforceIntegrationIds.Add(workforceIntegrationId); } return(model); }
public WeekOrchestrator(ConnectorOptions options) { _options = options ?? throw new ArgumentNullException(nameof(options)); }
public MicrosoftGraphAvailabilityMap(ConnectorOptions options, ISystemTimeService timeService) { _options = options ?? throw new ArgumentNullException(nameof(options)); _timeService = timeService ?? throw new ArgumentNullException(nameof(timeService)); }