Exemplo n.º 1
0
 public PairingService(INFCService nfcService, IBfService bfService, ISettingsService settingsService, IBluetoothService bluetoothService)
 {
     this.nfcService       = nfcService;
     this.bfService        = bfService;
     this.settingsService  = settingsService;
     this.bluetoothService = bluetoothService;
     aes = new AesManaged();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="navService"></param>
        public VMDecryptMessage(INavigationService navService, IBfService bfService, ISettingsService settingsService, IDispatcherService dispatcherService, IApiService apiService)
        {
            this.navService        = navService;
            this.bfService         = bfService;
            this.settingsService   = settingsService;
            this.dispatcherService = dispatcherService;
            this.apiService        = apiService;

            this.navigateToHomeCommand = new DelegateCommand(NavigateToHomeExecute);

            myIdentity = (string)settingsService.Get("email");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="navService">Navigation service instance resolved by DI.</param>
        /// <param name="dispatcherService">Dispatcher service instance resolved by DI.</param>
        public VMMainPage(INavigationService navService, IDispatcherService dispatcherService,
                          ISettingsService settingsService, IApiService apiService, INFCService nfcService,
                          IBluetoothService bluetoothService, IBfService bfService, IPairingService pairingService, IUxService uxService)
        {
            this.navService        = navService;
            this.settingsService   = settingsService;
            this.dispatcherService = dispatcherService;
            this.apiService        = apiService;
            this.nfcService        = nfcService;
            this.bluetoothService  = bluetoothService;
            this.bfService         = bfService;
            this.pairingService    = pairingService;
            this.uxService         = uxService;

            this.setAsBusyCommand                    = new DelegateCommand <bool>(SetAsBusyExecte);
            this.logOutCommand                       = new DelegateCommand(LogOutExecute);
            this.navigateToSecureEmailCommand        = new DelegateCommand(NavigateToSecureEmailExecute);
            this.navigateToShareSecureMessageCommand = new DelegateCommand(NavigateToShareSecureMessageExecute);
            this.startNfcPairingCommand              = new DelegateCommand(StartNfcPairingExecute);
            this.navigateToAboutCommand              = new DelegateCommand(NavigateToAboutExecute);
            this.addressChooserCommand               = new DelegateCommand(AddressChooserExecute);
            this.sendSecureEmailCommand              = new DelegateCommand(SendSecureEmailExecute, SendSecureEmailCanExecute);
            this.shareSecureMessageCommand           = new DelegateCommand(ShareSecureMessageExecute, ShareSecureMessageCanExecute);
            this.publishMessageCommand               = new DelegateCommand(PublishMessageExecute, PublishMessageCanExecute);
            this.writeToTagCommand                   = new DelegateCommand(WriteToTagExecute, WriteToTagCanExecute);
            this.encryptSecureNoteCommand            = new DelegateCommand(EncryptSecureNoteExecute, EncryptSecureNoteCanExecute);
            this.clearLogCommand                     = new DelegateCommand(ClearLogExecute);
            this.navigateToInstructionsCommand       = new DelegateCommand(NavigateToInstructionsExecite);
            this.pairDeviceCommand                   = new DelegateCommand(PairDeviceExecute, PairDeviceCanExecute);
            //this.pairDeviceCommand = new DelegateCommand(PairDeviceExecute);

            if (this.nfcService.ConnectDefaultProximityDevice())
            {
                this.nfcService.DeviceArrived             += nfcService_DeviceArrived;
                this.nfcService.DeviceLeft                += nfcService_DeviceLeft;
                this.nfcService.MessageReceivedCompleted  += nfcService_MessageReceivedCompleted;
                this.nfcService.MessagePublishedCompleted += nfcService_MessagePublishedCompleted;
                this.nfcService.SubscribeToMessage("WriteableTag");
                this.nfcService.SubscribeToMessage("NDEF");
                this.nfcService.SubscribeToMessage("NDEF:Unknown");
                this.nfcService.SubscribeToMessage("WindowsMime");
            }
            else
            {
                uxService.ShowToastNotification("Error", AppResources.NoNfcError);
                LogMessage(AppResources.NoNfcError, NfcLogItem.ERROR_ICON);
            }

            contacts   = new Contacts();
            myIdentity = (string)settingsService.Get("email");
        }