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
- SemaphoreSecurity.cs
- basevalidator.cs
- AuthenticateEventArgs.cs
- SecureEnvironment.cs
- LeaseManager.cs
- cryptoapiTransform.cs
- TaiwanCalendar.cs
- MetaModel.cs
- HtmlTableRowCollection.cs
- UnaryNode.cs
- Expander.cs
- HostSecurityManager.cs
- ellipse.cs
- CloudCollection.cs
- WsdlServiceChannelBuilder.cs
- EntityProviderFactory.cs
- DocumentApplicationJournalEntry.cs
- DesignerSerializerAttribute.cs
- DbConnectionPoolCounters.cs
- ObjectQuery.cs
- DataGridViewCellCancelEventArgs.cs
- UnmanagedMemoryStreamWrapper.cs
- FromRequest.cs
- PassportAuthentication.cs
- DeviceSpecificDialogCachedState.cs
- WorkflowOperationBehavior.cs
- CurrentChangingEventManager.cs
- WebPartDisplayMode.cs
- DateTimePicker.cs
- UriTemplateTable.cs
- SpellerHighlightLayer.cs
- AutoResetEvent.cs
- NameValueConfigurationElement.cs
- WebServiceReceive.cs
- CatalogZoneAutoFormat.cs
- FormViewInsertEventArgs.cs
- GetWinFXPath.cs
- DataService.cs
- GroupBox.cs
- ConstructorBuilder.cs
- MailDefinition.cs
- DirtyTextRange.cs
- XmlChildNodes.cs
- LocalizableResourceBuilder.cs
- Vector3DCollection.cs
- DbConnectionFactory.cs
- ImagingCache.cs
- DbConnectionPoolIdentity.cs
- TemplateAction.cs
- SmtpReplyReader.cs
- FamilyMap.cs
- Object.cs
- ItemsPresenter.cs
- TabItemAutomationPeer.cs
- CompositeActivityDesigner.cs
- MultipartContentParser.cs
- RegistrationServices.cs
- InfoCardService.cs
- SaveFileDialog.cs
- PartialClassGenerationTask.cs
- TextWriterTraceListener.cs
- TransactionScope.cs
- Column.cs
- RequestQueue.cs
- GradientBrush.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- XmlSortKeyAccumulator.cs
- BindingsCollection.cs
- Triplet.cs
- TriggerAction.cs
- DoubleAnimation.cs
- SubpageParagraph.cs
- ContainsRowNumberChecker.cs
- Int32Rect.cs
- XmlNullResolver.cs
- StreamWriter.cs
- SelectionGlyphBase.cs
- SecurityTokenAttachmentMode.cs
- PasswordPropertyTextAttribute.cs
- DisableDpiAwarenessAttribute.cs
- TextDocumentView.cs
- TTSVoice.cs
- SettingsSection.cs
- SystemIPv6InterfaceProperties.cs
- BufferModeSettings.cs
- RichTextBoxAutomationPeer.cs
- Int64Converter.cs
- ReferencedAssembly.cs
- HitTestParameters3D.cs
- CatalogPart.cs
- EncryptedXml.cs
- PersonalizationStateQuery.cs
- TableDetailsCollection.cs
- RIPEMD160Managed.cs
- WebControlParameterProxy.cs
- StaticDataManager.cs
- EventlogProvider.cs
- HostingEnvironmentSection.cs
- AssemblyCache.cs
- URLEditor.cs