private static OleTxTransactionHeader ReadFrom(XmlDictionaryReader reader) { System.ServiceModel.Transactions.WsatExtendedInformation wsatInfo = null; if (reader.IsStartElement(XD.OleTxTransactionExternalDictionary.OleTxTransaction, XD.OleTxTransactionExternalDictionary.Namespace)) { Uri uri; string attribute = reader.GetAttribute(XD.CoordinationExternalDictionary.Identifier, CoordinationNamespace); if (!string.IsNullOrEmpty(attribute) && !Uri.TryCreate(attribute, UriKind.Absolute, out uri)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(System.ServiceModel.SR.GetString("InvalidWsatExtendedInfo"))); } string str2 = reader.GetAttribute(XD.CoordinationExternalDictionary.Expires, CoordinationNamespace); uint timeout = 0; if (!string.IsNullOrEmpty(str2)) { try { timeout = XmlConvert.ToUInt32(str2); } catch (FormatException exception) { DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Error); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(System.ServiceModel.SR.GetString("InvalidWsatExtendedInfo"), exception)); } catch (OverflowException exception2) { DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Error); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(System.ServiceModel.SR.GetString("InvalidWsatExtendedInfo"), exception2)); } } if (!string.IsNullOrEmpty(attribute) || (timeout != 0)) { wsatInfo = new System.ServiceModel.Transactions.WsatExtendedInformation(attribute, timeout); } } reader.ReadFullStartElement(XD.OleTxTransactionExternalDictionary.OleTxTransaction, XD.OleTxTransactionExternalDictionary.Namespace); byte[] propagationToken = ReadPropagationTokenElement(reader); while (reader.IsStartElement()) { reader.Skip(); } reader.ReadEndElement(); return(new OleTxTransactionHeader(propagationToken, wsatInfo)); }
private static OleTxTransactionHeader ReadFrom(XmlDictionaryReader reader) { System.ServiceModel.Transactions.WsatExtendedInformation wsatInfo = null; if (reader.IsStartElement(XD.OleTxTransactionExternalDictionary.OleTxTransaction, XD.OleTxTransactionExternalDictionary.Namespace)) { Uri uri; string attribute = reader.GetAttribute(XD.CoordinationExternalDictionary.Identifier, CoordinationNamespace); if (!string.IsNullOrEmpty(attribute) && !Uri.TryCreate(attribute, UriKind.Absolute, out uri)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(System.ServiceModel.SR.GetString("InvalidWsatExtendedInfo"))); } string str2 = reader.GetAttribute(XD.CoordinationExternalDictionary.Expires, CoordinationNamespace); uint timeout = 0; if (!string.IsNullOrEmpty(str2)) { try { timeout = XmlConvert.ToUInt32(str2); } catch (FormatException exception) { DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Error); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(System.ServiceModel.SR.GetString("InvalidWsatExtendedInfo"), exception)); } catch (OverflowException exception2) { DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Error); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(System.ServiceModel.SR.GetString("InvalidWsatExtendedInfo"), exception2)); } } if (!string.IsNullOrEmpty(attribute) || (timeout != 0)) { wsatInfo = new System.ServiceModel.Transactions.WsatExtendedInformation(attribute, timeout); } } reader.ReadFullStartElement(XD.OleTxTransactionExternalDictionary.OleTxTransaction, XD.OleTxTransactionExternalDictionary.Namespace); byte[] propagationToken = ReadPropagationTokenElement(reader); while (reader.IsStartElement()) { reader.Skip(); } reader.ReadEndElement(); return new OleTxTransactionHeader(propagationToken, wsatInfo); }
public OleTxTransactionHeader(byte[] propagationToken, System.ServiceModel.Transactions.WsatExtendedInformation wsatInfo) { this.propagationToken = propagationToken; this.wsatInfo = wsatInfo; }