public static GoogleDriveAPI GetInstance()
        {
            if (Instance == null)
            {
                Instance = new GoogleDriveAPI();
            }

            return(Instance);
        }
Exemplo n.º 2
0
        /// <summary>
        /// drive'a login olur ve login işlemi başarılıysa root'taki dosyaları çeker
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAuthorize_Click(object sender, EventArgs e)
        {
            DriveApi = GoogleDriveAPI.GetInstance();

            try {
                DriveApi.Authorize();
                btnAuthorize.Enabled = false;
                btnAuthorize.Text    = "Authorized";

                GetRootFiles();

                cmbViewMode.SelectedIndex = 0;
                btnPrev.Enabled           = false;

                pbarStatus.Visible = false;
                lblStatus.Visible  = false;
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }