/// <summary> /// This method disposes the collection. /// </summary> /// <param name="disposing"></param> public override void Dispose(bool disposing) { if (!disposed && disposing) { mBoundaryTerminator = null; base.Dispose(disposing); } disposed = true; }
/// <summary> /// This method validates the boundary. /// </summary> /// <param name="boundary">The ascii byte collection.</param> protected virtual void BoundaryValidate(byte[] boundary) { if (boundary.Length > 69) { throw new ArgumentOutOfRangeException("boundary", "boundary is over the maximum permitted length of 69 characters."); } mBoundaryTerminator = new MatchSequenceTerminator <byte, byte>(boundary, false);; }
static MimeMatchCollection() { mTerminatorDashRequired = new MatchSequenceTerminator <byte, byte>( new byte[] { (byte)'-', (byte)'-' }, true); mTerminatorDashOptionalTerminator = new MatchSequenceSkipOrFailTerminator <byte, byte>( new byte[] { (byte)'-', (byte)'-' }, false, null, null); mTerminatorWHTSPSkip = new MatchSkipTerminator <byte, byte>( new byte[] { 9, 32 }, true); mTerminatorCRLF = new MatchSequenceTerminator <byte, byte>( new byte[] { 13, 10 }, false); }
/// <summary> /// This constructor initializes the collection with the boundary. /// </summary> /// <param name="boundary"></param> internal MimeMatchCollection(MatchSequenceTerminator <byte, byte> boundaryTerminator) : base(null) { mBoundaryTerminator = boundaryTerminator; }