Here I want to return WebserviceResult which is a custom class but it's returning null because ShareManagementWebService_ResetPermissionInheritanceCompleted is taking some time. How to return data???
internal WebServiceResult ResetInheritance(string shareName, string subFolder) {
shareManagementWebService = new ShareManagementService();
shareManagementWebService.ResetPermissionInheritanceCompleted += new ResetPermissionInheritanceCompletedEventHandler(
ShareManagementWebService_ResetPermissionInheritanceCompleted);
shareManagementWebService.ResetPermissionInheritanceAsync(shareName, subFolder, null);
return resetPermissionInheritanceResult;
}
private void ShareManagementWebService_ResetPermissionInheritanceCompleted(object sender, ResetPermissionInheritanceCompletedEventArgs e)
{
resetPermissionInheritanceResult = e.Result;
//return resetPermissionInheritanceResult;
}
Aucun commentaire:
Enregistrer un commentaire