private void addOperationButton_Click(object sender, EventArgs e) { ServiceContractListItem serviceContractListItem = this.operationsListBox.SelectedItem as ServiceContractListItem; Fx.Assert(serviceContractListItem != null, "service contract list item cannot be null"); Fx.Assert(serviceContractListItem.IsCustomContract, " this should work only on a custom contract item"); WorkflowServiceOperationListItem newWorkflowServiceOperationListItem = serviceContractListItem.CreateOperation(); newWorkflowServiceOperationListItem.Validating += new CancelEventHandler(ServiceOperationValidating); this.AddServiceOperation(newWorkflowServiceOperationListItem); serviceContractListItem.SelectionOperation(newWorkflowServiceOperationListItem); }
void NewContractButtonClicked(object sender, EventArgs e) { ServiceContractListItem contractItem = this.serviceContracts.CreateWithUniqueName(); contractItem.Validating += new CancelEventHandler(ServiceContractValidating); contractItem.IsCustomContract = true; this.AddServiceContract(contractItem); WorkflowServiceOperationListItem newWorkflowServiceOperationListItem = contractItem.CreateOperation(); newWorkflowServiceOperationListItem.Validating += new CancelEventHandler(ServiceOperationValidating); this.AddServiceOperation(newWorkflowServiceOperationListItem); contractItem.SelectionOperation(newWorkflowServiceOperationListItem); }