public bool InitializeApplication(XafApplication winApplication, EndpointAddress endpointAddress, Binding binding) { System.Net.ServicePointManager.Expect100Continue = false; var clientDataServer = new OptimizedSecuredDataServerClient(binding, endpointAddress); ServerSecurityClient.CanUseCache = true; var securityClient = CreateServerSecurityClient(clientDataServer); securityClient.IsSupportChangePassword = true; XafDataContractResolver.AddToEndpoint(clientDataServer.ChannelFactory.Endpoint); winApplication.CreateCustomObjectSpaceProvider += (sender, e) => { XafApplication application = (XafApplication)sender; e.ObjectSpaceProviders.Add(CreateObjectSpaceProvider(clientDataServer, securityClient)); e.ObjectSpaceProviders.Add(CreateNonPersistentObjectSpaceProvider(application)); }; winApplication.Security = securityClient; if (DatabaseUpdateMode != DatabaseUpdateHandlerMode.None) { winApplication.DatabaseVersionMismatch += Application_DatabaseVersionMismatch; } return(true); }
protected virtual ServerSecurityClient CreateServerSecurityClient(OptimizedSecuredDataServerClient clientDataServer) { return(new ServerSecurityClient(clientDataServer, CreateClientInfoFactory())); }
protected virtual IObjectSpaceProvider CreateObjectSpaceProvider(OptimizedSecuredDataServerClient clientDataServer, ServerSecurityClient securityClient) { return(new DataServerObjectSpaceProvider(clientDataServer, securityClient)); }