Esempio n. 1
0
        void PerformRegistrations()
        {
            IApplicationRegistration applicationRegistration = new ApplicationRegistration("Security Tester");

            applicationRegistration
            .RegisterComponent(
                (new ComponentRegistration <Authentication>(AUTHENTICATION_COMPONENT_NAME, applicationRegistration))
                .RegisterObservableEvent(AUTHENTICATION_EVENT_NAME, authentication => new Func <bool>(authentication.Verify))
                .RegisterObservableParameter(_isAdminVar.Name, authentication => authentication.AdministratorAccess)
                .RegisterObservableParameter(_accessRightsVar.Name, authentication => authentication.AccessRights)
                )
            .RegisterComponent(
                (new ComponentRegistration <SecurityCredential>("Security Credential Component", applicationRegistration))
                .RegisterObservableEvent("Credential Setup", securityCredential => new Action <string, string>(securityCredential.SetCredentials))
                .RegisterObservableEvent("Credential Input Validation", securityCredential => new Func <bool>(securityCredential.ValidateCredentialInput))

                );

            ISystemRegistration systemRegistration = new SystemRegistration("Security System");

            systemRegistration
            .RegisterApplication(applicationRegistration)
            .RegisterApplication(new ApplicationRegistration("Dummy Application"));


            ActivityManager.GetInstance().RegisterSystem(systemRegistration);
        }
Esempio n. 2
0
        public void Initialize()
        {
            IApplicationRegistration applicationRegistration = new ApplicationRegistration("Security Tester");

            applicationRegistration
            .RegisterComponent(
                (new ComponentRegistration <Authentication>("Authentication Component", applicationRegistration))
                .RegisterObservableEvent("Validation", authentication => new Func <bool>(authentication.Verify))
                .RegisterObservableParameter("Is Administrator", authentication => authentication.AdministratorAccess)
                .RegisterObservableParameter("Access Rights", authentication => authentication.AccessRights)
                )
            .RegisterComponent(
                (new ComponentRegistration <SecurityCredential>("Security Credential Component", applicationRegistration))
                .RegisterObservableEvent("Credential Setup", securityCredential => new Action <string, string>(securityCredential.SetCredentials))
                .RegisterObservableEvent("Credential Input Validation", securityCredential => new Func <bool>(securityCredential.ValidateCredentialInput))

                );

            ISystemRegistration systemRegistration = new SystemRegistration("Security System");

            systemRegistration
            .RegisterApplication(applicationRegistration)
            .RegisterApplication(new ApplicationRegistration("Dummy Application"));


            ActivityManager.GetInstance().RegisterSystem(systemRegistration);
        }