private void requestApproval_Click(object sender, RoutedEventArgs e) { ApprovalRequest request = new ApprovalRequest(docName.Text, document.Text, approvalType.Text, user); PendingList.Items.Add(request); ApprovalResultsClient c = new ApprovalResultsClient(globalBinding, new EndpointAddress(addrListenForApprovalResponses)); c.Open(); c.StartGetApproval(request, approvalAddr.Uri); c.Close(); }
private void CancelRequest_Click(object sender, RoutedEventArgs e) { ApprovalResultsClient client = new ApprovalResultsClient(globalBinding, new EndpointAddress(addrListenForApprovalResponses)); ApprovalRequest request = (ApprovalRequest)PendingList.SelectedItem; client.Open(); client.CancelApprovalRequest(request); client.Close(); lock (PendingList) { PendingList.Items.Remove(request); } CancelRequest.IsEnabled = false; }