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
- AssociationEndMember.cs
- DecoderNLS.cs
- SqlDeflator.cs
- RangeValidator.cs
- streamingZipPartStream.cs
- SubpageParaClient.cs
- MessageSmuggler.cs
- NamespaceQuery.cs
- BaseParaClient.cs
- MatrixCamera.cs
- Span.cs
- HtmlButton.cs
- ISessionStateStore.cs
- RangeValidator.cs
- RelatedImageListAttribute.cs
- HttpProfileGroupBase.cs
- ListView.cs
- RegistryPermission.cs
- Util.cs
- AdapterUtil.cs
- ToggleButtonAutomationPeer.cs
- ExpressionDumper.cs
- SplashScreen.cs
- IdentitySection.cs
- NameNode.cs
- SoapException.cs
- _StreamFramer.cs
- WebMessageEncodingElement.cs
- SignerInfo.cs
- CodeDomComponentSerializationService.cs
- rsa.cs
- FormattedTextSymbols.cs
- MdiWindowListItemConverter.cs
- CorrelationTokenInvalidatedHandler.cs
- _FixedSizeReader.cs
- HttpChannelHelpers.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- TagPrefixInfo.cs
- HttpStaticObjectsCollectionBase.cs
- DynamicObjectAccessor.cs
- Table.cs
- RepeatInfo.cs
- TableRowCollection.cs
- SQLRoleProvider.cs
- FormsAuthenticationModule.cs
- TableRow.cs
- XLinq.cs
- DecoderFallbackWithFailureFlag.cs
- CodeArgumentReferenceExpression.cs
- XmlAttributeCache.cs
- httpstaticobjectscollection.cs
- FixedFindEngine.cs
- AsyncOperationManager.cs
- OleDbDataAdapter.cs
- MenuItemBindingCollection.cs
- ClientUIRequest.cs
- Walker.cs
- PauseStoryboard.cs
- CodeDirectiveCollection.cs
- SafeNativeMethods.cs
- CorruptingExceptionCommon.cs
- APCustomTypeDescriptor.cs
- BindingWorker.cs
- SqlConnection.cs
- DataGridViewTopLeftHeaderCell.cs
- FilterableAttribute.cs
- StandardToolWindows.cs
- ThreadAbortException.cs
- PersonalizationDictionary.cs
- ServiceNameElementCollection.cs
- PackageRelationship.cs
- WebConfigurationHostFileChange.cs
- Decorator.cs
- TimeoutTimer.cs
- SystemIPInterfaceStatistics.cs
- BindingGroup.cs
- ToolCreatedEventArgs.cs
- StoryFragments.cs
- WebException.cs
- RectangleHotSpot.cs
- BitmapFrameDecode.cs
- ReachPrintTicketSerializerAsync.cs
- xdrvalidator.cs
- XmlSchemaAttributeGroup.cs
- AttachmentCollection.cs
- HMACSHA256.cs
- JumpItem.cs
- EntityDataSourceReferenceGroup.cs
- OledbConnectionStringbuilder.cs
- SqlConnectionPoolProviderInfo.cs
- ClientSettingsStore.cs
- KeyToListMap.cs
- TextDecorationLocationValidation.cs
- DataGridCellClipboardEventArgs.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- RawStylusActions.cs
- BCryptHashAlgorithm.cs
- AddingNewEventArgs.cs
- Size3D.cs
- relpropertyhelper.cs