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
- MLangCodePageEncoding.cs
- IxmlLineInfo.cs
- QilTypeChecker.cs
- WebConfigurationHostFileChange.cs
- FieldNameLookup.cs
- DependencyPropertyConverter.cs
- InternalsVisibleToAttribute.cs
- XmlUnspecifiedAttribute.cs
- SmtpSection.cs
- SqlFactory.cs
- SubMenuStyleCollection.cs
- InternalPolicyElement.cs
- CatalogZoneBase.cs
- BoundConstants.cs
- HashAlgorithm.cs
- Subtree.cs
- Rotation3DAnimationBase.cs
- COM2ExtendedBrowsingHandler.cs
- SelectionEditingBehavior.cs
- CustomAttributeFormatException.cs
- StrongNameKeyPair.cs
- ReferencedCollectionType.cs
- CatalogPartChrome.cs
- PropertyGridView.cs
- WorkflowTransactionService.cs
- bidPrivateBase.cs
- UIElement3D.cs
- ExtentCqlBlock.cs
- EntityDataSourceValidationException.cs
- ADMembershipUser.cs
- clipboard.cs
- PngBitmapDecoder.cs
- HttpCachePolicy.cs
- UserControl.cs
- CodeGroup.cs
- SettingsContext.cs
- CreateRefExpr.cs
- TimeoutValidationAttribute.cs
- DataGridViewImageColumn.cs
- DataListDesigner.cs
- WizardForm.cs
- DebuggerAttributes.cs
- BindableTemplateBuilder.cs
- SendMessageContent.cs
- DetailsViewInsertedEventArgs.cs
- Command.cs
- SqlBinder.cs
- SparseMemoryStream.cs
- XmlSerializer.cs
- EventProperty.cs
- MimeBasePart.cs
- FastEncoder.cs
- TriggerCollection.cs
- SourceSwitch.cs
- ProvidePropertyAttribute.cs
- ByteAnimationBase.cs
- DependencyPropertyHelper.cs
- ProxyFragment.cs
- SqlClientWrapperSmiStream.cs
- ProvideValueServiceProvider.cs
- ExclusiveTcpTransportManager.cs
- BaseParagraph.cs
- Decimal.cs
- FragmentNavigationEventArgs.cs
- GZipStream.cs
- RequestCacheValidator.cs
- OdbcReferenceCollection.cs
- GetWinFXPath.cs
- GenericAuthenticationEventArgs.cs
- Predicate.cs
- PointAnimationUsingKeyFrames.cs
- ItemCollection.cs
- RoleServiceManager.cs
- itemelement.cs
- DbCommandDefinition.cs
- ArrowControl.xaml.cs
- ConfigurationProperty.cs
- CompilationSection.cs
- ThrowHelper.cs
- SiteMapNodeItemEventArgs.cs
- WebBrowserNavigatingEventHandler.cs
- Line.cs
- SignedInfo.cs
- SecUtil.cs
- PersonalizableTypeEntry.cs
- OutputCacheSettings.cs
- RawTextInputReport.cs
- LogRestartAreaEnumerator.cs
- MessageSecurityVersion.cs
- BoundPropertyEntry.cs
- PathSegment.cs
- XamlToRtfParser.cs
- HiddenFieldPageStatePersister.cs
- UnsafePeerToPeerMethods.cs
- ExtenderProvidedPropertyAttribute.cs
- DisplayNameAttribute.cs
- JsonFormatReaderGenerator.cs
- SignerInfo.cs
- TextContainerChangeEventArgs.cs
- WmiInstallComponent.cs