Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.WorkflowServices / System / Workflow / Activities / Design / ServiceContractDetailViewControl.cs / 1305376 / ServiceContractDetailViewControl.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.Workflow.Activities.Design { using System; using System.ComponentModel; using System.Runtime; using System.Workflow.ComponentModel; using System.Workflow.ComponentModel.Design; internal partial class ServiceContractDetailViewControl : ListItemViewControl { public ServiceContractDetailViewControl() { InitializeComponent(); } public override event EventHandler ItemChanged; public override void UpdateView() { ServiceContractListItem listItem = this.Item as ServiceContractListItem; Fx.Assert(listItem != null, "listItem needs to be a ServiceContractListItem"); contractNameTextBox.Text = listItem.Name; contractNameTextBox.Enabled = true; contractNameTextBox.ReadOnly = true; if (listItem.IsCustomContract) { this.contractNameTextBox.ReadOnly = false; this.contractNameTextBox.Validated += new EventHandler(contractNameTextBox_Validated); this.contractNameTextBox.Validating += new CancelEventHandler(contractNameTextBox_Validating); } base.UpdateView(); } void contractNameTextBox_Validated(object sender, EventArgs e) { ServiceContractListItem contractListItem = (ServiceContractListItem) this.Item; UpdateImplementingActivities(contractListItem); // finally notify other observers of this change if (this.ItemChanged != null) { this.ItemChanged.Invoke(this, null); } } void contractNameTextBox_Validating(object sender, CancelEventArgs e) { ServiceContractListItem contractListItem = (ServiceContractListItem) this.Item; string oldName = contractListItem.Name; contractListItem.Name = this.contractNameTextBox.Text; if (contractListItem.Validating != null) { contractListItem.Validating.Invoke(contractListItem, e); } if (e.Cancel) { this.contractNameTextBox.Text = oldName; contractListItem.Name = oldName; e.Cancel = false; } } private void UpdateImplementingActivities(ServiceContractListItem listItem) { foreach (WorkflowServiceOperationListItem workflowOperationListItem in listItem.Operations) { Fx.Assert(workflowOperationListItem != null, "Operations inside an editable contract should only be workflow first operations"); workflowOperationListItem.Operation.ContractName = listItem.Name; // update the activities implementing the operation too foreach (Activity activity in workflowOperationListItem.ImplementingActivities) { PropertyDescriptorUtils.SetPropertyValue(this.ServiceProvider, ServiceOperationHelpers.GetServiceOperationInfoPropertyDescriptor(activity), activity, workflowOperationListItem.Operation.Clone()); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ResourceDisplayNameAttribute.cs
- BoolExpressionVisitors.cs
- ServiceChannel.cs
- ActivityPreviewDesigner.cs
- WindowsFormsHostPropertyMap.cs
- Message.cs
- DocumentPageHost.cs
- Graph.cs
- ACL.cs
- RangeEnumerable.cs
- AnnotationDocumentPaginator.cs
- InkPresenterAutomationPeer.cs
- ValidationRuleCollection.cs
- UrlMappingsSection.cs
- EpmContentDeSerializerBase.cs
- MatrixCamera.cs
- FunctionQuery.cs
- WindowsAuthenticationModule.cs
- StringReader.cs
- _Win32.cs
- VScrollProperties.cs
- UnsafeNativeMethods.cs
- AppDomain.cs
- Material.cs
- SamlAdvice.cs
- NamespaceImport.cs
- DocumentAutomationPeer.cs
- SqlInternalConnection.cs
- DebuggerService.cs
- httpstaticobjectscollection.cs
- ToolStripItemImageRenderEventArgs.cs
- followingquery.cs
- sitestring.cs
- OpCellTreeNode.cs
- GCHandleCookieTable.cs
- BuiltInPermissionSets.cs
- Control.cs
- _ScatterGatherBuffers.cs
- FilterUserControlBase.cs
- WebPartCollection.cs
- ModuleElement.cs
- TextModifierScope.cs
- LongCountAggregationOperator.cs
- _HTTPDateParse.cs
- ZipIOExtraFieldElement.cs
- UserControlCodeDomTreeGenerator.cs
- XmlDocumentType.cs
- Renderer.cs
- TypeSystem.cs
- DataBinder.cs
- ILGenerator.cs
- XmlAttributeOverrides.cs
- TimersDescriptionAttribute.cs
- WebSysDescriptionAttribute.cs
- XmlLinkedNode.cs
- GroupBoxRenderer.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- EntityConnectionStringBuilderItem.cs
- userdatakeys.cs
- BinHexEncoding.cs
- DuplicateWaitObjectException.cs
- EdmItemError.cs
- OutOfMemoryException.cs
- AncestorChangedEventArgs.cs
- SafeCryptContextHandle.cs
- SafeFileHandle.cs
- UIElement3DAutomationPeer.cs
- UpdateRecord.cs
- ListControlConvertEventArgs.cs
- SamlAttribute.cs
- MetadataProperty.cs
- SqlTypeSystemProvider.cs
- SubpageParaClient.cs
- PermissionSetTriple.cs
- DataAdapter.cs
- PositiveTimeSpanValidatorAttribute.cs
- FontFamilyIdentifier.cs
- WindowsRichEditRange.cs
- PageAsyncTask.cs
- NamedElement.cs
- BamlResourceDeserializer.cs
- DataSourceHelper.cs
- InputReport.cs
- EnumerableRowCollection.cs
- RepeatBehavior.cs
- NegationPusher.cs
- CounterSetInstanceCounterDataSet.cs
- controlskin.cs
- DataObjectMethodAttribute.cs
- DataGridViewCellStateChangedEventArgs.cs
- Marshal.cs
- DeviceContexts.cs
- IgnoreFileBuildProvider.cs
- Helper.cs
- HtmlInputButton.cs
- DocobjHost.cs
- AccessibleObject.cs
- XmlMapping.cs
- CallbackHandler.cs
- AppSettingsSection.cs