Ejemplo n.º 1
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Loaded         -= MainWindow_Loaded;
            _worker.DoWork += Worker_DoWork;
            _worker.RunWorkerAsync();
            var db = new ViberDb(DefaultViberConfigDbInRoamingAppData());

            DataContext = new MainViewModel(db);
        }
Ejemplo n.º 2
0
        private async void RegistrationNewAccount_Click(object sender, RoutedEventArgs e)
        {
            var viewMode = (MainViewModel)DataContext;

            var client = Viber.Instance(viewMode.Config.ViberClientPath);

            client.Close();

            SetDisabled(RegistrationNewAccount);
            var db = new ViberDb(DefaultViberConfigDbInRoamingAppData());
            await db.OffAccountsAsync();

            client.Run();
            ViberAccounts.DataContext = await db.WaitNewAccountAsync();

            SetEnabled(RegistrationNewAccount);
        }
Ejemplo n.º 3
0
        private int CountViberProfile()
        {
            var db = new ViberDb(DefaultViberConfigDbInRoamingAppData());

            return(db.CountActiveAccount());
        }
Ejemplo n.º 4
0
 private async Task SelectNextViberProfileAsync()
 {
     var db    = new ViberDb(DefaultViberConfigDbInRoamingAppData());
     var index = await db.GetNextActiveAccountAsync();
 }