示例#1
0
        public List<SecureItemViewModel> GetViewItems( bool recommendedsiteFlag)
        {
            Stopwatch watch = new Stopwatch();
            watch.Start();
            IPBData pbData = resolver.GetInstanceOf<IPBData>();
            IPBWebAPI pbWebApi = resolver.GetInstanceOf<IPBWebAPI>();
            List<SecureItem> sites;
            List<SecureItemViewModel> passVaultItems = new List<SecureItemViewModel>();
            try
            {
               
<<<<<<< HEAD
                //if (recommendedsiteFlag)
                //{
                //    var recommendedSites = pbData.GetRecommendedSites();
                //    if(recommendedSites != null)
                //    {
                //        foreach (var site in recommendedSites)
                //        {
                //            passVaultItems.Add(new DefaultView() { Id = site.Id, Image = _common.GetImagePathForSite(site.UUID), Name = site.FriendlyName, Category = site.Folder != null ? site.Folder : "Other", Favorite = false, Username = null, LastAccess = null });
=======
                if (recommendedsiteFlag)
                {
                    var recommendedSites = pbData.GetRecommendedSites();
                    if(recommendedSites != null)
                    {
                        foreach (var site in recommendedSites)
                        {

                            passVaultItems.Add(new DefaultView() { Id = site.Id, Image = Common.GetImagePathForSite(site.UUID), Name = site.FriendlyName, Category = site.Folder != null ? site.Folder.Name : "Other", Favorite = false, Username = null, LastAccess = null });
        /// <summary>
        /// Initialize command with function
        /// </summary>
        public LoginViewModel(IResolver resolver, Grid advertisingGrid)
        {
            //generateKeysStep.ExecuteAsync();


            this.resolver = resolver;
            this.pbData   = resolver.GetInstanceOf <IPBData>();
            this.webApi   = resolver.GetInstanceOf <IPBWebAPI>();

            SubmitCommand = new AsyncRelayCommand <LoadingWindow>(Submit);
            SubmitCodeVerificationCommand = new RelayCommand(SubmitCodeVerification);
            CloseCommand              = new RelayCommand(CloseWindow);
            CancelCommand             = new RelayCommand(CancelVerification);
            ElementTextChangedCommand = new RelayCommand(ElementTextChanged);
            CodeTextChangedCommand    = new RelayCommand(CodeTextChanged);
            //PasswordGotFocusCommand = new RelayCommand(PasswordGotFocus);
            CodeVerificationGotFocusCommand = new RelayCommand(CodeVerificationGotFocus);
            ForgotLinkCommand    = new RelayCommand(ForgotLinkClick);
            LostPhoneLinkCommand = new RelayCommand(LostPhoneLinkClick);
            CloseForgotMasterPasswordDialogCommand = new RelayCommand(CloseForgotMasterPasswordDialogClick);
            //PasswordChanged = new RelayCommand(PasswordChangedEvent);
            PasswordFieldGotFocusCommand  = new RelayCommand(UserPasswordGotFocus);
            PasswordFieldLostFocusCommand = new RelayCommand(UserPasswordLostFocus);
            //ApplyDefaultStyle(passwordBox, DefaultProperties.MasterPasswordStyle, DefaultProperties.ToggleEyeBigIconStyle);
            this.pbData.OnUserLoggedIn += pbData_OnUserLoggedIn;
            this.advertisingGrid        = advertisingGrid;
            PrefillUserEmail();
            ForgotMasterPasswordModel = new ForgotMasterPasswordViewModel(resolver, this);
            PlaceHolderText           = (string)System.Windows.Application.Current.FindResource("MasterPassword");
            OpenMainUI = true;
        }
 void LoginWindow_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (this.Visibility == System.Windows.Visibility.Visible)
     {
         resolver.GetInstanceOf <PasswordBoss.IBrowserMonitor>().StopMonitor();
     }
 }
示例#4
0
 public ShareCommon(IResolver resolver)
 {
     this.pbData     = resolver.GetInstanceOf <IPBData>();
     this.pbWebApi   = resolver.GetInstanceOf <IPBWebAPI>();
     inAppAnalyitics = resolver.GetInstanceOf <IInAppAnalytics>();
     this.resolver   = resolver;
 }
 public EnterPromoCodeControlDialogViewModel(IResolver resolver)
 {
     this.resolver = resolver;
     pbData        = resolver.GetInstanceOf <IPBData>();
     webAPI        = resolver.GetInstanceOf <IPBWebAPI>();
     EnterPromoCodeScreenVisibility = true;
     InitializeCommands();
 }
 public LicenseActivationBusinessLayer(IResolver resolver)
 {
     if (resolver != null)
     {
         webAPI = resolver.GetInstanceOf <IPBWebAPI>();
         pbData = resolver.GetInstanceOf <IPBData>();
     }
 }
 public LoginLanguage([Import(typeof(IResolver))] IResolver resolver)
 {
     this.resolver = resolver;
     this.pbData   = resolver.GetInstanceOf <IPBData>();
     this.webAPI   = resolver.GetInstanceOf <IPBWebAPI>();
     InitializeComponent();
     DataContext = new LoginLanguageViewModel(SelectLanguageComboBox, this.resolver);
 }
示例#8
0
        /// <summary>
        /// login lannguage constructor to initialize command and fill combo box data
        /// </summary>
        /// <param name="loginCombobox"></param>

        public LoginLanguageViewModel(ComboBox loginCombobox, IResolver resolver)
        {
            this.resolver   = resolver;
            this.pbData     = resolver.GetInstanceOf <IPBData>();
            inAppAnalyitics = resolver.GetInstanceOf <IInAppAnalytics>();

            InitializeCommands();
            FillComboboxItem(loginCombobox);
        }
        //private void PasswordChangedEvent(object obj)
        //{
        //    if(obj != null)
        //    {
        //        var PasswordControl = obj as PasswordBox;
        //        UserPassword = PasswordControl.Password;
        //    }
        //}

        void pbData_OnUserLoggedIn(string obj)
        {
            var inAppAnalyitics = resolver.GetInstanceOf <IInAppAnalytics>();

            if (inAppAnalyitics != null)
            {
                //inAppAnalyitics.Get<Events.LoggedIn, EmptyString>().Log(EmptyString.Empty);
                inAppAnalyitics.Get <Events.ActiveUser, Yes>().Log(Yes.Yes);
            }
        }
 private void OnBackToLoginScreen()
 {
     //createAccountLayer.CancelBackgroundTasks();
     Application.Current.Dispatcher.Invoke((Action) delegate
     {
         Login login             = resolver.GetInstanceOf <Login>();
         login.EmailTextBox.Text = UserEmailId;
         Navigator.NavigationService.Navigate(login);
     });
 }
示例#11
0
        private void CancelCommand(object obj)
        {
            var verificationCodeTextBox = obj as TextBox;

            verificationCodeTextBox.Text   = String.Empty;
            VerificationApiErrorVisibility = false;
            Login login = resolver.GetInstanceOf <Login>();

            //login.EmailTextBox.Text = email;
            Navigator.NavigationService.Navigate(login);
        }
示例#12
0
        // private string email = null;
        public SetupCompleteViewModel(IResolver resolver)
        {
            this.resolver       = resolver;
            this.pbData         = resolver.GetInstanceOf <IPBData>();
            this.webApi         = resolver.GetInstanceOf <IPBWebAPI>();
            SetPinButtonCommand = new AsyncRelayCommand <LoadingWindow>(SetPinButtonClick, completed: (obj) => SubmitCompleted(obj));
            CloseCommand        = new RelayCommand(CloseWindow);
            successVerification = false;

            CreateWindows();
        }
示例#13
0
        public ProductTourViewModel(IResolver resolver)
        {
            InitializeCommands();

            _resolver = resolver;
            _pbData   = resolver.GetInstanceOf <IPBData>();
            // TODO: remove entire class.
            _analytics = resolver.GetInstanceOf <IInAppAnalytics>().Get <Events.ScanEventDisabled, OnboardingItem>();

            SelectedIndex = 0;
            IsIncludedWithYourDownload = DeviceHelper.GetInstallType() == "2";
        }
示例#14
0
        public CreateAccountLayer(IResolver resolver, Action <MarketingActionType> logStep)
        {
            this.resolver = resolver;

            this.logStep = logStep;

            this.pbData     = resolver.GetInstanceOf <IPBData>();
            this.webApi     = resolver.GetInstanceOf <IPBWebAPI>();
            inAppAnalyitics = resolver.GetInstanceOf <IInAppAnalytics>();

            generateKeysStep = new GenerateKeysStep().Execute();
        }
        public PersonalInfoSetupViewModel(IResolver resolver)
        {
            this.resolver       = resolver;
            this.pbData         = resolver.GetInstanceOf <IPBData>();
            this.api            = resolver.GetInstanceOf <IPBWebAPI>();
            this.mixpanelLogger = new PersonalInfoSetupAnalyticsLogger(resolver.GetInstanceOf <IInAppAnalytics>());

            this.CloseCommand    = new RelayCommand(CloseCommandExecute);
            this.ContinueCommand = new RelayCommand(ContinueCommandExecute);

            email = pbData.ActiveUser;
        }
示例#16
0
        public PBApp(IResolver moduleLoader, string[] args)
        {
            this.args = args == null ? new string[0] : args;
            clipboardTimer.Elapsed += clipboardTimer_Elapsed;
            this.moduleLoader       = moduleLoader;
            pbData = moduleLoader.GetInstanceOf <IPBData>();
            // pbData.OnProfileUnlock += pbData_OnProfileUnlock;
            pbData.OnUserLoggedIn += pbData_OnUserLoggedIn;
            pbData.OnCloseProfile += pbData_OnCloseProfile;
            currentLanguage        = pbData.GetConfigurationValueByAccountAndKey(DefaultProperties.Configuration_DefaultAccount, "last_selected_lang");
            if (string.IsNullOrWhiteSpace(currentLanguage))
            {
                currentLanguage = "en";
            }
            sync = moduleLoader.GetInstanceOf <IPBSync>();
            sync.OnGetMergePassword(GetMergePassword);
            webAPI         = moduleLoader.GetInstanceOf <IPBWebAPI>();
            BrowserMonitor = moduleLoader.GetInstanceOf <IBrowserMonitor>();
            updater        = moduleLoader.GetInstanceOf <IAppUpdater>();
            updater.UpdatedVersionDetected += UpdatedVersionDetected;
            categories    = new Dictionary <string, string>();
            resourcePaths = new Dictionary <string, Uri>();
            resourcePaths.Add("Fonts", new Uri("/font;component/FontProperty.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("Themes", new Uri("/theme;component/Theme.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("Images", new Uri("/image;component/ImageResource.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("LocalStyles1", new Uri("pack://application:,,,/PBAppUI;component/resources/dictionary/styles/passwordbossresource.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("LocalStyles2", new Uri("pack://application:,,,/PBAppUI;component/resources/dictionary/styles/primarydashboardresource.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("LocalStyles3", new Uri("pack://application:,,,/PBAppUI;component/resources/dictionary/styles/AddControlStyles.xaml", UriKind.RelativeOrAbsolute));
            foreach (var uri in resourcePaths.Values)
            {
                LoadAndMerge(uri);
            }
            SetLanguage(currentLanguage);
            SystemTray.SetResolver(moduleLoader);
            sysTray = new SystemTray();
            sysTray.InitializeTrayProperties();
            SystemTray.OnBeforeShutDownHandler += SystemTray_OnBeforeShutDownHandler;
            LoginWindow loginWindow = new LoginWindow(moduleLoader);

            Navigator.NavigationService = loginWindow.MainFrame.NavigationService;
            if (!pbData.ControllerIsUpToDate())
            {
                pbData_OnInvalidVersion(DBFileType.Controller);
            }
            else
            {
                pbData.OnInvalidVersion += pbData_OnInvalidVersion;
            }

            Application.Current.Dispatcher.UnhandledException += onDispatcherUnhandledException;
            systemIdlePoller = new SystemIdlePoller();
        }
        public ForgotMasterPasswordViewModel(IResolver resolver, LoginViewModel loginViewModel)
        {
            _resolver       = resolver;
            pbData          = resolver.GetInstanceOf <IPBData>();
            webAPI          = resolver.GetInstanceOf <IPBWebAPI>();
            _loginViewModel = loginViewModel;

            OpenSupportPageCommand             = new RelayCommand(OpenSupport);
            OpenGetCodeCommand                 = new RelayCommand(OpenGetCode);
            ShowInitialScreenCommand           = new RelayCommand(ShowFirstScreenClick);
            ShowSecondScreenCommand            = new RelayCommand(ShowSecondScreenClick);
            ShowInitialScreenSecondPartCommand = new RelayCommand(ShowInitialScreenSecondPartClick);
            ShowThirdScreenCommand             = new AsyncRelayCommand <LoadingWindow>(ShowThirdScreenClick);
        }
        public CreateAccountViewModel(IResolver resolver, string email)
            : base(resolver)
        {
            this.UserEmailId = email;
            this.resolver    = resolver;
            this.pbData      = resolver.GetInstanceOf <IPBData>();
            this.webApi      = resolver.GetInstanceOf <IPBWebAPI>();

            Task.Factory.StartNew(() =>
            {
                this.webApi.GetEndpoints();
            });

            // logic for account creation with provided callbacks for GUI calls
            this.createAccountLayer = new CreateAccountLayer(resolver, LogStep);
            this.createAccountLayer.BackToLoginScreenRequired += (o, e) => OnBackToLoginScreen();
            this.createAccountLayer.MessageRaised             += (o, e) => OnMessageRaised(e.Message);
            this.createAccountLayer.VerificationRequired      += (o, e) => OnVerificationRequired();
            this.createAccountLayer.SetupCompleteRequired     += (o, e) => OnSetupCompleteViewRequired();

            this._userPasswordWrapper        = new PasswordBoxViewModel(this, "UserPasswordWrapper");
            this._userConfirmPasswordWrapper = new PasswordBoxViewModel(this, "UserConfirmPasswordWrapper");

            this.CloseCommand                 = new RelayCommand(CloseCommandExecute);
            this.EmailTextChangedCommand      = new RelayCommand(EmailTextChangedExecute);
            this.PrivacyPolicyCommand         = new RelayCommand((x) => OpenUri(PrivacyPolicyLink));
            this.TermsOfServiceCommand        = new RelayCommand((x) => OpenUri(TermsOfUseLink));
            this.PasswordFieldGotFocusCommand = new RelayCommand(UserPasswordGotFocus);
            this.LoginExistingButtonCommand   = new RelayCommand(LoginExistingCommand);
            this.CreateNewButtonCommand       = new RelayCommand(CreateNewButtonCommandExecute);

            // validator helper for validation properties
            this.validator = new Validator <CreateAccountViewModel>(this);
            this.validator.AddProperty(ValidationProperties.IsValidEmail, (v) => _commonObj.IsEmailValid(v.UserEmailId));
            this.validator.AddProperty(ValidationProperties.IsPasswordsEqual, (v) =>
            {
                return(v.UserPasswordWrapper.Password == v.UserConfirmPasswordWrapper.Password);
            });
            this.validator.AddProperty(ValidationProperties.IsValidMasterPassword, (v) => v.UserPasswordWrapper.IsPasswordValid);
            this.validator.AddProperty(ValidationProperties.IsValidConfirmPassword, (v) => v.UserConfirmPasswordWrapper.IsPasswordValid);

            this.validator.AddProperty(ValidationProperties.IsEmailHasValue, (v) => !string.IsNullOrEmpty(v.UserEmailId));
            this.validator.AddProperty(ValidationProperties.IsMasterPasswordHasValue, (v) => !string.IsNullOrEmpty(v.UserPasswordWrapper.Password));
            this.validator.AddProperty(ValidationProperties.IsConfirmPasswordHasValue, (v) => !string.IsNullOrEmpty(v.UserConfirmPasswordWrapper.Password));

            this.validator.SetProperty(ValidationProperties.IsValidEmail, true);
            this.validator.SetProperty(ValidationProperties.IsPasswordsEqual, true);
        }
 public ConfirmMasterPassword(IResolver resolver, string email, string password)
 {
     this.resolver   = resolver;
     inAppAnalyitics = resolver.GetInstanceOf <IInAppAnalytics>();
     InitializeComponent();
     DataContext = new ConfirmMasterPasswordViewModel(email, password, resolver);
 }
示例#20
0
        private void StartSync()
        {
            IsInSync = true;
            var sync = resolver.GetInstanceOf <IPBSync>();

            progressBarAnimation = new ProgressBarAnimation(sync.StepCount, Indicator);

            Indicator.Width = 0;
            this.Show();

            bool res = false;

            Task.Factory.StartNew(() =>
            {
                res = sync.Sync(progressBarAnimation.OnProgressChanged);

                var action = (Action)(() =>
                {
                    if (!res)
                    {
                        if (!isClosed)
                        {
                            this.Hide();
                            syncFailedDialog.Show();
                        }
                    }
                    else
                    {
                        CloseCommandExecute(this);
                    }
                });

                Application.Current.Dispatcher.Invoke(action);
            });
        }
示例#21
0
        public ProductTour([Import(typeof(IResolver))] IResolver resolver)
        {
            _resolver = resolver;
            _pbData   = resolver.GetInstanceOf <IPBData>();

            ContentPanel.Visibility = Visibility.Hidden;
        }
示例#22
0
 public PersonalInfo([Import(typeof(IResolver))] IResolver resolver)
 {
     this.resolver = resolver;
     LoadResources();
     ShowMiniTour = true;
     pbData       = resolver.GetInstanceOf <IPBData>();
 }
示例#23
0
        protected override IAnalyticsLogger CreateSpecialAnalyticsItem(IResolver resolver, IAnalyticsLogger analyticsTarget)
        {
            var analytics = resolver.GetInstanceOf <IInAppAnalytics>();

            if (analyticsTarget is ScanResultWithItemsViewModel)
            {
                return(new OnboardingItemScanResultAnalyticsLogger <Events.ScanResultsEvent>(analytics, OnboardingSteps.ScanResultWithItems, (IScanSummary)analyticsTarget));
            }
            else if (analyticsTarget is ProgressScanViewModel)
            {
                return(new OnboardingItemAnalyticsLogger <Events.StartupScanInProgress>(analytics, OnboardingSteps.ScanInProgress));
            }
            else if (analyticsTarget is ScanNowViewModel)
            {
                return(new OnboardingItemAnalyticsLogger <Events.StartupScanManualStart>(analytics, OnboardingSteps.ManualStart));
            }
            else if (analyticsTarget is ScanResultNoItemsViewModel)
            {
                return(new OnboardingItemAnalyticsLogger <Events.ScanResultsNoItems>(analytics, OnboardingSteps.ScanResultNoItems));
            }
            else if (analyticsTarget is ScanPopupNotificationViewModel)
            {
                return(new OnboardingItemAnalyticsLogger <Events.ScanResultsPopUpNotification>(analytics, OnboardingSteps.ScanResultPopupNotification));
            }
            else if (analyticsTarget is StartupScanDisabledViewModel)
            {
                return(new OnboardingItemAnalyticsLogger <Events.ScanEventDisabled>(analytics, OnboardingSteps.StartupScanDisabled));
            }
            else if (analyticsTarget is StartupScanEnabledViewModel)
            {
                return(new OnboardingItemAnalyticsLogger <Events.ScanEventEnabled>(analytics, OnboardingSteps.StartupScanEnabled));
            }

            return(null);
        }
 public SetPINScreenViewModel(IResolver resolver)
 {
     this.resolver       = resolver;
     this.pbData         = resolver.GetInstanceOf <IPBData>();
     SetPinButtonCommand = new RelayCommand(SetPinButtonClick);
     CloseCommand        = new RelayCommand(CloseWindow);
 }
示例#25
0
 public SetPINScreen([Import(typeof(IResolver))] IResolver resolver)
 {
     this.resolver = resolver;
     this.pbData   = resolver.GetInstanceOf <IPBData>();
     DataContext   = new SetPINScreenViewModel(resolver);
     InitializeComponent();
 }
示例#26
0
        void btnSecureBrowser_Click(object arg1, System.Windows.RoutedEventArgs arg2)
        {
            IFeatureChecker featureChecker = resolver.GetInstanceOf <IFeatureChecker>();

            if (!featureChecker.IsEnabled(DefaultProperties.Features_SecureBrowser_AccessSecureBrowser))
            {
                Selected = false;
                return;
            }

            //btnSecureBrowser.Selected = true;
            if (MenuButtonClick != null)
            {
                MenuButtonClick(this, arg2);
            }
        }
示例#27
0
 public SecureBrowser([Import(typeof(IResolver))] IResolver resolver)
 {
     this.resolver = resolver;
     LoadResources();
     ShowMiniTour = true;
     pbData       = resolver.GetInstanceOf <IPBData>();
 }
 public PasswordGeneratorContentPanel(IResolver resolver)
 {
     this.resolver   = resolver;
     inAppAnalyitics = resolver.GetInstanceOf <IInAppAnalytics>();
     InitializeComponent();
     this.DataContext = new PasswordGeneratorViewModel(resolver);
 }
示例#29
0
 public VerificationRequiredViewModel(IResolver resolver, string email, string password)
 {
     this.email                         = email;
     this.mastePassword                 = password;
     this.resolver                      = resolver;
     this.pbData                        = resolver.GetInstanceOf <IPBData>();
     this.webAPI                        = resolver.GetInstanceOf <IPBWebAPI>();
     SubmitButtonCommand                = new AsyncRelayCommand <LoadingWindow>(SubmitButtonClick, completed: (obj) => SubmitCompleted(obj));
     ElementTextChangedCommand          = new RelayCommand(ElementTextChanged);
     CloseCommand                       = new RelayCommand(CloseWindow);
     TryAgainButtonCommand              = new RelayCommand(TryAgainCommand);
     ResendButtonCommand                = new RelayCommand(ResendCommand);
     CancelButtonCommand                = new RelayCommand(CancelCommand);
     MessageBoxInfoConfirmButtonCommand = new RelayCommand(MessageBoxInfoConfirmCommand);
     successVerification                = false;
 }
示例#30
0
 public DigitalWallet([Import(typeof(IResolver))] IResolver resolver)
 {
     this.resolver = resolver;
     LoadResources();
     ShowMiniTour = true;
     pbData       = resolver.GetInstanceOf <IPBData>();
 }