private async Task AutorizeAsync() { try { credPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); credPath = Path.Combine(credPath, ".credentials/drive-dotnet-quickstart.json"); UserCredential credential = GetCredentials(); service = new DriveService(new BaseClientService.Initializer() { HttpClientInitializer = credential, ApplicationName = ApplicationName, }); var fluentMainWindow = Activator.CreateInstance <MainMenu>(); fluentMainWindow.Show(); fluentMainWindow.Activate(); exit = true; DbViewModel.getInstance(); var request = ModelLogin.service.About.Get(); request.Fields = "user"; var user = request.Execute().User; await DbViewModel.AddUserAsync(user.EmailAddress); foreach (Window win in System.Windows.Application.Current.Windows) { if (win.Title == "Login") { win.Close(); } } } catch (Exception er) { } }
public DbFiles() { InitializeComponent(); this.DataContext = DbViewModel.getInstance(); }