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
- ContentPlaceHolder.cs
- X500Name.cs
- RadioButton.cs
- ThreadStartException.cs
- XpsSerializationManagerAsync.cs
- Brushes.cs
- CounterSampleCalculator.cs
- OSFeature.cs
- WebPartActionVerb.cs
- AuthenticationException.cs
- StreamBodyWriter.cs
- RequestCachePolicy.cs
- ConfigurationLocation.cs
- XpsFilter.cs
- Win32KeyboardDevice.cs
- XamlFigureLengthSerializer.cs
- SkinIDTypeConverter.cs
- Int32Storage.cs
- XmlSchemaFacet.cs
- PageBuildProvider.cs
- SmtpNegotiateAuthenticationModule.cs
- AssociationProvider.cs
- SerializationFieldInfo.cs
- odbcmetadatacolumnnames.cs
- EncoderExceptionFallback.cs
- PathBox.cs
- TextDecorationCollection.cs
- DeferredTextReference.cs
- ProviderConnectionPointCollection.cs
- Typography.cs
- Matrix3DValueSerializer.cs
- PropertyDescriptor.cs
- Light.cs
- SqlBinder.cs
- UInt16.cs
- AnimationLayer.cs
- EntityDataSourceContextCreatedEventArgs.cs
- AuthenticationServiceManager.cs
- EventLogStatus.cs
- InstanceCreationEditor.cs
- IPPacketInformation.cs
- TransactionChannelListener.cs
- PackageRelationshipCollection.cs
- SchemaCollectionCompiler.cs
- EditableLabelControl.cs
- InputScopeAttribute.cs
- LogEntrySerializationException.cs
- PerfService.cs
- DataFormats.cs
- XmlSerializer.cs
- LogLogRecordHeader.cs
- RequestCachePolicyConverter.cs
- EntitySqlQueryCacheKey.cs
- RemoteEndpointMessageProperty.cs
- ExpressionParser.cs
- ManagedWndProcTracker.cs
- Faults.cs
- Ticks.cs
- TableRowCollection.cs
- DictionaryChange.cs
- MouseGestureValueSerializer.cs
- DataGridViewCellStyleConverter.cs
- HttpException.cs
- LabelDesigner.cs
- FusionWrap.cs
- DataGridViewCellConverter.cs
- ErrorEventArgs.cs
- MediaScriptCommandRoutedEventArgs.cs
- DataGridTableStyleMappingNameEditor.cs
- SpinWait.cs
- ValidationHelper.cs
- ScalarType.cs
- UxThemeWrapper.cs
- ContentDefinition.cs
- CopyNodeSetAction.cs
- DBBindings.cs
- RegexRunnerFactory.cs
- Model3DCollection.cs
- PrimitiveSchema.cs
- Message.cs
- UInt32.cs
- CodeTypeReference.cs
- _ChunkParse.cs
- StructuredType.cs
- ProtocolsSection.cs
- FixedSOMTableRow.cs
- securitycriticaldataformultiplegetandset.cs
- GridProviderWrapper.cs
- TransformerInfoCollection.cs
- SessionEndingCancelEventArgs.cs
- WebControl.cs
- DecoderFallback.cs
- XPathCompileException.cs
- AppDomainProtocolHandler.cs
- ColorContextHelper.cs
- SystemNetHelpers.cs
- TemplateInstanceAttribute.cs
- HtmlLabelAdapter.cs
- PrintControllerWithStatusDialog.cs
- DbProviderFactoriesConfigurationHandler.cs