Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / TransactionBridge / Microsoft / Transactions / Wsat / Messaging / IdentifierElement.cs / 1 / IdentifierElement.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // Define theelement that lives in an element // inside an header using System; using System.ServiceModel; using System.Xml; using System.Xml.Schema; using System.Xml.Serialization; using Microsoft.Transactions.Wsat.Protocol; namespace Microsoft.Transactions.Wsat.Messaging { abstract class IdentifierElement : IXmlSerializable { string identifier; CoordinationStrings coordinationStrings; public IdentifierElement(ProtocolVersion protocolVersion) : this(protocolVersion, null) {} public IdentifierElement(ProtocolVersion protocolVersion, string identifier) { this.identifier = identifier; this.coordinationStrings = CoordinationStrings.Version(protocolVersion); } public string Identifier { get { return this.identifier; } } void IXmlSerializable.ReadXml(XmlReader reader) { this.identifier = reader.ReadElementString(this.coordinationStrings.Identifier, this.coordinationStrings.Namespace).Trim(); } void IXmlSerializable.WriteXml(XmlWriter writer) { writer.WriteValue(this.identifier); } XmlSchema IXmlSerializable.GetSchema() { return null; } public static IdentifierElement Instance(string identifier, ProtocolVersion protocolVersion) { ProtocolVersionHelper.AssertProtocolVersion(protocolVersion, typeof(IdentifierElement), "V"); //assert valid protocol version switch (protocolVersion) { case ProtocolVersion.Version10 : return new IdentifierElement10(identifier); case ProtocolVersion.Version11 : return new IdentifierElement11(identifier); default : return null; // inaccessible path because we have asserted the protocol version } } } [XmlRoot(ElementName = CoordinationExternalStrings.Identifier, Namespace = CoordinationExternal10Strings.Namespace)] class IdentifierElement10 : IdentifierElement { public IdentifierElement10() : this(null) {} public IdentifierElement10(string identifier) : base(ProtocolVersion.Version10, identifier) {} } [XmlRoot(ElementName = CoordinationExternalStrings.Identifier, Namespace = CoordinationExternal11Strings.Namespace)] class IdentifierElement11 : IdentifierElement { public IdentifierElement11() : this(null) {} public IdentifierElement11(string identifier) : base(ProtocolVersion.Version11, identifier) {} } } // 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
- ActiveDocumentEvent.cs
- DocumentGridPage.cs
- GeneratedContractType.cs
- StrongNamePublicKeyBlob.cs
- JsonXmlDataContract.cs
- Symbol.cs
- Privilege.cs
- CryptoSession.cs
- InlineCollection.cs
- LinkClickEvent.cs
- MembershipAdapter.cs
- DateTimeOffsetConverter.cs
- SqlLiftIndependentRowExpressions.cs
- ActivityTypeResolver.xaml.cs
- SuppressMergeCheckAttribute.cs
- AspNetSynchronizationContext.cs
- XsdValidatingReader.cs
- ContextInformation.cs
- SystemIPInterfaceStatistics.cs
- ReflectionPermission.cs
- XmlSchemaValidator.cs
- XmlWrappingWriter.cs
- GenericEnumerator.cs
- BufferedGraphicsContext.cs
- AssemblyBuilderData.cs
- ClockGroup.cs
- TextOptionsInternal.cs
- ContractsBCL.cs
- ActionItem.cs
- DefaultWorkflowLoaderService.cs
- NavigationProperty.cs
- UrlUtility.cs
- TiffBitmapDecoder.cs
- BindingCompleteEventArgs.cs
- JsonWriter.cs
- Inflater.cs
- WindowsTreeView.cs
- _ContextAwareResult.cs
- CompositeCollection.cs
- Int32RectValueSerializer.cs
- ObjectToModelValueConverter.cs
- TrackingRecordPreFilter.cs
- RequestCachingSection.cs
- Metadata.cs
- OracleParameterBinding.cs
- WebPart.cs
- PersonalizationProviderCollection.cs
- PasswordDeriveBytes.cs
- XmlLangPropertyAttribute.cs
- CodePageUtils.cs
- DesignTableCollection.cs
- metadatamappinghashervisitor.cs
- CacheDependency.cs
- DbParameterHelper.cs
- SHA512Managed.cs
- LocalizationParserHooks.cs
- NetWebProxyFinder.cs
- CanonicalXml.cs
- CancelAsyncOperationRequest.cs
- PenThreadPool.cs
- WindowsTitleBar.cs
- LogoValidationException.cs
- ProfessionalColors.cs
- ScriptingScriptResourceHandlerSection.cs
- EntityClientCacheEntry.cs
- XmlMapping.cs
- XsdDataContractExporter.cs
- EntryWrittenEventArgs.cs
- Membership.cs
- ControlBindingsCollection.cs
- oledbmetadatacollectionnames.cs
- Cursors.cs
- NullEntityWrapper.cs
- ProviderMetadata.cs
- XPathDocumentIterator.cs
- IItemProperties.cs
- Function.cs
- HtmlElementErrorEventArgs.cs
- DependencyStoreSurrogate.cs
- SEHException.cs
- NumericUpDownAcceleration.cs
- StringFunctions.cs
- ProvidePropertyAttribute.cs
- DataTablePropertyDescriptor.cs
- DbCommandDefinition.cs
- WindowsGraphics2.cs
- DbProviderFactory.cs
- StatusStrip.cs
- RadioButton.cs
- FormsAuthenticationEventArgs.cs
- WindowsIPAddress.cs
- PropertySourceInfo.cs
- SQLResource.cs
- WebReferencesBuildProvider.cs
- ConnectorDragDropGlyph.cs
- SecurityContextSecurityTokenResolver.cs
- DllNotFoundException.cs
- SessionEndingEventArgs.cs
- CommandField.cs
- __ComObject.cs