Пример #1
0
 public WorkstationManager(IMetaPubSub metaMessenger)
 {
     // Start listening command messages
     metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.LockWorkstationMessage>(LockPC);
     //metaMessenger.Subscribe<ForceShutdownMessage>(ForceShutdown);
     metaMessenger.TrySubscribeOnServer <ActivateScreenRequestMessage>(ActivateScreen);
 }
Пример #2
0
        public WindowsManager(ViewModelLocator viewModelLocator, INotificationsManager notificationsManager,
                              ISettingsManager <ApplicationSettings> settingsManager, IMetaPubSub metaMessenger)
        {
            _viewModelLocator     = viewModelLocator;
            _settingsManager      = settingsManager;
            _notificationsManager = notificationsManager;

            metaMessenger.Subscribe <ShowWarningNotificationMessage>(ShowWarn);
            metaMessenger.Subscribe <ShowInfoNotificationMessage>(ShowInfo);
            metaMessenger.Subscribe <ShowErrorNotificationMessage>(ShowError);
            metaMessenger.Subscribe <ShowLockNotificationMessage>(ShowLockNotification);
            metaMessenger.Subscribe <ShowLowBatteryNotificationMessage>(ShowLowBatteryNotification);

            metaMessenger.TrySubscribeOnServer <WorkstationUnlockedMessage>(ClearNotifications);

            metaMessenger.TrySubscribeOnServer <UserNotificationMessage>((m) => ShowInfo(new ShowInfoNotificationMessage(m.Message, notificationId: m.NotificationId)));
            metaMessenger.TrySubscribeOnServer <UserErrorMessage>((m) => ShowError(new ShowErrorNotificationMessage(m.Message, notificationId: m.NotificationId)));
            //messenger.Register<ServiceNotificationReceivedMessage>(this, (p) => ShowInfo(p.Message, notificationId: p.Id));
            //messenger.Register<ServiceErrorReceivedMessage>(this, (p) => ShowError(p.Message, notificationId: p.Id));

            metaMessenger.Subscribe <ShowButtonConfirmUiMessage>(ShowButtonConfirmAsync);
            metaMessenger.Subscribe <ShowPinUiMessage>(ShowPinAsync);
            metaMessenger.Subscribe <HidePinUiMessage>(HidePinAsync);
            metaMessenger.TrySubscribeOnServer <ShowActivationCodeUiMessage>(ShowActivationDialogAsync);
            metaMessenger.TrySubscribeOnServer <HideActivationCodeUi>(HideActivationDialogAsync);

            metaMessenger.Subscribe <ShowActivateMainWindowMessage>((p) => ActivateMainWindow());
        }
Пример #3
0
        public ProximityLockManager(ITaskbarIconManager taskbarIconManager, IMetaPubSub metaMessenger)
        {
            _taskbarIconManager = taskbarIconManager;
            _metaMessenger      = metaMessenger;

            _metaMessenger.TrySubscribeOnServer <WorkstationUnlockedMessage>(OnWorkstationUnlocked);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DevicesCollectionChangedMessage>(OnDevicesCollectionChanged);
        }
Пример #4
0
        const string NOTIFICATION_ID_SUFFIX = "_specialBatteryNotification"; // Doesn't matter what it is, as long as its a unique constant string

        public VaultLowBatteryMonitor(IMetaPubSub messenger, IDeviceManager deviceManager)
        {
            _messenger     = messenger;
            _deviceManager = deviceManager;

            _messenger.TrySubscribeOnServer <DeviceBatteryChangedMessage>(OnDeviceBatteryChanged);
            _messenger.TrySubscribeOnServer <DeviceConnectionStateChangedMessage>(OnDeviceConnectionStateChanged);
        }
Пример #5
0
        public Device(
            IRemoteDeviceFactory remoteDeviceFactory,
            IMetaPubSub metaMessenger,
            DeviceDTO dto)
        {
            _remoteDeviceFactory = remoteDeviceFactory;
            _metaMessenger       = metaMessenger;

            PropertyChanged += Device_PropertyChanged;

            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceConnectionStateChangedMessage>(OnDeviceConnectionStateChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceInitializedMessage>(OnDeviceInitialized);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceFinishedMainFlowMessage>(OnDeviceFinishedMainFlow);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceOperationCancelledMessage>(OnOperationCancelled);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceProximityChangedMessage>(OnDeviceProximityChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceBatteryChangedMessage>(OnDeviceBatteryChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceProximityLockEnabledMessage>(OnDeviceProximityLockEnabled);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.LockDeviceStorageMessage>(OnLockDeviceStorage);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.LiftDeviceStorageLockMessage>(OnLiftDeviceStorageLock);
            _metaMessenger.Subscribe <SendPinMessage>(OnPinReceived);
            _metaMessenger.Subscribe <SessionSwitchMessage>(OnSessionSwitch);

            RegisterDependencies();

            LoadFrom(dto);
        }
Пример #6
0
        public DeviceManager(IMetaPubSub metaMessenger, IWindowsManager windowsManager, IRemoteDeviceFactory remoteDeviceFactory)
        {
            _windowsManager      = windowsManager;
            _remoteDeviceFactory = remoteDeviceFactory;
            _metaMessenger       = metaMessenger;

            _metaMessenger.TrySubscribeOnServer <DevicesCollectionChangedMessage>(OnDevicesCollectionChanged);
            _metaMessenger.TrySubscribeOnServer <DeviceConnectionStateChangedMessage>(OnDeviceConnectionStateChanged);

            _metaMessenger.Subscribe <DisconnectedFromServerEvent>(OnDisconnectedFromService, null);
        }
Пример #7
0
        public IndicatorsViewModel(IServiceProxy serviceProxy, IMetaPubSub metaMessenger)
        {
            _serviceProxy = serviceProxy;

            InitIndicators();

            metaMessenger.Subscribe <ConnectionServiceChangedMessage>(c => ResetIndicators(c.IsConnected));
            metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.ServiceComponentsStateChangedMessage>(OnComponentsStateChangedMessage);
        }
        public SoftwareUnlockSettingViewModel(IMetaPubSub metaMessenger)
        {
            _metaMessenger = metaMessenger;

            _metaMessenger.TrySubscribeOnServer <ServiceSettingsChangedMessage>(OnServiceSettingsChanged);
            try
            {
                _metaMessenger.PublishOnServer(new RefreshServiceInfoMessage());
            }
            catch (Exception) { } // Handle error in case we are not connected to server
        }
        // TODO: Add error handling if service is offline
        public ServerAddressEditControlViewModel(IMetaPubSub metaMessenger, ILog log)
        {
            _metaMessenger = metaMessenger;
            _log           = log;

            _metaMessenger.TrySubscribeOnServer <ServiceSettingsChangedMessage>(OnServiceSettingsChanged);
            try
            {
                _metaMessenger.PublishOnServer(new RefreshServiceInfoMessage());
            }
            catch (Exception) { } // Handle error in case we are not connected to server
        }
        public HardwareKeyPageViewModel(IMetaPubSub metaMessenger, ServiceViewModel serviceViewModel)
        {
            _metaMessenger = metaMessenger;
            Service        = serviceViewModel;

            _metaMessenger.TrySubscribeOnServer <ServiceSettingsChangedMessage>(OnServiceSettingsChanged);
            try
            {
                _metaMessenger.PublishOnServer(new RefreshServiceInfoMessage());
            }
            catch (Exception) { } // Handle error in case we are not connected to server
        }
Пример #11
0
        public RemoteDeviceEvents(IMetaPubSub messenger)
        {
            _messenger = messenger;

            _messenger.TrySubscribeOnServer <RemoteConnection_DeviceStateChangedMessage>(OnDeviceStateChanged);
        }
Пример #12
0
        public ServiceCallbackMessanger(IMessenger messenger, IMetaPubSub metaMessenger)
        {
            _messenger     = messenger;
            _metaMessenger = metaMessenger;

            _metaMessenger.TrySubscribeOnServer <ActivateScreenRequestMessage>(ActivateScreenRequest);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.LockWorkstationMessage>(LockWorkstationRequest);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DevicesCollectionChangedMessage>(DevicesCollectionChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceConnectionStateChangedMessage>(DeviceConnectionStateChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceInitializedMessage>(DeviceInitialized);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceFinishedMainFlowMessage>(DeviceFinishedMainFlow);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceOperationCancelledMessage>(DeviceOperationCancelled);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceProximityChangedMessage>(DeviceProximityChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceBatteryChangedMessage>(DeviceBatteryChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.RemoteConnection_DeviceStateChangedMessage>(RemoteConnection_DeviceStateChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.ServiceComponentsStateChangedMessage>(ServiceComponentsStateChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.UserNotificationMessage>(ServiceNotificationReceived);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.UserErrorMessage>(ServiceErrorReceived);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.ShowActivationCodeUiMessage>(ShowActivationCodeUi);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.HideActivationCodeUi>(HideActivationCodeUi);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.DeviceProximityLockEnabledMessage>(DeviceProximityLockEnabled);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.WorkstationUnlockedMessage>(WorkstationUnlocked);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.ProximitySettingsChangedMessage>(ProximitySettingsChanged);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.LockDeviceStorageMessage>(LockDeviceStorage);
            _metaMessenger.TrySubscribeOnServer <HideezMiddleware.IPC.Messages.LiftDeviceStorageLockMessage>(LiftDeviceStorageLock);

            _metaMessenger.Subscribe <ConnectedToServerEvent>(OnConnectedToServer);
        }