private void GetActivities(IWorkflowsQueryService client)
 {
     TaskActivityGetRequestDC request = new TaskActivityGetRequestDC();
     request.Incaller = Assembly.GetExecutingAssembly().GetName().Name;
     request.IncallerVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
     request.AssignedTo = Environment.UserName;
     request.FilterOlder = this.FilterOldVersions;
     request.PageSize = pageSize;
     request.PageNumber = this.DataPagingVM.ResetPageIndex ? 1 : this.DataPagingVM.PageIndex;
     request.SortColumn = SortColumn;
     request.SortAscending = sortDirection == ListSortDirection.Ascending;
     request.SearchText = this.SearchFilter;
     request.HideUnassignedTasks = this.HideUnassignedTasks;
     try
     {
         TaskActivityGetReplyDC searchResults = null;
         searchResults = client.SearchTaskActivities(request);
         this.DataPagingVM.ResultsLength = searchResults.ServerResultsLength;
         if (searchResults.StatusReply.Errorcode != 0)
         {
             IsBusy = false;
             throw new UserFacingException(searchResults.StatusReply.ErrorMessage);
         }
         else
             this.Activities = new ObservableCollection<TaskActivityDC>(searchResults.List);
     }
     catch (FaultException<ServiceFault> ex)
     {
         IsBusy = false;
         throw new CommunicationException(ex.Detail.ErrorMessage);
     }
     catch (FaultException<ValidationFault> ex)
     {
         IsBusy = false;
         throw new BusinessValidationException(ex.Detail.ErrorMessage);
     }
     catch (Exception ex)
     {
         IsBusy = false;
         throw new CommunicationException(ex.Message);
     }
 }