public override bool Read(LogReadFlags flags) { using (Session.Logger.CreateCallstack()) { bool result; bool retry; do { result = DoRead(); retry = false; if (result && IsNonEmptyElement("failure")) { SessionRemoteException e = SessionRemoteException.ReadFailure(this); Session.RaiseFailed(e); if ((flags & LogReadFlags.ThrowFailures) == 0) { retry = true; } else { throw e; } } }while (retry); return(result); } }
public void WaitForNonEmptyElement(string localName, LogReadFlags flags) { if (!TryWaitForNonEmptyElement(localName, flags)) { throw Session.Logger.WriteException(SessionLocalException.CreateElementNotFound(Session, localName)); } }
public override bool Read(LogReadFlags flags) { using (Session.Logger.CreateCallstack()) { bool result; bool retry; do { result = DoRead(); retry = false; if (result && IsNonEmptyElement("failure")) { SessionRemoteException e = SessionRemoteException.ReadFailure(this); Session.RaiseFailed(e); if ((flags & LogReadFlags.ThrowFailures) == 0) { retry = true; } else { throw e; } } } while (retry); return result; } }
public override bool Read(LogReadFlags flags) { bool result = base.Read(flags); if (_read && !_disposing) { throw Session.Logger.WriteException(new SessionLocalException(Session, "Session has unexpectedly closed")); } return(result); }
public override bool Read(LogReadFlags flags) { bool result = base.Read(flags); if (_read && !_disposing) { throw new SessionLocalException(Session, "Session has unexpectedly closed"); } return result; }
public void ReadToEnd(LogReadFlags flags) { using (Session.Logger.CreateCallstack()) { if (!_read) { while (Read(flags)) { } } } }
public bool TryWaitForNonEmptyElement(string localName, LogReadFlags flags) { bool result = false; while (!result && Read(flags)) { if (IsNonEmptyElement(localName)) { result = true; } } return(result); }
public override bool Read(LogReadFlags flags) { if (_read) { throw new InvalidOperationException("Element already read to the end"); } bool result = _parentReader.Read(flags); if (result && IsEndElement(_localName) && (Depth == _depth)) { result = false; _read = true; } return result; }
public override bool Read(LogReadFlags flags) { if (_read) { throw new InvalidOperationException("Element already read to the end"); } bool result = _parentReader.Read(flags); if (result && IsEndElement(_localName) && (Depth == _depth)) { result = false; _read = true; } return(result); }
public override bool Read(LogReadFlags flags) { if (_read) { throw Session.Logger.WriteException( new InvalidOperationException( string.Format(CultureInfo.CurrentCulture, "Element {0} already read to the end", _token))); } bool result = _parentReader.Read(flags); if (result && IsEndElement(_localName) && (Depth == _depth)) { result = false; Session.Logger.WriteLineLevel(1, "Element {0} read to the end", _token); _read = true; } return(result); }
public bool TryWaitForNonEmptyElement(string localName, LogReadFlags flags) { bool result = false; while (!result && Read(flags)) { if (IsNonEmptyElement(localName)) { result = true; } } return result; }
public ElementLogReader WaitForNonEmptyElementAndCreateLogReader(string localName, LogReadFlags flags) { WaitForNonEmptyElement(localName, flags); return(CreateLogReader()); }
public abstract bool Read(LogReadFlags flags);
private static void ReadElement(CustomLogReader reader, LogReadFlags flags) { while (reader.Read(flags)) { } }
public ElementLogReader WaitForNonEmptyElementAndCreateLogReader(string localName, LogReadFlags flags) { WaitForNonEmptyElement(localName, flags); return CreateLogReader(); }
public void WaitForNonEmptyElement(string localName, LogReadFlags flags) { if (!TryWaitForNonEmptyElement(localName, flags)) { throw SessionLocalException.CreateElementNotFound(Session, localName); } }