Esempio n. 1
0
        static void Main() {
            
#if EASYTEST
			DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif
            
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            EditModelPermission.AlwaysGranted = Debugger.IsAttached;
            var winApplication =new SecuritySystemExampleWindowsFormsApplication();
            try {
                winApplication.ConnectionString = "http://localhost:1451/DataServer";
                XpandWcfDataServerHelper.AddKnownTypes();
                var defaultBinding = (WSHttpBinding) WcfDataServerHelper.CreateDefaultBinding();
                defaultBinding.ReaderQuotas.MaxStringContentLength = 2147483647;
                var clientDataServer = new WcfSecuredDataServerClient(
                    defaultBinding,
                    new EndpointAddress(winApplication.ConnectionString));
                var securityClient =new ServerSecurityClient(clientDataServer, new ClientInfoFactory()){IsSupportChangePassword = true};
                winApplication.ApplicationName = "SecuritySystemExample";
                winApplication.Security = securityClient;
                winApplication.CreateCustomObjectSpaceProvider +=
                    delegate(object sender, CreateCustomObjectSpaceProviderEventArgs e) {
                        e.ObjectSpaceProvider =new DataServerObjectSpaceProvider(clientDataServer, securityClient);
                    };

                winApplication.Setup();
                winApplication.Start();
                clientDataServer.Close();
            }
            catch (Exception e) {
                winApplication.HandleException(e);
            }
        }
Esempio n. 2
0
        protected void Session_End(Object sender, EventArgs e)
        {
            WebApplication.LogOff(Session);
            WebApplication.DisposeInstance(Session);
            WcfSecuredDataServerClient clientDataServer = (WcfSecuredDataServerClient)Session["DataServerClient"];

            if (clientDataServer != null)
            {
                clientDataServer.Close();
                Session["DataServerClient"] = null;
            }
        }
Esempio n. 3
0
        static void Main()
        {
#if EASYTEST
            DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            EditModelPermission.AlwaysGranted = Debugger.IsAttached;
            var winApplication = new SecuritySystemExampleWindowsFormsApplication();
            try {
                winApplication.ConnectionString = "http://localhost:1451/DataServer";
                XpandWcfDataServerHelper.AddKnownTypes();
                var defaultBinding = (WSHttpBinding)WcfDataServerHelper.CreateDefaultBinding();
                defaultBinding.ReaderQuotas.MaxStringContentLength = 2147483647;
                var clientDataServer = new WcfSecuredDataServerClient(
                    defaultBinding,
                    new EndpointAddress(winApplication.ConnectionString));
                var securityClient = new ServerSecurityClient(clientDataServer, new ClientInfoFactory())
                {
                    IsSupportChangePassword = true
                };
                winApplication.ApplicationName = "SecuritySystemExample";
                winApplication.Security        = securityClient;
                winApplication.CreateCustomObjectSpaceProvider +=
                    delegate(object sender, CreateCustomObjectSpaceProviderEventArgs e) {
                    e.ObjectSpaceProvider = new DataServerObjectSpaceProvider(clientDataServer, securityClient);
                };

                winApplication.UseOldTemplates = false;
                var worldCreatorTypeInfoSource = WorldCreatorTypeInfoSource.Instance;
                winApplication.Setup();
                winApplication.Start();
                clientDataServer.Close();
            }
            catch (Exception e) {
                winApplication.HandleException(e);
            }
        }