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 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 IPropertyProxy UnwrapPropertyObservable <T>(T propertyProxy)
            where T : class
        {
            IRuntimeProxy impl = propertyProxy as IRuntimeProxy;

            return(impl?.Manager);
        }
        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);
        }
Exemple #5
0
 public ConfigurationOperation(ClientConfiguration configuration, ILogger logger, IRuntimeProxy runtime)
 {
     this.configuration = configuration;
     this.logger        = logger;
     this.runtime       = runtime;
 }
 public ConfigurationOperation(ClientContext context, ILogger logger, IRuntimeProxy runtime) : base(context)
 {
     this.logger  = logger;
     this.runtime = runtime;
 }
Exemple #7
0
 public RuntimeConnectionOperation(ILogger logger, IRuntimeProxy runtime, Guid token)
 {
     this.logger  = logger;
     this.runtime = runtime;
     this.token   = token;
 }
Exemple #8
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 RuntimeConnectionOperation(ClientContext context, ILogger logger, IRuntimeProxy runtime, Guid token) : base(context)
 {
     this.logger  = logger;
     this.runtime = runtime;
     this.token   = token;
 }