Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Activities / System / ServiceModel / Activities / Description / EtwTrackingBehavior.cs / 1305376 / EtwTrackingBehavior.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Activities.Description { using System.Activities.Tracking; using System.Collections.ObjectModel; using System.Globalization; using System.Runtime; using System.ServiceModel.Activation; using System.ServiceModel.Activities.Tracking; using System.ServiceModel.Channels; using System.ServiceModel.Description; [Fx.Tag.XamlVisible(false)] public class EtwTrackingBehavior : IServiceBehavior { public EtwTrackingBehavior() { } public string ProfileName { get; set; } public virtual void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collectionendpoints, BindingParameterCollection bindingParameters) { } public virtual void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) { WorkflowServiceHost workflowServiceHost = serviceHostBase as WorkflowServiceHost; if (null != workflowServiceHost) { string workflowDisplayName = workflowServiceHost.Activity.DisplayName; string hostReference = string.Empty; if (AspNetEnvironment.Enabled) { VirtualPathExtension virtualPathExtension = serviceHostBase.Extensions.Find (); if (virtualPathExtension != null && virtualPathExtension.VirtualPath != null) { //Format Website name\Application Virtual Path|\relative service virtual path|serviceName string name = serviceDescription != null ? serviceDescription.Name : string.Empty; string application = virtualPathExtension.ApplicationVirtualPath; //If the application is the root, do not include it in servicePath string servicePath = virtualPathExtension.VirtualPath.Replace("~", application + "|"); hostReference = string.Format(CultureInfo.InvariantCulture, "{0}{1}|{2}", virtualPathExtension.SiteName, servicePath, name); } } TrackingProfile trackingProfile = this.GetProfile(this.ProfileName, workflowDisplayName); workflowServiceHost.WorkflowExtensions.Add( () => new EtwTrackingParticipant { ApplicationReference = hostReference, TrackingProfile = trackingProfile }); } } public virtual void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) { } TrackingProfile GetProfile(string profileName, string displayName) { DefaultProfileManager profileManager = new DefaultProfileManager(); return profileManager.GetProfile(profileName, displayName); } } } // 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
- Speller.cs
- PartManifestEntry.cs
- MethodBody.cs
- UntypedNullExpression.cs
- FixedMaxHeap.cs
- ScriptIgnoreAttribute.cs
- EntityConnection.cs
- XmlAnyAttributeAttribute.cs
- PathStreamGeometryContext.cs
- MetadataItemEmitter.cs
- ContractHandle.cs
- DataServiceSaveChangesEventArgs.cs
- GridErrorDlg.cs
- shaperfactoryquerycacheentry.cs
- ManipulationLogic.cs
- SoapIncludeAttribute.cs
- LogStore.cs
- ObjectContextServiceProvider.cs
- DrawListViewItemEventArgs.cs
- Triplet.cs
- NativeMethods.cs
- StackSpiller.Bindings.cs
- ReturnType.cs
- RequestCache.cs
- WebPartCloseVerb.cs
- XmlSchemaAny.cs
- ExpandableObjectConverter.cs
- ChainedAsyncResult.cs
- Identity.cs
- PixelShader.cs
- RuntimeArgumentHandle.cs
- EditorZone.cs
- SendMessageRecord.cs
- StaticContext.cs
- LocatorManager.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- X509CertificateChain.cs
- SecureConversationServiceCredential.cs
- EmptyReadOnlyDictionaryInternal.cs
- WindowsButton.cs
- DataErrorValidationRule.cs
- SafeNativeMethods.cs
- PropertyPathConverter.cs
- CharEntityEncoderFallback.cs
- ControlDesigner.cs
- ApplicationSecurityInfo.cs
- WindowPattern.cs
- ReaderContextStackData.cs
- BrowserCapabilitiesFactoryBase.cs
- ProcessDesigner.cs
- EventLogTraceListener.cs
- BinaryObjectInfo.cs
- OperationContractAttribute.cs
- ExecutionContext.cs
- CodeAttachEventStatement.cs
- MobileControl.cs
- NamedElement.cs
- XmlDeclaration.cs
- XmlDigitalSignatureProcessor.cs
- ChangeDirector.cs
- SafeCryptoHandles.cs
- InheritablePropertyChangeInfo.cs
- Quad.cs
- MonthChangedEventArgs.cs
- InstanceHandleConflictException.cs
- WebPageTraceListener.cs
- Translator.cs
- EntityDesignerUtils.cs
- SHA512Managed.cs
- MessageQueueKey.cs
- HtmlEncodedRawTextWriter.cs
- ReliableRequestSessionChannel.cs
- RuntimeVariablesExpression.cs
- SerializerDescriptor.cs
- FontStyleConverter.cs
- SapiGrammar.cs
- ProviderException.cs
- AutomationPeer.cs
- ScrollContentPresenter.cs
- FileLoadException.cs
- RuleSetDialog.cs
- OneOfScalarConst.cs
- HtmlInputFile.cs
- SiteMapDesignerDataSourceView.cs
- mda.cs
- PageCache.cs
- InputLangChangeRequestEvent.cs
- ObjectReaderCompiler.cs
- ServiceTimeoutsElement.cs
- UserControl.cs
- UiaCoreProviderApi.cs
- CodeAttributeArgumentCollection.cs
- LeftCellWrapper.cs
- HttpCapabilitiesBase.cs
- EventLogInformation.cs
- RegexBoyerMoore.cs
- IndexerNameAttribute.cs
- ValidateNames.cs
- ToolboxItem.cs
- FormatControl.cs