public SkyDriveBackup(MyLiveConnectClient liveConnectClient, string appFolderName, LiveConnectSession session, List<string> fileNames, BackupViewModel model) { SkyDriveFolderId = string.Empty; Files = new Dictionary<string, string>(); FileNames = fileNames; _session = session; _appFolderName = appFolderName; LiveClient = liveConnectClient; _model = model; GetFolders(); }
//event triggered when Skydrive sign in status is changed private void btnSignIn_SessionChanged(object sender, Microsoft.Live.Controls.LiveConnectSessionChangedEventArgs e) { //if the user is signed in if (e.Status == LiveConnectSessionStatus.Connected) { _session = e.Session; _client = new LiveConnectClient(e.Session); _model.Message = "Accessing SkyDrive..."; _myClient = new MyLiveConnectClient(e.Session); _backup = new SkyDriveBackup(_myClient, SkyDriveFolderName, e.Session, new List<string> { "ReminderBackup.txt", "HistoryBackup.txt", "HarvestBackup.txt" }, _model); } else { _model.Message = "Not signed in."; _client = null; } }