Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Diagnostics / ServiceConfigurationTraceRecord.cs / 1 / ServiceConfigurationTraceRecord.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Diagnostics { using System; using System.Diagnostics; using System.Globalization; using System.ServiceModel.Channels; using System.ServiceModel.Diagnostics; using System.Text; using System.Xml; using System.ServiceModel.Configuration; internal class ServiceConfigurationTraceRecord : TraceRecord { ServiceElement serviceElement; internal ServiceConfigurationTraceRecord(ServiceElement serviceElement) { this.serviceElement = serviceElement; } internal override string EventId { get { return TraceRecord.EventIdBase + "ServiceConfiguration" + TraceRecord.NamespaceSuffix; } } internal override void WriteTo(XmlWriter xml) { xml.WriteElementString("FoundServiceElement", ((bool)(this.serviceElement != null)).ToString(CultureInfo.InvariantCulture)); if (this.serviceElement != null) { if (!string.IsNullOrEmpty(this.serviceElement.ElementInformation.Source)) { xml.WriteElementString("ConfigurationFileSource", this.serviceElement.ElementInformation.Source); xml.WriteElementString("ConfigurationFileLineNumber", this.serviceElement.ElementInformation.LineNumber.ToString(CultureInfo.InvariantCulture)); } xml.WriteStartElement("ServiceConfigurationInformation"); this.WriteElementString("ServiceName", this.serviceElement.Name, xml); this.WriteElementString("BehaviorConfiguration", this.serviceElement.BehaviorConfiguration, xml); xml.WriteStartElement("Host"); xml.WriteStartElement("Timeouts"); xml.WriteElementString("OpenTimeout", this.serviceElement.Host.Timeouts.OpenTimeout.ToString()); xml.WriteElementString("CloseTimeout", this.serviceElement.Host.Timeouts.CloseTimeout.ToString()); xml.WriteEndElement(); if (this.serviceElement.Host.BaseAddresses.Count > 0) { xml.WriteStartElement("BaseAddresses"); foreach (BaseAddressElement baseAddress in this.serviceElement.Host.BaseAddresses) { this.WriteElementString("BaseAddress", baseAddress.BaseAddress, xml); } xml.WriteEndElement(); } xml.WriteEndElement(); xml.WriteStartElement("Endpoints"); foreach (ServiceEndpointElement serviceEndpoint in this.serviceElement.Endpoints) { xml.WriteStartElement("Endpoint"); if (serviceEndpoint.Address != null) { this.WriteElementString("Address", serviceEndpoint.Address.ToString(), xml); } this.WriteElementString("Binding", serviceEndpoint.Binding, xml); this.WriteElementString("BindingConfiguration", serviceEndpoint.BindingConfiguration, xml); this.WriteElementString("BindingName", serviceEndpoint.BindingName, xml); this.WriteElementString("BindingNamespace", serviceEndpoint.BindingNamespace, xml); this.WriteElementString("Contract", serviceEndpoint.Contract, xml); if (serviceEndpoint.ListenUri != null) { xml.WriteElementString("ListenUri", serviceEndpoint.ListenUri.ToString()); } xml.WriteElementString("ListenUriMode", serviceEndpoint.ListenUriMode.ToString()); this.WriteElementString("Name", serviceEndpoint.Name, xml); xml.WriteEndElement(); } xml.WriteEndElement(); xml.WriteEndElement(); } } void WriteElementString(string name, string value, XmlWriter xml) { if (!string.IsNullOrEmpty(value)) { xml.WriteElementString(name, value); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SByteStorage.cs
- ParallelActivityDesigner.cs
- TouchesCapturedWithinProperty.cs
- DataRowView.cs
- HttpDictionary.cs
- FunctionDescription.cs
- SiteOfOriginContainer.cs
- ArithmeticException.cs
- AnnotationAdorner.cs
- PerformanceCounterPermissionAttribute.cs
- CriticalExceptions.cs
- WinInetCache.cs
- HtmlElementEventArgs.cs
- ScriptControl.cs
- XmlReader.cs
- RolePrincipal.cs
- ProcessManager.cs
- ObjectPersistData.cs
- CqlLexer.cs
- Int64KeyFrameCollection.cs
- ListSortDescriptionCollection.cs
- BooleanExpr.cs
- HtmlWindow.cs
- AnyAllSearchOperator.cs
- HeaderedContentControl.cs
- ConnectionStringsSection.cs
- CollectionViewSource.cs
- Effect.cs
- SingleAnimation.cs
- UInt64.cs
- Storyboard.cs
- KeyGesture.cs
- XmlUnspecifiedAttribute.cs
- ScrollChrome.cs
- CodeVariableDeclarationStatement.cs
- TableRow.cs
- LogLogRecord.cs
- StrokeFIndices.cs
- DependsOnAttribute.cs
- XPathMultyIterator.cs
- FastPropertyAccessor.cs
- TreeViewEvent.cs
- KnownAssemblyEntry.cs
- PasswordRecovery.cs
- Model3D.cs
- DataBindingExpressionBuilder.cs
- Internal.cs
- HtmlDocument.cs
- XmlNodeChangedEventManager.cs
- ToolboxItemFilterAttribute.cs
- Compiler.cs
- HtmlElement.cs
- TextUtf8RawTextWriter.cs
- ProviderMetadata.cs
- EntityDataSourceSelectingEventArgs.cs
- RegexCapture.cs
- FunctionParameter.cs
- ExpressionCopier.cs
- SecurityTokenProvider.cs
- GeneralTransform3DCollection.cs
- RegexGroup.cs
- MouseGestureValueSerializer.cs
- SafeNativeMethods.cs
- MenuDesigner.cs
- XmlMessageFormatter.cs
- RegexMatch.cs
- EntitySetBase.cs
- ElementsClipboardData.cs
- RelationalExpressions.cs
- PackageDigitalSignatureManager.cs
- QilList.cs
- RefreshEventArgs.cs
- cache.cs
- RootNamespaceAttribute.cs
- TcpWorkerProcess.cs
- XmlConverter.cs
- ImageListUtils.cs
- WebBrowserUriTypeConverter.cs
- NotifyInputEventArgs.cs
- NamedObject.cs
- CompressionTransform.cs
- ConfigXmlText.cs
- ProxyAttribute.cs
- ProtectedConfigurationProviderCollection.cs
- WindowsPen.cs
- TypeHelper.cs
- Image.cs
- PngBitmapDecoder.cs
- MobileComponentEditorPage.cs
- TreeNode.cs
- FormParameter.cs
- Expander.cs
- DataGridViewBindingCompleteEventArgs.cs
- FormsAuthenticationCredentials.cs
- StreamSecurityUpgradeProvider.cs
- StorageComplexTypeMapping.cs
- PaperSource.cs
- WebBrowserUriTypeConverter.cs
- FacetValues.cs
- PassportIdentity.cs