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
- MissingManifestResourceException.cs
- WhiteSpaceTrimStringConverter.cs
- TcpStreams.cs
- ImageFormatConverter.cs
- FieldAccessException.cs
- EntityDataSourceViewSchema.cs
- Aes.cs
- ConnectionsZone.cs
- PrintDocument.cs
- ResourceDisplayNameAttribute.cs
- XmlDictionaryReaderQuotas.cs
- XPathPatternBuilder.cs
- TypedElement.cs
- TraceAsyncResult.cs
- FileInfo.cs
- SQLString.cs
- Triangle.cs
- DebugView.cs
- Effect.cs
- SystemInfo.cs
- ObjectReaderCompiler.cs
- SystemEvents.cs
- WebConfigManager.cs
- AssemblyEvidenceFactory.cs
- BaseHashHelper.cs
- ListViewGroup.cs
- GridViewDeleteEventArgs.cs
- AbandonedMutexException.cs
- XmlDocumentFragment.cs
- XmlWriterDelegator.cs
- ProfessionalColors.cs
- SqlUserDefinedAggregateAttribute.cs
- ZipIOExtraFieldZip64Element.cs
- KeyFrames.cs
- GeometryHitTestResult.cs
- ConnectionManagementSection.cs
- PropertyMapper.cs
- ReadContentAsBinaryHelper.cs
- JoinTreeSlot.cs
- DynamicAttribute.cs
- DecimalConverter.cs
- StaticContext.cs
- WebPartMovingEventArgs.cs
- WindowHideOrCloseTracker.cs
- WebContext.cs
- SamlAttributeStatement.cs
- BulletChrome.cs
- LicFileLicenseProvider.cs
- CacheModeValueSerializer.cs
- Tracer.cs
- OperatingSystemVersionCheck.cs
- GenericsInstances.cs
- RawKeyboardInputReport.cs
- FaultFormatter.cs
- SByteConverter.cs
- MouseButtonEventArgs.cs
- ContainerControl.cs
- ListParagraph.cs
- BitmapCodecInfo.cs
- ToolBarButtonClickEvent.cs
- TimeSpanStorage.cs
- Sequence.cs
- SwitchLevelAttribute.cs
- DefaultMemberAttribute.cs
- GeometryCollection.cs
- HtmlLink.cs
- DataRow.cs
- MessageCredentialType.cs
- InkCanvas.cs
- StatusBarDrawItemEvent.cs
- CompositeFontParser.cs
- FileNotFoundException.cs
- PatternMatcher.cs
- Graph.cs
- SQLDecimalStorage.cs
- DoneReceivingAsyncResult.cs
- XPathNodeList.cs
- CanonicalFontFamilyReference.cs
- HiddenFieldPageStatePersister.cs
- PeerInvitationResponse.cs
- WindowsImpersonationContext.cs
- BaseParagraph.cs
- ReachDocumentPageSerializerAsync.cs
- handlecollector.cs
- KeyTimeConverter.cs
- HiddenFieldPageStatePersister.cs
- DescendantQuery.cs
- WriterOutput.cs
- SoapSchemaImporter.cs
- Form.cs
- TemplateBuilder.cs
- Attribute.cs
- XmlWriterTraceListener.cs
- CompilerError.cs
- PersonalizableTypeEntry.cs
- LocatorBase.cs
- SoapAttributeAttribute.cs
- UInt16Converter.cs
- DataGridViewAutoSizeModeEventArgs.cs
- NegotiateStream.cs