示例#1
0
        /// <summary>
        /// Constructor method.
        /// </summary>
        public MinimizedInstancesPanelViewModel(IAppState appState = null)
        {
            _appState = appState ?? Locator.CurrentMutable.GetService <IAppState>();

            _minimizedIntegratedInstances = _appState.GetProcessInstances().CreateDerivedCollection(
                filter: instance => !instance.IsElevated && instance.IsMinimized,
                selector: instance => instance
                );

            // Restore window
            _restoreInstanceWindowCommand = ReactiveCommand.Create <IProcessInstanceViewModel>(instance => RestoreInstanceWindowCommandAction(instance));
        }
示例#2
0
        /// <summary>
        /// Constructor method.
        /// </summary>
        public ProcessesInteropAgent(IAppState appState = null)
        {
            _appState = appState ?? Locator.CurrentMutable.GetService <IAppState>();

            _winEventDelegate  = new WinEventDelegate(WinEventsHandler);
            _eventHookHandlers = Win32Api.AddEventsHook(_winEvents, _winEventDelegate);
            _shellViewHandle   = _appState.GetShellViewHandle();

            _integratedInstances = _appState.GetProcessInstances().CreateDerivedCollection(
                filter: instance => !instance.IsElevated,
                selector: instance => instance
                );

            _integratedInstances.ItemsAdded.Subscribe(instance =>
            {
                Integrate(instance);
            });
        }
        /// <summary>
        /// Constructor method.
        /// </summary>
        public TransparencyManagerPanelViewModel(IAppState appState = null)
        {
            _appState = appState ?? Locator.CurrentMutable.GetService <IAppState>();

            _processInstances = _appState.GetProcessInstances().CreateDerivedCollection(
                selector: instance => instance
                );

            _processInstances.ItemsAdded.Subscribe(instance =>
            {
                SetTransparency(instance);
            });

            this.WhenAnyValue(@this => @this.TransparencyLevel).Subscribe(alphaLevel =>
            {
                foreach (var instance in _processInstances)
                {
                    SetTransparency(instance);
                }
            });
        }