Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.WorkflowServices / System / ServiceModel / Description / DescriptionCreator.cs / 1305376 / DescriptionCreator.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Description { using System.Collections.Generic; using System.Workflow.ComponentModel; using System.Workflow.Runtime; class DescriptionCreator { WorkflowDefinitionContext workflowDefinitionContext; public DescriptionCreator(WorkflowDefinitionContext workflowDefinitionContext) { if (workflowDefinitionContext == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("workflowDefinitionContext"); } this.workflowDefinitionContext = workflowDefinitionContext; } public ServiceDescription BuildServiceDescription(out IDictionaryimplementedContracts, out IList reflectedContracts) { ServiceDescriptionContext context = new ServiceDescriptionContext(); ServiceDescription description = new ServiceDescription(); ApplyBehaviors(description); context.ServiceDescription = description; Walker walker = new Walker(true); walker.FoundActivity += delegate(Walker w, WalkerEventArgs args) { IServiceDescriptionBuilder activity = args.CurrentActivity as IServiceDescriptionBuilder; if (activity == null) { return; } activity.BuildServiceDescription(context); }; walker.Walk(this.workflowDefinitionContext.GetWorkflowDefinition()); if (context.Contracts == null || context.Contracts.Count == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR2.GetString(SR2.NoContract))); } implementedContracts = context.Contracts; reflectedContracts = context.ReflectedContracts; return description; } void ApplyBehaviors(ServiceDescription serviceDescription) { WorkflowServiceBehavior wsb = new WorkflowServiceBehavior(workflowDefinitionContext); serviceDescription.Behaviors.Add(wsb); if (wsb.Name != null) { serviceDescription.Name = wsb.Name; } if (wsb.Namespace != null) { serviceDescription.Namespace = wsb.Namespace; } if (wsb.ConfigurationName != null) { serviceDescription.ConfigurationName = wsb.ConfigurationName; } } } } // 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
- HtmlControl.cs
- DataRowChangeEvent.cs
- ImageList.cs
- XmlElement.cs
- _ConnectionGroup.cs
- CellParaClient.cs
- OutputCacheProfileCollection.cs
- XmlSerializationReader.cs
- ConfigXmlText.cs
- ReferenceService.cs
- ControlUtil.cs
- ComplexPropertyEntry.cs
- ReadOnlyHierarchicalDataSource.cs
- TabControl.cs
- FieldMetadata.cs
- QueryOutputWriter.cs
- ReadOnlyHierarchicalDataSourceView.cs
- CurrencyWrapper.cs
- WS2007FederationHttpBindingCollectionElement.cs
- QilVisitor.cs
- ContainerVisual.cs
- DynamicAttribute.cs
- NonSerializedAttribute.cs
- ReliableOutputSessionChannel.cs
- Viewport3DVisual.cs
- ImageDrawing.cs
- UIElementPropertyUndoUnit.cs
- TypeTypeConverter.cs
- ProcessManager.cs
- SoapSchemaImporter.cs
- QilGeneratorEnv.cs
- ParserHooks.cs
- OleServicesContext.cs
- DPAPIProtectedConfigurationProvider.cs
- ArgumentValue.cs
- Inline.cs
- Vector3DAnimationBase.cs
- BCLDebug.cs
- DrawingVisual.cs
- EntityProviderServices.cs
- PageBuildProvider.cs
- FixedPageProcessor.cs
- WebPartVerb.cs
- WebPartVerbsEventArgs.cs
- CheckedPointers.cs
- Queue.cs
- SecurityAlgorithmSuiteConverter.cs
- GZipObjectSerializer.cs
- TraceEventCache.cs
- AutomationTextAttribute.cs
- MsmqOutputChannel.cs
- HttpListenerPrefixCollection.cs
- SqlDependency.cs
- Choices.cs
- ReservationNotFoundException.cs
- XmlAutoDetectWriter.cs
- TypefaceMap.cs
- GlobalProxySelection.cs
- ConfigXmlElement.cs
- XmlResolver.cs
- BitmapFrameEncode.cs
- ProfileModule.cs
- EntityDataSourceWrapperCollection.cs
- PrintDialog.cs
- dataprotectionpermission.cs
- EventLogPermissionAttribute.cs
- StoreContentChangedEventArgs.cs
- HttpProtocolImporter.cs
- EdmToObjectNamespaceMap.cs
- DataGridRelationshipRow.cs
- invalidudtexception.cs
- ZipIOModeEnforcingStream.cs
- ListenerServiceInstallComponent.cs
- MissingMethodException.cs
- InternalControlCollection.cs
- AssemblyHash.cs
- ListItemCollection.cs
- XXXOnTypeBuilderInstantiation.cs
- FixedDocumentSequencePaginator.cs
- Metafile.cs
- PeerCollaboration.cs
- XmlAtomErrorReader.cs
- DataServiceResponse.cs
- TrackingMemoryStream.cs
- storepermission.cs
- MessageContractExporter.cs
- AnnouncementInnerClientCD1.cs
- TextBox.cs
- CryptographicAttribute.cs
- XmlSchemaComplexContentRestriction.cs
- DbConnectionPoolGroupProviderInfo.cs
- Rijndael.cs
- LineBreak.cs
- StructuralObject.cs
- PlaceHolder.cs
- EnumerableRowCollection.cs
- RsaEndpointIdentity.cs
- FixedPageAutomationPeer.cs
- WebBrowsableAttribute.cs
- DynamicMethod.cs