public void Init() { _fixture = new Fixture().Customize(new AutoRhinoMockCustomization()); _storage = _fixture.Create<IStateStorage>(); _accessorFactory = _fixture.Create<IStateAccessorFactory>(); _sut = new StateService(_storage); }
public void Ctor_NullStorage_ShouldThrowException() { // Arrange _storage = null; // Act _sut = new StateService(_storage, _accessorFactory); }
public void Ctor_ParameterLess_ShouldNotThrowException() { // Act _sut = new StateService(); // Assert Assert.IsNotNull("No exception"); }
public StateContextExtension(StateService stateService, StateRepository stateRepo, JqGridCustomCriteria<StateBoxMap, StateEntity> jqgridCriteria) { _stateRepo = stateRepo; _jqgridCriteria = jqgridCriteria; _stateService = stateService; }
public HttpProxyDecoratorBase( HttpProxyRepository repo, TaxonomyTree tree, StateService stateService, ILog log) { _repo = repo; _tree = tree; _stateService = stateService; _log = log; StoringDuration = TimeSpan.FromHours(3); //default storing duration 3 hours //one day RootDescriminatorStateTriggers = tree.GetOrCreatePath(STATE_TRIGGER_PATH, "Trigger to flush all Browsing cache"); }
public static void Main(string[] args) { StateService stateService = new StateService(); Console.WriteLine("Menu ....."); Console.WriteLine("1. Add A new State"); Console.WriteLine("2. Delete a State"); Console.WriteLine("3. Update a State"); int choice = Convert.ToInt32(Console.ReadLine()); switch (choice) { case 1: { State newState = new State(); Console.WriteLine("enter the State Id"); newState.StateId = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("enter the State Name"); newState.StateName = Console.ReadLine(); stateService.Add(newState); break; } case 2: { Console.WriteLine("enter the State Id"); int StateId = Convert.ToInt32(Console.ReadLine()); stateService.Delete(StateId); break; } case 3: { State updatedState = new State(); Console.WriteLine("enter the State Id"); updatedState.StateId = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("enter the State Name"); updatedState.StateName = Console.ReadLine(); stateService.update(updatedState); break; } } }
private void AutoFillStateId() { txtStateId.Text = StateService.GetStateId().ToString(); }
public void SignUp() { var result = MessageBox.Show( AppResources.ConfirmAgeMessage, AppResources.ConfirmAgeTitle, MessageBoxButton.OKCancel); if (result != MessageBoxResult.OK) { return; } IsWorking = true; NotifyOfPropertyChange(() => CanSignUp); MTProtoService.SignUpAsync( StateService.PhoneNumber, StateService.PhoneCodeHash, StateService.PhoneCode, new TLString(FirstName), new TLString(LastName), auth => BeginOnUIThread(() => { TLUtils.IsLogEnabled = false; TLUtils.LogItems.Clear(); result = MessageBox.Show( AppResources.ConfirmPushMessage, AppResources.ConfirmPushTitle, MessageBoxButton.OKCancel); if (result != MessageBoxResult.OK) { StateService.GetNotifySettingsAsync(settings => { var s = settings ?? new Settings(); s.ContactAlert = false; s.ContactMessagePreview = true; s.ContactSound = StateService.Sounds[0]; s.GroupAlert = false; s.GroupMessagePreview = true; s.GroupSound = StateService.Sounds[0]; s.InAppMessagePreview = true; s.InAppSound = true; s.InAppVibration = true; StateService.SaveNotifySettingsAsync(s); }); MTProtoService.UpdateNotifySettingsAsync( new TLInputNotifyUsers(), new TLInputPeerNotifySettings { EventsMask = new TLInt(1), MuteUntil = new TLInt(int.MaxValue), ShowPreviews = new TLBool(true), Sound = new TLString(StateService.Sounds[0]) }, r => { }); MTProtoService.UpdateNotifySettingsAsync( new TLInputNotifyChats(), new TLInputPeerNotifySettings { EventsMask = new TLInt(1), MuteUntil = new TLInt(int.MaxValue), ShowPreviews = new TLBool(true), Sound = new TLString(StateService.Sounds[0]) }, r => { }); } else { StateService.GetNotifySettingsAsync(settings => { var s = settings ?? new Settings(); s.ContactAlert = true; s.ContactMessagePreview = true; s.ContactSound = StateService.Sounds[0]; s.GroupAlert = true; s.GroupMessagePreview = true; s.GroupSound = StateService.Sounds[0]; s.InAppMessagePreview = true; s.InAppSound = true; s.InAppVibration = true; StateService.SaveNotifySettingsAsync(s); }); MTProtoService.UpdateNotifySettingsAsync( new TLInputNotifyUsers(), new TLInputPeerNotifySettings { EventsMask = new TLInt(1), MuteUntil = new TLInt(0), ShowPreviews = new TLBool(true), Sound = new TLString(StateService.Sounds[0]) }, r => { }); MTProtoService.UpdateNotifySettingsAsync( new TLInputNotifyChats(), new TLInputPeerNotifySettings { EventsMask = new TLInt(1), MuteUntil = new TLInt(0), ShowPreviews = new TLBool(true), Sound = new TLString(StateService.Sounds[0]) }, r => { }); } MTProtoService.SetInitState(); StateService.CurrentUserId = auth.User.Index; StateService.ClearNavigationStack = true; StateService.FirstRun = true; SettingsHelper.SetValue(Constants.IsAuthorizedKey, true); NavigationService.UriFor <ShellViewModel>().Navigate(); IsWorking = false; NotifyOfPropertyChange(() => CanSignUp); if (StateService.ProfilePhotoBytes != null) { var bytes = StateService.ProfilePhotoBytes; StateService.ProfilePhotoBytes = null; var fileId = TLLong.Random(); FileManager.UploadFile(fileId, new TLUserSelf(), bytes); } }), error => { IsWorking = false; NotifyOfPropertyChange(() => CanSignUp); if (error.TypeEquals(ErrorType.PHONE_NUMBER_INVALID)) { MessageBox.Show(AppResources.PhoneNumberInvalidString, AppResources.Error, MessageBoxButton.OK); } else if (error.TypeEquals(ErrorType.PHONE_CODE_INVALID)) { MessageBox.Show(AppResources.PhoneCodeInvalidString, AppResources.Error, MessageBoxButton.OK); } else if (error.TypeEquals(ErrorType.PHONE_CODE_EMPTY)) { MessageBox.Show(AppResources.PhoneCodeEmpty, AppResources.Error, MessageBoxButton.OK); } else if (error.TypeEquals(ErrorType.PHONE_CODE_EXPIRED)) { MessageBox.Show(AppResources.PhoneCodeExpiredString, AppResources.Error, MessageBoxButton.OK); ClearViewModel(); NavigationService.GoBack(); } else if (error.CodeEquals(ErrorCode.FLOOD)) { MessageBox.Show(AppResources.FloodWaitString, AppResources.Error, MessageBoxButton.OK); } else if (error.TypeEquals(ErrorType.FIRSTNAME_INVALID)) { MessageBox.Show(AppResources.FirstNameInvalidString, AppResources.Error, MessageBoxButton.OK); } else if (error.TypeEquals(ErrorType.LASTNAME_INVALID)) { MessageBox.Show(AppResources.LastNameInvalidString, AppResources.Error, MessageBoxButton.OK); } else { #if DEBUG MessageBox.Show(error.ToString()); #endif } }); }
public static void Init(HttpClientHandler httpClientHandler = null) { if (Inited) { return; } Inited = true; var platformUtilsService = Resolve <IPlatformUtilsService>("platformUtilsService"); var storageService = Resolve <IStorageService>("storageService"); var secureStorageService = Resolve <IStorageService>("secureStorageService"); var cryptoPrimitiveService = Resolve <ICryptoPrimitiveService>("cryptoPrimitiveService"); var i18nService = Resolve <II18nService>("i18nService"); var messagingService = Resolve <IMessagingService>("messagingService"); SearchService searchService = null; var stateService = new StateService(); var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService); var cryptoService = new CryptoService(storageService, secureStorageService, cryptoFunctionService); var tokenService = new TokenService(storageService); var apiService = new ApiService(tokenService, platformUtilsService, (bool expired) => Task.FromResult(0), httpClientHandler); var appIdService = new AppIdService(storageService); var userService = new UserService(storageService, tokenService); var settingsService = new SettingsService(userService, storageService); var cipherService = new CipherService(cryptoService, userService, settingsService, apiService, storageService, i18nService, () => searchService); var folderService = new FolderService(cryptoService, userService, apiService, storageService, i18nService, cipherService); var collectionService = new CollectionService(cryptoService, userService, storageService, i18nService); searchService = new SearchService(cipherService); var lockService = new LockService(cryptoService, userService, platformUtilsService, storageService, folderService, cipherService, collectionService, searchService, messagingService, null); var syncService = new SyncService(userService, apiService, settingsService, folderService, cipherService, cryptoService, collectionService, storageService, messagingService, () => messagingService.Send("logout")); var passwordGenerationService = new PasswordGenerationService(cryptoService, storageService, cryptoFunctionService); var totpService = new TotpService(storageService, cryptoFunctionService); var authService = new AuthService(cryptoService, apiService, userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService); // TODO: export service var auditService = new AuditService(cryptoFunctionService, apiService); var environmentService = new EnvironmentService(apiService, storageService); Register <IStateService>("stateService", stateService); Register <ICryptoFunctionService>("cryptoFunctionService", cryptoFunctionService); Register <ICryptoService>("cryptoService", cryptoService); Register <ITokenService>("tokenService", tokenService); Register <IApiService>("apiService", apiService); Register <IAppIdService>("appIdService", appIdService); Register <IUserService>("userService", userService); Register <ISettingsService>("settingsService", settingsService); Register <ICipherService>("cipherService", cipherService); Register <IFolderService>("folderService", folderService); Register <ICollectionService>("collectionService", collectionService); Register <ISearchService>("searchService", searchService); Register <ISyncService>("syncService", syncService); Register <ILockService>("lockService", lockService); Register <IPasswordGenerationService>("passwordGenerationService", passwordGenerationService); Register <ITotpService>("totpService", totpService); Register <IAuthService>("authService", authService); Register <IAuditService>("auditService", auditService); Register <IEnvironmentService>("environmentService", environmentService); }
public void set_async_throws_if_key_is_null() { var service = new StateService(new BlobCacheMock(), new LoggerServiceMock(MockBehavior.Loose)); Assert.ThrowsAsync <ArgumentNullException>(() => service.SetAsync <string>(null, "foo")).Wait(); }
public static void Init(string customUserAgent = null) { if (Inited) { return; } Inited = true; var platformUtilsService = Resolve <IPlatformUtilsService>("platformUtilsService"); var storageService = Resolve <IStorageService>("storageService"); var secureStorageService = Resolve <IStorageService>("secureStorageService"); var cryptoPrimitiveService = Resolve <ICryptoPrimitiveService>("cryptoPrimitiveService"); var i18nService = Resolve <II18nService>("i18nService"); var messagingService = Resolve <IMessagingService>("messagingService"); SearchService searchService = null; var stateService = new StateService(); var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService); var cryptoService = new CryptoService(storageService, secureStorageService, cryptoFunctionService); var tokenService = new TokenService(storageService); var apiService = new ApiService(tokenService, platformUtilsService, (bool expired) => { messagingService.Send("logout", expired); return(Task.FromResult(0)); }, customUserAgent); var appIdService = new AppIdService(storageService); var userService = new UserService(storageService, tokenService); var settingsService = new SettingsService(userService, storageService); var cipherService = new CipherService(cryptoService, userService, settingsService, apiService, storageService, i18nService, () => searchService); var folderService = new FolderService(cryptoService, userService, apiService, storageService, i18nService, cipherService); var collectionService = new CollectionService(cryptoService, userService, storageService, i18nService); searchService = new SearchService(cipherService); var vaultTimeoutService = new VaultTimeoutService(cryptoService, userService, platformUtilsService, storageService, folderService, cipherService, collectionService, searchService, messagingService, tokenService, null, (expired) => { messagingService.Send("logout", expired); return(Task.FromResult(0)); }); var policyService = new PolicyService(storageService, userService); var syncService = new SyncService(userService, apiService, settingsService, folderService, cipherService, cryptoService, collectionService, storageService, messagingService, policyService, (bool expired) => { messagingService.Send("logout", expired); return(Task.FromResult(0)); }); var passwordGenerationService = new PasswordGenerationService(cryptoService, storageService, cryptoFunctionService, policyService); var totpService = new TotpService(storageService, cryptoFunctionService); var authService = new AuthService(cryptoService, apiService, userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService, vaultTimeoutService); var exportService = new ExportService(folderService, cipherService); var auditService = new AuditService(cryptoFunctionService, apiService); var environmentService = new EnvironmentService(apiService, storageService); var eventService = new EventService(storageService, apiService, userService, cipherService); Register <IStateService>("stateService", stateService); Register <ICryptoFunctionService>("cryptoFunctionService", cryptoFunctionService); Register <ICryptoService>("cryptoService", cryptoService); Register <ITokenService>("tokenService", tokenService); Register <IApiService>("apiService", apiService); Register <IAppIdService>("appIdService", appIdService); Register <IUserService>("userService", userService); Register <ISettingsService>("settingsService", settingsService); Register <ICipherService>("cipherService", cipherService); Register <IFolderService>("folderService", folderService); Register <ICollectionService>("collectionService", collectionService); Register <ISearchService>("searchService", searchService); Register <IPolicyService>("policyService", policyService); Register <ISyncService>("syncService", syncService); Register <IVaultTimeoutService>("vaultTimeoutService", vaultTimeoutService); Register <IPasswordGenerationService>("passwordGenerationService", passwordGenerationService); Register <ITotpService>("totpService", totpService); Register <IAuthService>("authService", authService); Register <IExportService>("exportService", exportService); Register <IAuditService>("auditService", auditService); Register <IEnvironmentService>("environmentService", environmentService); Register <IEventService>("eventService", eventService); }
public void SetUp() { _repo = new Mock <IRepository <State> >(); _service = new StateService(_repo.Object); }
public StatesController(StateService service) { _service = service; }
public MainDialog(StateService stateService) : base(nameof(MainDialog)) { _stateService = stateService ?? throw new System.ArgumentNullException(nameof(stateService)); InitializeWaterfallDialog(); }
public MainWindowViewModel() { _searchResults = new ReactiveList <DirectoryEntryInfo>(); _history = new ReactiveList <string>(); Search = ReactiveCommand.Create( () => _searchQuery.IsIPAddress() ? Observable.FromAsync(() => NavigationService.ShowWindow <IPAddressWindow>(_searchQuery)).SelectMany(_ => Observable.Empty <DirectoryEntryInfo>()) : _adFacade.SearchDirectory(_searchQuery.Trim(), TaskPoolScheduler.Default).Take(1000).Select(directoryEntry => new DirectoryEntryInfo(directoryEntry)), this.WhenAnyValue(vm => vm.SearchQuery).Select(query => query.HasValue(3))); Search .Do(_ => _searchResults.Clear()) .Switch() .ObserveOnDispatcher() .Subscribe(directoryEntryInfo => _searchResults.Add(directoryEntryInfo)); Paste = ReactiveCommand.Create(() => { SearchQuery = Clipboard.GetText().Trim().ToUpperInvariant(); }); Open = ReactiveCommand.CreateFromTask( async() => { var principal = await _adFacade.GetPrincipal(_selectedSearchResult.CN); await NavigationService.ShowPrincipalWindow(principal); if (!_history.Contains(_selectedSearchResult.CN)) { _history.Insert(0, _selectedSearchResult.CN); } }, this.WhenAnyValue(vm => vm.SelectedSearchResult).IsNotNull()); OpenSettings = ReactiveCommand.CreateFromTask(() => NavigationService.ShowDialog <SettingsWindow>()); _isNoResults = Search .Select(searchResults => Observable.Concat( Observable.Return(false), searchResults.Aggregate(0, (acc, curr) => acc + 1).Select(resultCount => resultCount == 0))) .Switch() .ObserveOnDispatcher() .ToProperty(this, vm => vm.IsNoResults); Observable.Merge <(string Title, string Message)>( Search.ThrownExceptions.Select(ex => ("Could not complete search", ex.Message)), Paste.ThrownExceptions.Select(ex => ("Could not not paste text", ex.Message)), Open.ThrownExceptions.Select(ex => ("Could not open AD object", ex.Message)), OpenSettings.ThrownExceptions.Select(ex => ("Could not open settings", ex.Message))) .SelectMany(dialogContent => _messages.Handle(new MessageInfo(MessageType.Error, dialogContent.Message, dialogContent.Title))) .Subscribe(); StateService.Get(nameof(_history), Enumerable.Empty <string>()) .SubscribeOn(TaskPoolScheduler.Default) .ObserveOnDispatcher() .Subscribe(historyList => { using (_history.SuppressChangeNotifications()) _history.AddRange(historyList); }); _history.CountChanged .Throttle(TimeSpan.FromSeconds(1)) .SelectMany(_ => Observable.Start(() => StateService.Set(nameof(_history), _history.Take(Locator.Current.GetService <SettingsFacade>().HistoryCountLimit)), TaskPoolScheduler.Default)) .Subscribe(); SearchQuery = Environment.GetCommandLineArgs().Skip(1).FirstOrDefault(); }
private void BindTreeToZipCodes(RadTreeViewItem parentNode) { if (parentNode == null) { trvZipCodes.Items.Clear(); List <State> _states; try { _states = StateService.GetWithinDistance((float)_selectedDealer.Latitude, (float)_selectedDealer.Longitude, (float)_selectedDealer.MaxDistance); } catch { _states = StateService.GetActive(); } foreach (State _state in _states) { //ZipGeoCodeService.UpdateStatsForState(_state); RadTreeViewItem node = new RadTreeViewItem() { Header = _state.StateDescription }; node.DefaultImageSrc = "/Resources/folder.png"; node.Tag = "State"; if (_state.StateCode == _selectedDealer.StateCode) { node.IsExpanded = true; _selectedPath = _state.StateDescription; } else { node.IsExpanded = false; } trvZipCodes.Items.Add(node); //call recursively to add zip parts BindTreeToZipCodes(node); } //save while the form is open blnLoadStates = true; } else //parent node is not null - what level is it { if (((string)parentNode.Tag) == "State") { List <ZipCodePart> _zipParts = ZipCodePartService.GetForState(parentNode.Header.ToString().Substring(0, 2)); foreach (ZipCodePart _zipPart in _zipParts) { RadTreeViewItem node = new RadTreeViewItem() { Header = _zipPart.ZipPart }; node.Tag = "ZipPart"; parentNode.Items.Add(node); } if (parentNode.IsExpanded == true) { ((RadTreeViewItem)parentNode.Items[0]).IsSelected = true; _selectedPath += " | " + _zipParts[_zipParts.Count - 1].ZipPart; } } } }
public ChoiceKormsViewModel(NavigationService navigationService, IKormsService kormsService, StateService stateService) { _navigationService = navigationService; _kormsService = kormsService; _stateService = stateService; ChoiceKormDtos = _kormsService.GetAll() .Select(korm => new ChoiceKormDto { Id = korm.Id, Name = korm.Name, IsCheck = false, Cost = korm.Cost, Energy = korm.Energy, RawMaterial = korm.RawMaterial, Protein = korm.Protein }) .ToObservable(); NaviagationToChoiceEquantityKormsCommand = new RelayCommand(() => NaviagationToChoiceEquantityKorms()); NavigationToUserHomePageCommand = new RelayCommand(() => NavigationToUserHomePage()); }
public async Task <IHttpActionResult> GetStateByName(string stateName) => Ok(await StateService.GetByNameAsync(stateName));
public async Task <IHttpActionResult> GetState(int id) => Ok(await StateService.GetByIdAsync(id));
public ParallelHttpProxyDecorator(HttpProxyRepository repo, TaxonomyTree tree, StateService stateService, ILog log) : base(repo, tree, stateService, log) { proxySwitcher = new ParallelHttpProxyBrowsing(this); }
public GreetingBot(StateService stateService) { _stateService = stateService ?? throw new System.ArgumentNullException(nameof(stateService)); }
public async Task <IHttpActionResult> GetStates([FromUri] Pagination paginationModel) => Ok(await StateService.GetAllAsync(paginationModel.Page, paginationModel.PageSize));
public StateManager() { _stateService = new StateService(); }
public DialogBot(StateService stateService, T dialog, ILogger <DialogBot <T> > logger) { _stateService = stateService ?? throw new ArgumentNullException(nameof(stateService)); _dialog = dialog ?? throw new ArgumentNullException(nameof(dialog)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public StateBrowsingService(StateService stateService, StateRepository stateRepo) { _stateService = stateService; _stateRepo = stateRepo; }
public GreetingDialog(string dialogId, StateService stateService) : base(dialogId) { _botStateService = stateService ?? throw new System.ArgumentNullException(nameof(StateService)); InitializeWaterfallDialog(); }
public CallsSecurityViewModel(ICacheService cacheService, ICommonErrorHandler errorHandler, IStateService stateService, INavigationService navigationService, IMTProtoService mtProtoService, ITelegramEventAggregator eventAggregator) : base(cacheService, errorHandler, stateService, navigationService, mtProtoService, eventAggregator) { _callsSecurity = StateService.GetCallsSecurity(true); }
/// <summary> /// Transfers the client. /// </summary> /// <param name="identityProvider">The identity provider.</param> /// <param name="request">The request.</param> /// <param name="context">The context.</param> private void TransferClient(IdentityProvider identityProvider, Saml20AuthnRequest request, HttpContext context) { // Set the last IDP we attempted to login at. StateService.Set(IdpTempSessionKey, identityProvider.Id); // Determine which endpoint to use from the configuration file or the endpoint metadata. var destination = DetermineEndpointConfiguration(BindingType.Redirect, identityProvider.SignOnEndpoint, identityProvider.Metadata.SSOEndpoints); request.Destination = destination.Url; if (identityProvider.ForceAuth) { request.ForceAuthn = true; } // Check isPassive status var isPassiveFlag = StateService.Get <bool?>(IdpIsPassive); if (isPassiveFlag != null && (bool)isPassiveFlag) { request.IsPassive = true; StateService.Set(IdpIsPassive, null); } if (identityProvider.IsPassive) { request.IsPassive = true; } // Check if request should forceAuthn var forceAuthnFlag = StateService.Get <bool?>(IdpForceAuthn); if (forceAuthnFlag != null && (bool)forceAuthnFlag) { request.ForceAuthn = true; StateService.Set(IdpForceAuthn, null); } // Check if protocol binding should be forced if (identityProvider.SignOnEndpoint != null) { if (!string.IsNullOrEmpty(identityProvider.SignOnEndpoint.ForceProtocolBinding)) { request.ProtocolBinding = identityProvider.SignOnEndpoint.ForceProtocolBinding; } } // Save request message id to session StateService.Set(ExpectedInResponseToSessionKey, request.Id); switch (destination.Binding) { case BindingType.Redirect: Logger.DebugFormat(TraceMessages.AuthnRequestPrepared, identityProvider.Id, Saml20Constants.ProtocolBindings.HttpRedirect); var redirectBuilder = new HttpRedirectBindingBuilder { SigningKey = _certificate.PrivateKey, Request = request.GetXml().OuterXml }; Logger.DebugFormat(TraceMessages.AuthnRequestSent, redirectBuilder.Request); var redirectLocation = request.Destination + (request.Destination.Contains("?") ? "&" : "?") + redirectBuilder.ToQuery(); context.Response.Redirect(redirectLocation, true); break; case BindingType.Post: Logger.DebugFormat(TraceMessages.AuthnRequestPrepared, identityProvider.Id, Saml20Constants.ProtocolBindings.HttpPost); var postBuilder = new HttpPostBindingBuilder(destination); // Honor the ForceProtocolBinding and only set this if it's not already set if (string.IsNullOrEmpty(request.ProtocolBinding)) { request.ProtocolBinding = Saml20Constants.ProtocolBindings.HttpPost; } var requestXml = request.GetXml(); XmlSignatureUtils.SignDocument(requestXml, request.Id); postBuilder.Request = requestXml.OuterXml; Logger.DebugFormat(TraceMessages.AuthnRequestSent, postBuilder.Request); postBuilder.GetPage().ProcessRequest(context); break; case BindingType.Artifact: Logger.DebugFormat(TraceMessages.AuthnRequestPrepared, identityProvider.Id, Saml20Constants.ProtocolBindings.HttpArtifact); var artifactBuilder = new HttpArtifactBindingBuilder(context); // Honor the ForceProtocolBinding and only set this if it's not already set if (string.IsNullOrEmpty(request.ProtocolBinding)) { request.ProtocolBinding = Saml20Constants.ProtocolBindings.HttpArtifact; } Logger.DebugFormat(TraceMessages.AuthnRequestSent, request.GetXml().OuterXml); artifactBuilder.RedirectFromLogin(destination, request); break; default: Logger.Error(ErrorMessages.EndpointBindingInvalid); throw new Saml20Exception(ErrorMessages.EndpointBindingInvalid); } }
protected override void OnDeactivate(bool close) { base.OnDeactivate(close); StateService.SaveCallsSecurity(_callsSecurity); }
public void register_save_callback_throws_if_save_task_factory_is_null() { var service = new StateService(new BlobCacheMock(), new LoggerServiceMock(MockBehavior.Loose)); Assert.Throws <ArgumentNullException>(() => service.RegisterSaveCallback(null)); }
public async Task <IHttpActionResult> PostState(StatePostDto state) { var newState = await StateService.AddAsync(state); return(CreatedAtRoute("StateRoute", new { id = newState.Id }, newState)); }
private void btnDelete_Click(object sender, EventArgs e) { lblResult.Text = StateService.Remove(stateId); StateService.ReadData(dgv); AutoFillStateId(); }
public HttpProxyDecorator(HttpProxyRepository repo, TaxonomyTree tree, StateService stateService, ILog log) : base(repo, tree, stateService, log) { Attempts = 0; }
/// <summary> /// Bind the States /// </summary> private void BindStates() { StateService stateService = new StateService(); StateQuery filters = new StateQuery(); // Parameters filters.Append(StateColumn.CountryCode, lstCountries.SelectedItem.Value); // Get States list TList<State> StatesList = stateService.Find(filters.GetParameters()); lstStateOption.DataSource = StatesList; lstStateOption.DataTextField = "Name"; lstStateOption.DataValueField = "Code"; lstStateOption.DataBind(); ListItem li = new ListItem("Apply to ALL States", "0"); lstStateOption.Items.Insert(0, li); }
// Initializes a new instance of the "WelcomeUserBot" class. public WelcomeUserBot(UserState userState, IMailService mailService, AppSettings appSetting, StateService stateService, BotServices botServices)//, IAppServices appServices { _userState = userState; this.mailService = mailService; //_appServices = appServices; _appSetting = appSetting; _stateService = stateService ?? throw new System.ArgumentNullException(nameof(stateService)); _botServices = botServices ?? throw new System.ArgumentNullException(nameof(stateService)); }
public void GivenIHaveAStateService() { _storage = new StateConcurrentStorage(); _stateService = new StateService(_storage); }
public MandalController() { _mandalService = new MandalService(); _stateService = new StateService(); _districtService = new DistrictService(); }
public BugReportDialog(string dialogId, StateService stateService) : base(dialogId) { _stateService = stateService ?? throw new ArgumentNullException(nameof(stateService)); InitializeWaterfallDialog(); }
public async Task <IHttpActionResult> DeleteState(int id) { await StateService.RemoveAsync(id); return(Ok()); }
public void Contacts() { StateService.GetContactsSettings(); NavigationService.UriFor <ContactsSecurityViewModel>().Navigate(); }
public StateBrowsingService(StateService stateService, StateRepository stateRepo) { _stateService = stateService; _stateRepo = stateRepo; }