private async void mimicLogin() { InitializeAPI temp = new InitializeAPI(); try { temp.initGoogleDriveAPI(); await CloudLogin.googleDriveLogin(); temp.initOneDriveAPI(); await CloudLogin.oneDriveLogin(user); GoogleDriveCalls gdc = new GoogleDriveCalls(); OneDriveCalls odc = new OneDriveCalls(); bool goog = await gdc.fetchAllMetaData(metaDataController, "Google Drive"); bool one = await odc.fetchAllMetaData(metaDataController, "One Drive"); } catch (Exception e) { } finally { Models.SupportClasses.TreeNode googleRootnode = metaDataController.getRoot("Google Drive", "googleRoot", "Google Drive"); Models.SupportClasses.TreeNode oneDriveRootnode = metaDataController.getRoot("One Drive", "driveRoot", "One Drive"); hierarchyAdd(googleRootnode); hierarchyAdd(oneDriveRootnode); } }
public OneDriveCallsTests() { api = new InitializeAPI(); api.initOneDriveAPI(); User user = new User(); CloudLogin.oneDriveLogin(user); this.downloadFileAsyncTest1(); }
private async void oneDriveClick(object sender, RoutedEventArgs e) { cloudId = 1; api.initOneDriveAPI(); //CloudLogin.oneDriveLogin(user); bool main = false;//check to see if there is a main open MainWindow mainWindow = null; foreach (var wnd in Application.Current.Windows) { if (wnd is MainWindow) { Console.WriteLine("Main or Cloud window open"); mainWindow = (MainWindow)wnd; main = true; } } //does a mainWindow exist? if (main == false) { //only if this was on new guqu account mainWindow = new MainWindow(user); mainWindow.Show(); } InitializeAPI temp = new InitializeAPI(); try { temp.initOneDriveAPI(); await CloudLogin.oneDriveLogin(user); } catch (Exception ex) { return; } OneDriveCalls odc = new OneDriveCalls(); mainWindow.addHierarchy(odc, "One Drive", "driveRoot", "One Drive"); mainWindow.setButtonsClickable(true); this.Close(); }