To use the library:
- Use NuGet Package Manager in Visual Studio to reference ArianKulp.SkyDrive.BrowseTask (direct link below).
- In your app, integrate Windows Live LiveClient authentication.
- Create the SkyDriveBrowseTask object and pass it the LiveClient. This is required as it assumes that you are already handling authentication login/logoff in your own way.
- Handle the Completed event to deal with the selected file path (or canceled operation).
Handle the request:
var t = new SkyDriveBrowserTask(); t.LiveClient = App.LiveClient; t.Extensions = "xlf;xliff"; t.Completed += SkyDrive_Completed; t.Show();
Handle the result:
async void SkyDrive_Completed(object sender, SkyDriveResult e)
{
if (e.Error != null)
{
// TODO: Handle the error
}
else if (e.TaskResult != Microsoft.Phone.Tasks.TaskResult.Cancel)
{
var file = e.ChosenItem;
// TODO: Do something with the returned file
}
}
Link: SkyDrive Browse Task
No comments:
Post a Comment