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
- PageCodeDomTreeGenerator.cs
- TagNameToTypeMapper.cs
- SqlDataSourceSelectingEventArgs.cs
- MasterPageBuildProvider.cs
- CopyCodeAction.cs
- AuthenticationException.cs
- CodeGotoStatement.cs
- webclient.cs
- OpenFileDialog.cs
- ValueSerializer.cs
- PageVisual.cs
- WindowProviderWrapper.cs
- SemanticBasicElement.cs
- MinimizableAttributeTypeConverter.cs
- WsdlInspector.cs
- XamlUtilities.cs
- ReadWriteSpinLock.cs
- SizeKeyFrameCollection.cs
- SymLanguageType.cs
- QilStrConcat.cs
- XmlTextAttribute.cs
- FloaterParagraph.cs
- UrlPath.cs
- documentsequencetextview.cs
- ToolStripDropDownClosingEventArgs.cs
- PageMediaSize.cs
- StrokeDescriptor.cs
- Brushes.cs
- JulianCalendar.cs
- CreateUserWizardStep.cs
- SiteMapNodeItem.cs
- DebugView.cs
- BmpBitmapEncoder.cs
- XmlSchemaParticle.cs
- XmlSchemaValidator.cs
- LinkTarget.cs
- SchemaType.cs
- SpStreamWrapper.cs
- InfoCardTraceRecord.cs
- MemberPathMap.cs
- BitmapEncoder.cs
- XPathEmptyIterator.cs
- IndexedString.cs
- SessionState.cs
- __FastResourceComparer.cs
- EncodingNLS.cs
- TableCell.cs
- RefreshPropertiesAttribute.cs
- OleDbErrorCollection.cs
- Html32TextWriter.cs
- SystemEvents.cs
- XmlDataImplementation.cs
- SafeEventLogReadHandle.cs
- DataKeyCollection.cs
- Win32.cs
- ObjectAnimationUsingKeyFrames.cs
- ColorTranslator.cs
- TableItemProviderWrapper.cs
- RIPEMD160.cs
- TreeViewItemAutomationPeer.cs
- SqlCacheDependencyDatabaseCollection.cs
- CellLabel.cs
- BrushConverter.cs
- SqlCacheDependencyDatabaseCollection.cs
- ThousandthOfEmRealDoubles.cs
- DataGridColumn.cs
- HttpWebRequest.cs
- FontInfo.cs
- CacheEntry.cs
- SimpleBitVector32.cs
- WebPartConnectionsCancelEventArgs.cs
- CaseKeyBox.xaml.cs
- FocusWithinProperty.cs
- XmlSchemaAll.cs
- XmlUnspecifiedAttribute.cs
- Task.cs
- TextTreeTextElementNode.cs
- MethodBuilderInstantiation.cs
- Compilation.cs
- COM2PropertyDescriptor.cs
- loginstatus.cs
- BoolExpression.cs
- GeometryHitTestResult.cs
- TextRange.cs
- CalloutQueueItem.cs
- NullToBooleanConverter.cs
- Matrix3D.cs
- BuildProvider.cs
- User.cs
- BmpBitmapEncoder.cs
- SchemaImporterExtensionElement.cs
- DesignerHost.cs
- ModulesEntry.cs
- WebServiceEnumData.cs
- SeparatorAutomationPeer.cs
- InputLangChangeRequestEvent.cs
- TemplateComponentConnector.cs
- BinaryWriter.cs
- DocumentPage.cs
- ScriptControlManager.cs