Пример #1
0
        private void Form2_Load(object sender, EventArgs e)
        {
            listView1.View = View.Details;
            listView1.Columns.Add("Filename", 150, HorizontalAlignment.Left);
            listView1.Columns.Add("FileId", 150, HorizontalAlignment.Left);
            listView1.Columns.Add("Size (bytes)", 150, HorizontalAlignment.Left);

            credential = GoogleDriveProvider.GetCredentials(Scopes);

            GoogleDriveProvider.GetItemsFromGoogleDrive(credential, ApplicationName, listView1);

            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
        }
Пример #2
0
        private void ChangeAccount_Click(object sender, EventArgs e)
        {
            var credPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);

            credPath = Path.Combine(credPath, ".credentials/drive-dotnet-quickstart.json");

            var dir = new DirectoryInfo(credPath);

            dir.Attributes = dir.Attributes & ~FileAttributes.ReadOnly;
            dir.Delete(true);

            credential = GoogleDriveProvider.GetCredentials(Scopes);

            listView1.Items.Clear();
            GoogleDriveProvider.GetItemsFromGoogleDrive(credential, ApplicationName, listView1);
        }
Пример #3
0
 private void Refresh_Click(object sender, EventArgs e)
 {
     listView1.Items.Clear();
     GoogleDriveProvider.GetItemsFromGoogleDrive(credential, ApplicationName, listView1);
 }