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
- QuarticEase.cs
- FlagsAttribute.cs
- TransactionalPackage.cs
- AVElementHelper.cs
- ExecutionContext.cs
- BinHexEncoder.cs
- PointKeyFrameCollection.cs
- ContractTypeNameElement.cs
- JoinElimination.cs
- EditableTreeList.cs
- MasterPageCodeDomTreeGenerator.cs
- ListViewGroupCollectionEditor.cs
- GifBitmapEncoder.cs
- InvalidAsynchronousStateException.cs
- FacetValues.cs
- PrtTicket_Public.cs
- CAGDesigner.cs
- ValidationError.cs
- CustomAttribute.cs
- DetailsViewModeEventArgs.cs
- MaskedTextBoxTextEditor.cs
- AccessText.cs
- SqlCacheDependencySection.cs
- XPathNode.cs
- SqlMethodAttribute.cs
- NonSerializedAttribute.cs
- KeyBinding.cs
- DataRecordInternal.cs
- GeneralTransformGroup.cs
- ModuleElement.cs
- IconConverter.cs
- ComPlusServiceLoader.cs
- DataControlField.cs
- WindowsFormsLinkLabel.cs
- CqlParserHelpers.cs
- XamlTypeMapperSchemaContext.cs
- ToolboxItemCollection.cs
- XmlChildNodes.cs
- ConfigurationStrings.cs
- X509IssuerSerialKeyIdentifierClause.cs
- SelectedGridItemChangedEvent.cs
- EntityRecordInfo.cs
- CompensationDesigner.cs
- UserValidatedEventArgs.cs
- BulletedList.cs
- MarkupCompilePass1.cs
- AssemblyEvidenceFactory.cs
- PathParser.cs
- TextBox.cs
- ChameleonKey.cs
- WindowsAuthenticationModule.cs
- SynchronizedPool.cs
- WebServiceAttribute.cs
- ConstNode.cs
- TargetPerspective.cs
- CacheHelper.cs
- MonikerBuilder.cs
- hebrewshape.cs
- CachedTypeface.cs
- IgnoreFlushAndCloseStream.cs
- ScriptModule.cs
- BrushMappingModeValidation.cs
- GroupBox.cs
- TagPrefixCollection.cs
- PackUriHelper.cs
- AssemblyHash.cs
- EdmItemCollection.cs
- Dump.cs
- TraceSwitch.cs
- arabicshape.cs
- infer.cs
- RelationshipManager.cs
- Graphics.cs
- Array.cs
- ExpressionHelper.cs
- Rectangle.cs
- XPathDescendantIterator.cs
- Glyph.cs
- FontFamilyIdentifier.cs
- ToolStripItemCollection.cs
- WebPartConnectionsEventArgs.cs
- HttpHandlersSection.cs
- DataColumnChangeEvent.cs
- ProjectionRewriter.cs
- PathSegmentCollection.cs
- ImageDrawing.cs
- SslStream.cs
- ellipse.cs
- MobileErrorInfo.cs
- FrameworkTextComposition.cs
- Quaternion.cs
- MemoryFailPoint.cs
- PathNode.cs
- HttpRequestBase.cs
- SizeLimitedCache.cs
- StateMachineDesignerPaint.cs
- TypeSchema.cs
- TargetFrameworkAttribute.cs
- NameTable.cs
- SetIterators.cs