public BrowserApplicationInstance(
     AppConfig appConfig,
     BrowserSettings settings,
     int id,
     bool isMainInstance,
     IFileSystemDialog fileSystemDialog,
     IHashAlgorithm hashAlgorithm,
     IMessageBox messageBox,
     IModuleLogger logger,
     IText text,
     IUserInterfaceFactory uiFactory,
     string startUrl)
 {
     this.appConfig        = appConfig;
     this.Id               = id;
     this.httpClient       = new HttpClient();
     this.isMainInstance   = isMainInstance;
     this.fileSystemDialog = fileSystemDialog;
     this.hashAlgorithm    = hashAlgorithm;
     this.messageBox       = messageBox;
     this.logger           = logger;
     this.settings         = settings;
     this.text             = text;
     this.uiFactory        = uiFactory;
     this.startUrl         = startUrl;
 }
 internal ClientController(
     IActionCenter actionCenter,
     IApplicationMonitor applicationMonitor,
     ClientContext context,
     IDisplayMonitor displayMonitor,
     IExplorerShell explorerShell,
     IFileSystemDialog fileSystemDialog,
     IHashAlgorithm hashAlgorithm,
     ILogger logger,
     IMessageBox messageBox,
     IOperationSequence operations,
     IRuntimeProxy runtime,
     Action shutdown,
     ISplashScreen splashScreen,
     ITaskbar taskbar,
     IText text,
     IUserInterfaceFactory uiFactory)
 {
     this.actionCenter       = actionCenter;
     this.applicationMonitor = applicationMonitor;
     this.context            = context;
     this.displayMonitor     = displayMonitor;
     this.explorerShell      = explorerShell;
     this.fileSystemDialog   = fileSystemDialog;
     this.hashAlgorithm      = hashAlgorithm;
     this.logger             = logger;
     this.messageBox         = messageBox;
     this.operations         = operations;
     this.runtime            = runtime;
     this.shutdown           = shutdown;
     this.splashScreen       = splashScreen;
     this.taskbar            = taskbar;
     this.text      = text;
     this.uiFactory = uiFactory;
 }
 public ShellOperation(
     IActionCenter actionCenter,
     IAudio audio,
     INotificationInfo aboutInfo,
     INotificationController aboutController,
     ClientContext context,
     IKeyboard keyboard,
     ILogger logger,
     INotificationInfo logInfo,
     INotificationController logController,
     IPowerSupply powerSupply,
     ISystemInfo systemInfo,
     ITaskbar taskbar,
     ITaskview taskview,
     IText text,
     IUserInterfaceFactory uiFactory,
     IWirelessAdapter wirelessAdapter) : base(context)
 {
     this.aboutInfo       = aboutInfo;
     this.aboutController = aboutController;
     this.actionCenter    = actionCenter;
     this.audio           = audio;
     this.keyboard        = keyboard;
     this.logger          = logger;
     this.logInfo         = logInfo;
     this.logController   = logController;
     this.powerSupply     = powerSupply;
     this.systemInfo      = systemInfo;
     this.text            = text;
     this.taskbar         = taskbar;
     this.taskview        = taskview;
     this.uiFactory       = uiFactory;
     this.wirelessAdapter = wirelessAdapter;
 }
 internal RuntimeController(
     AppConfig appConfig,
     ILogger logger,
     IMessageBox messageBox,
     IOperationSequence bootstrapSequence,
     IRepeatableOperationSequence sessionSequence,
     IRuntimeHost runtimeHost,
     IRuntimeWindow runtimeWindow,
     IServiceProxy service,
     SessionContext sessionContext,
     Action shutdown,
     ISplashScreen splashScreen,
     IText text,
     IUserInterfaceFactory uiFactory)
 {
     this.appConfig         = appConfig;
     this.bootstrapSequence = bootstrapSequence;
     this.logger            = logger;
     this.messageBox        = messageBox;
     this.runtimeHost       = runtimeHost;
     this.runtimeWindow     = runtimeWindow;
     this.sessionSequence   = sessionSequence;
     this.service           = service;
     this.sessionContext    = sessionContext;
     this.shutdown          = shutdown;
     this.splashScreen      = splashScreen;
     this.text      = text;
     this.uiFactory = uiFactory;
 }
 public ClientController(
     IActionCenter actionCenter,
     IDisplayMonitor displayMonitor,
     IExplorerShell explorerShell,
     IHashAlgorithm hashAlgorithm,
     ILogger logger,
     IMessageBox messageBox,
     IOperationSequence operations,
     IProcessMonitor processMonitor,
     IRuntimeProxy runtime,
     Action shutdown,
     ITaskbar taskbar,
     ITerminationActivator terminationActivator,
     IText text,
     IUserInterfaceFactory uiFactory,
     IWindowMonitor windowMonitor)
 {
     this.actionCenter         = actionCenter;
     this.displayMonitor       = displayMonitor;
     this.explorerShell        = explorerShell;
     this.hashAlgorithm        = hashAlgorithm;
     this.logger               = logger;
     this.messageBox           = messageBox;
     this.operations           = operations;
     this.processMonitor       = processMonitor;
     this.runtime              = runtime;
     this.shutdown             = shutdown;
     this.taskbar              = taskbar;
     this.terminationActivator = terminationActivator;
     this.text          = text;
     this.uiFactory     = uiFactory;
     this.windowMonitor = windowMonitor;
 }
        public AnimatedCogsMenu(IGameObjectsFactory gameObjectsFactory, IUserInterfaceFactory interfaceFactory)
        {
            easingFunction = new GaussianFunction(0, 2f);

            this.gameObjectsFactory = gameObjectsFactory;
            largeCog = new LargeCog(gameObjectsFactory, interfaceFactory);
        }
Example #7
0
 public UserInterfaceComponent(
     IAssetManager assetManager,
     IUserInterfaceFactory userInterfaceFactory)
 {
     _assetManager          = assetManager;
     _userInterfaceFactory  = userInterfaceFactory;
     _behaviourRegistration = new List <Action <IUserInterfaceController> >();
 }
Example #8
0
        internal SEBContext(AppSettings settings)
        {
            appSettings   = settings;
            logger        = new Logger();
            hashAlgorithm = new HashAlgorithm();

            InitializeLogging();
            InitializeText();

            _dispatcher = Dispatcher.CurrentDispatcher;

            uiFactory  = new UserInterfaceFactory(text);
            messageBox = new MessageBoxFactory(text);

            taskbar = uiFactory.CreateTaskbar(logger);
            taskbar.QuitButtonClicked += Shell_QuitButtonClicked;
            taskbar.Show();

            workingAreaHandler = new WorkingAreaHandler(new ModuleLogger(logger, nameof(WorkingAreaHandler)));
            workingAreaHandler.InitializeWorkingArea(taskbar.GetAbsoluteHeight());

            taskview = uiFactory.CreateTaskview();

            var audioSettings = new AudioSettings();
            var audio         = new Audio(audioSettings, new ModuleLogger(logger, nameof(Audio)));

            audio.Initialize();
            taskbar.AddSystemControl(uiFactory.CreateAudioControl(audio, Location.Taskbar));

            var keyboard = new Keyboard(new ModuleLogger(logger, nameof(Keyboard)));

            keyboard.Initialize();
            taskbar.AddSystemControl(uiFactory.CreateKeyboardLayoutControl(keyboard, Location.Taskbar));

            var powerSupply = new PowerSupply(new ModuleLogger(logger, nameof(PowerSupply)));

            powerSupply.Initialize();
            taskbar.AddSystemControl(uiFactory.CreatePowerSupplyControl(powerSupply, Location.Taskbar));

            var wirelessAdapter = new WirelessAdapter(new ModuleLogger(logger, nameof(WirelessAdapter)));

            wirelessAdapter.Initialize();
            taskbar.AddSystemControl(uiFactory.CreateWirelessNetworkControl(wirelessAdapter, Location.Taskbar));

            browser = new BrowserApplication(appSettings, messageBox, true, new ModuleLogger(logger, nameof(BrowserApplication)), text);
            taskbar.AddApplicationControl(uiFactory.CreateApplicationControl(browser, Location.Taskbar), true);
            browser.TerminationRequested += () =>
            {
                Browser_TerminationRequested();
            };

            taskview.Add(browser);
            InitializeCef();
            foreach (string startUrl in appSettings.StartUrls)
            {
                browser.CreateNewInstance(startUrl);
            }
        }
Example #9
0
 public LevelScreen(IGameObjectsFactory gameObjectsFactory, IUserInterfaceFactory interfaceFactory,
     IMathFunctionsFactory functionsFactory, ICamera2D camera2D, IContentLoader contentLoader)
 {
     this.contentLoader = contentLoader;
     this.camera = camera2D;
     player = new Player();
     this.objectsFactory = gameObjectsFactory;
     scene2d = new Scene2D(gameObjectsFactory, new GameplayFactory(gameObjectsFactory), interfaceFactory);
     this.functionsFactory = functionsFactory;
 }
Example #10
0
        public LogNotification(ILogger logger, IText text, IUserInterfaceFactory uiFactory)
        {
            this.logger    = logger;
            this.text      = text;
            this.uiFactory = uiFactory;

            IconResource = new BitmapIconResource {
                Uri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Desktop;component/Images/LogNotification.ico")
            };
            Tooltip = text.Get(TextKey.Notification_LogTooltip);
        }
        public AboutNotification(AppConfig appConfig, IText text, IUserInterfaceFactory uiFactory)
        {
            this.appConfig = appConfig;
            this.text      = text;
            this.uiFactory = uiFactory;

            IconResource = new XamlIconResource {
                Uri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Desktop;component/Images/AboutNotification.xaml")
            };
            Tooltip = text.Get(TextKey.Notification_AboutTooltip);
        }
Example #12
0
 public BrowserOperation(
     IActionCenter actionCenter,
     IApplication browser,
     ILogger logger,
     ITaskbar taskbar,
     IUserInterfaceFactory uiFactory)
 {
     this.actionCenter = actionCenter;
     this.browser      = browser;
     this.logger       = logger;
     this.taskbar      = taskbar;
     this.uiFactory    = uiFactory;
 }
Example #13
0
 public BrowserOperation(
     IActionCenter actionCenter,
     ClientContext context,
     ILogger logger,
     ITaskbar taskbar,
     ITaskview taskview,
     IUserInterfaceFactory uiFactory) : base(context)
 {
     this.actionCenter = actionCenter;
     this.logger       = logger;
     this.taskbar      = taskbar;
     this.taskview     = taskview;
     this.uiFactory    = uiFactory;
 }
 public ProctoringOperation(
     IActionCenter actionCenter,
     ClientContext context,
     IProctoringController controller,
     ILogger logger,
     INotification notification,
     ITaskbar taskbar,
     IUserInterfaceFactory uiFactory) : base(context)
 {
     this.actionCenter = actionCenter;
     this.controller   = controller;
     this.logger       = logger;
     this.notification = notification;
     this.taskbar      = taskbar;
     this.uiFactory    = uiFactory;
 }
 public BrowserApplication(
     AppConfig appConfig,
     BrowserSettings settings,
     IMessageBox messageBox,
     IModuleLogger logger,
     IText text,
     IUserInterfaceFactory uiFactory)
 {
     this.appConfig  = appConfig;
     this.instances  = new List <BrowserApplicationInstance>();
     this.logger     = logger;
     this.messageBox = messageBox;
     this.settings   = settings;
     this.text       = text;
     this.uiFactory  = uiFactory;
 }
Example #16
0
        public ProctoringController(
            AppConfig appConfig,
            IFileSystem fileSystem,
            IModuleLogger logger,
            IServerProxy server,
            IText text,
            IUserInterfaceFactory uiFactory)
        {
            this.appConfig  = appConfig;
            this.fileSystem = fileSystem;
            this.logger     = logger;
            this.server     = server;
            this.text       = text;
            this.uiFactory  = uiFactory;

            IconResource = new XamlIconResource {
                Uri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Desktop;component/Images/ProctoringNotification_Inactive.xaml")
            };
            Tooltip = text.Get(TextKey.Notification_ProctoringInactiveTooltip);
        }
Example #17
0
 public BrowserApplicationInstance(
     AppConfig appConfig,
     BrowserSettings settings,
     InstanceIdentifier id,
     bool isMainInstance,
     IMessageBox messageBox,
     IModuleLogger logger,
     IText text,
     IUserInterfaceFactory uiFactory,
     string url)
 {
     this.appConfig      = appConfig;
     this.Id             = id;
     this.httpClient     = new HttpClient();
     this.isMainInstance = isMainInstance;
     this.messageBox     = messageBox;
     this.logger         = logger;
     this.settings       = settings;
     this.text           = text;
     this.uiFactory      = uiFactory;
     this.url            = url;
 }
Example #18
0
 public BrowserApplication(
     AppConfig appConfig,
     BrowserSettings settings,
     IFileSystemDialog fileSystemDialog,
     IHashAlgorithm hashAlgorithm,
     INativeMethods nativeMethods,
     IMessageBox messageBox,
     IModuleLogger logger,
     IText text,
     IUserInterfaceFactory uiFactory)
 {
     this.appConfig        = appConfig;
     this.fileSystemDialog = fileSystemDialog;
     this.hashAlgorithm    = hashAlgorithm;
     this.nativeMethods    = nativeMethods;
     this.instances        = new List <BrowserApplicationInstance>();
     this.logger           = logger;
     this.messageBox       = messageBox;
     this.settings         = settings;
     this.text             = text;
     this.uiFactory        = uiFactory;
 }
 public ShellOperation(
     IActionCenter actionCenter,
     IEnumerable <IActionCenterActivator> activators,
     ActionCenterSettings actionCenterSettings,
     IAudio audio,
     INotificationInfo aboutInfo,
     INotificationController aboutController,
     IKeyboard keyboard,
     ILogger logger,
     INotificationInfo logInfo,
     INotificationController logController,
     IPowerSupply powerSupply,
     ISystemInfo systemInfo,
     ITaskbar taskbar,
     TaskbarSettings taskbarSettings,
     ITerminationActivator terminationActivator,
     IText text,
     IUserInterfaceFactory uiFactory,
     IWirelessAdapter wirelessAdapter)
 {
     this.aboutInfo            = aboutInfo;
     this.aboutController      = aboutController;
     this.actionCenter         = actionCenter;
     this.activators           = activators;
     this.actionCenterSettings = actionCenterSettings;
     this.audio                = audio;
     this.keyboard             = keyboard;
     this.logger               = logger;
     this.logInfo              = logInfo;
     this.logController        = logController;
     this.powerSupply          = powerSupply;
     this.systemInfo           = systemInfo;
     this.taskbarSettings      = taskbarSettings;
     this.terminationActivator = terminationActivator;
     this.text            = text;
     this.taskbar         = taskbar;
     this.uiFactory       = uiFactory;
     this.wirelessAdapter = wirelessAdapter;
 }
Example #20
0
 public ShellOperation(
     IActionCenter actionCenter,
     IEnumerable <IActionCenterActivator> activators,
     ActionCenterSettings actionCenterSettings,
     ILogger logger,
     INotificationInfo aboutInfo,
     INotificationController aboutController,
     INotificationInfo logInfo,
     INotificationController logController,
     ISystemComponent <ISystemKeyboardLayoutControl> keyboardLayout,
     ISystemComponent <ISystemPowerSupplyControl> powerSupply,
     ISystemComponent <ISystemWirelessNetworkControl> wirelessNetwork,
     ISystemInfo systemInfo,
     ITaskbar taskbar,
     TaskbarSettings taskbarSettings,
     ITerminationActivator terminationActivator,
     IText text,
     IUserInterfaceFactory uiFactory)
 {
     this.aboutInfo            = aboutInfo;
     this.aboutController      = aboutController;
     this.actionCenter         = actionCenter;
     this.activators           = activators;
     this.actionCenterSettings = actionCenterSettings;
     this.logger               = logger;
     this.logInfo              = logInfo;
     this.logController        = logController;
     this.keyboardLayout       = keyboardLayout;
     this.powerSupply          = powerSupply;
     this.systemInfo           = systemInfo;
     this.taskbarSettings      = taskbarSettings;
     this.terminationActivator = terminationActivator;
     this.text            = text;
     this.taskbar         = taskbar;
     this.uiFactory       = uiFactory;
     this.wirelessNetwork = wirelessNetwork;
 }
        internal void BuildObjectGraph(Action shutdown)
        {
            ValidateCommandLineArguments();

            InitializeLogging();
            InitializeText();

            context       = new ClientContext();
            uiFactory     = BuildUserInterfaceFactory();
            actionCenter  = uiFactory.CreateActionCenter();
            messageBox    = BuildMessageBox();
            nativeMethods = new NativeMethods();
            runtimeProxy  = new RuntimeProxy(runtimeHostUri, new ProxyObjectFactory(), ModuleLogger(nameof(RuntimeProxy)), Interlocutor.Client);
            systemInfo    = new SystemInfo();
            taskbar       = uiFactory.CreateTaskbar(ModuleLogger("Taskbar"));
            taskview      = uiFactory.CreateTaskview();

            var processFactory     = new ProcessFactory(ModuleLogger(nameof(ProcessFactory)));
            var applicationMonitor = new ApplicationMonitor(TWO_SECONDS, ModuleLogger(nameof(ApplicationMonitor)), nativeMethods, processFactory);
            var applicationFactory = new ApplicationFactory(applicationMonitor, ModuleLogger(nameof(ApplicationFactory)), nativeMethods, processFactory);
            var displayMonitor     = new DisplayMonitor(ModuleLogger(nameof(DisplayMonitor)), nativeMethods, systemInfo);
            var explorerShell      = new ExplorerShell(ModuleLogger(nameof(ExplorerShell)), nativeMethods);
            var fileSystemDialog   = BuildFileSystemDialog();
            var hashAlgorithm      = new HashAlgorithm();
            var splashScreen       = uiFactory.CreateSplashScreen();

            var operations = new Queue <IOperation>();

            operations.Enqueue(new I18nOperation(logger, text));
            operations.Enqueue(new RuntimeConnectionOperation(context, logger, runtimeProxy, authenticationToken));
            operations.Enqueue(new ConfigurationOperation(context, logger, runtimeProxy));
            operations.Enqueue(new DelegateOperation(UpdateAppConfig));
            operations.Enqueue(new LazyInitializationOperation(BuildClientHostOperation));
            operations.Enqueue(new ClientHostDisconnectionOperation(context, logger, FIVE_SECONDS));
            operations.Enqueue(new LazyInitializationOperation(BuildKeyboardInterceptorOperation));
            operations.Enqueue(new LazyInitializationOperation(BuildMouseInterceptorOperation));
            operations.Enqueue(new ApplicationOperation(context, applicationFactory, applicationMonitor, logger, text));
            operations.Enqueue(new DisplayMonitorOperation(context, displayMonitor, logger, taskbar));
            operations.Enqueue(new LazyInitializationOperation(BuildShellOperation));
            operations.Enqueue(new LazyInitializationOperation(BuildBrowserOperation));
            operations.Enqueue(new ClipboardOperation(context, logger, nativeMethods));

            var sequence = new OperationSequence(logger, operations);

            ClientController = new ClientController(
                actionCenter,
                applicationMonitor,
                context,
                displayMonitor,
                explorerShell,
                fileSystemDialog,
                hashAlgorithm,
                logger,
                messageBox,
                sequence,
                runtimeProxy,
                shutdown,
                splashScreen,
                taskbar,
                text,
                uiFactory);
        }
Example #22
0
 public LargeCog(IGameObjectsFactory gameObjectsFactory, IUserInterfaceFactory userInterfaceFactory)
 {
     this.gameObjectsFactory = gameObjectsFactory;
     this.userInterfaceFactory = userInterfaceFactory;
 }
Example #23
0
 public AboutNotificationController(AppConfig appConfig, IUserInterfaceFactory uiFactory)
 {
     this.appConfig = appConfig;
     this.uiFactory = uiFactory;
 }
Example #24
0
 public LogNotificationController(ILogger logger, IUserInterfaceFactory uiFactory)
 {
     this.logger    = logger;
     this.uiFactory = uiFactory;
 }
Example #25
0
        internal void BuildObjectGraph(Action shutdown)
        {
            ValidateCommandLineArguments();

            configuration = new ClientConfiguration();
            logger        = new Logger();
            nativeMethods = new NativeMethods();
            systemInfo    = new SystemInfo();

            InitializeLogging();
            InitializeText();

            actionCenter         = BuildActionCenter();
            messageBox           = BuildMessageBox();
            processMonitor       = new ProcessMonitor(new ModuleLogger(logger, nameof(ProcessMonitor)), nativeMethods);
            uiFactory            = BuildUserInterfaceFactory();
            runtimeProxy         = new RuntimeProxy(runtimeHostUri, new ProxyObjectFactory(), new ModuleLogger(logger, nameof(RuntimeProxy)), Interlocutor.Client);
            taskbar              = BuildTaskbar();
            terminationActivator = new TerminationActivator(new ModuleLogger(logger, nameof(TerminationActivator)));
            windowMonitor        = new WindowMonitor(new ModuleLogger(logger, nameof(WindowMonitor)), nativeMethods);

            var displayMonitor = new DisplayMonitor(new ModuleLogger(logger, nameof(DisplayMonitor)), nativeMethods, systemInfo);
            var explorerShell  = new ExplorerShell(new ModuleLogger(logger, nameof(ExplorerShell)), nativeMethods);
            var hashAlgorithm  = new HashAlgorithm();

            var operations = new Queue <IOperation>();

            operations.Enqueue(new I18nOperation(logger, text, textResource));
            operations.Enqueue(new RuntimeConnectionOperation(logger, runtimeProxy, authenticationToken));
            operations.Enqueue(new ConfigurationOperation(configuration, logger, runtimeProxy));
            operations.Enqueue(new DelegateOperation(UpdateAppConfig));
            operations.Enqueue(new LazyInitializationOperation(BuildClientHostOperation));
            operations.Enqueue(new LazyInitializationOperation(BuildClientHostDisconnectionOperation));
            operations.Enqueue(new LazyInitializationOperation(BuildKeyboardInterceptorOperation));
            operations.Enqueue(new LazyInitializationOperation(BuildMouseInterceptorOperation));
            operations.Enqueue(new LazyInitializationOperation(BuildWindowMonitorOperation));
            operations.Enqueue(new LazyInitializationOperation(BuildProcessMonitorOperation));
            operations.Enqueue(new DisplayMonitorOperation(displayMonitor, logger, taskbar));
            operations.Enqueue(new LazyInitializationOperation(BuildShellOperation));
            operations.Enqueue(new LazyInitializationOperation(BuildBrowserOperation));
            operations.Enqueue(new ClipboardOperation(logger, nativeMethods));
            operations.Enqueue(new DelegateOperation(UpdateClientControllerDependencies));

            var sequence = new OperationSequence(logger, operations);

            ClientController = new ClientController(
                actionCenter,
                displayMonitor,
                explorerShell,
                hashAlgorithm,
                logger,
                messageBox,
                sequence,
                processMonitor,
                runtimeProxy,
                shutdown,
                taskbar,
                terminationActivator,
                text,
                uiFactory,
                windowMonitor);
        }
 public ProctoringController(IUserInterfaceFactory uiFactory)
 {
     this.uiFactory = uiFactory;
 }
Example #27
0
 public MainMenuScreen(IGameObjectsFactory gameObjectsFactory, IUserInterfaceFactory interfaceFactory)
 {
     cogsMenu = new AnimatedCogsMenu(gameObjectsFactory, interfaceFactory);
 }