mercredi 29 janvier 2020

I called a web service asynchronously but I want to return data from _completed and not getting how to do it?

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