Example #1
0
        /// <summary>
        ///     Closes the current stream and releases any resources (such as sockets and file handles) associated with the current
        ///     stream.
        /// </summary>
        public override void Close()
        {
            if (_Stream != null)
            {
                _Stream.Commit(0);

                if (Marshal.IsComObject(_Stream))
                {
                    Marshal.ReleaseComObject(_Stream);
                }

                _Stream = null;
            }
        }
Example #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ComStream" /> class.
 /// </summary>
 /// <param name="stream">The stream.</param>
 public ComStream(global::System.Runtime.InteropServices.ComTypes.IStream stream)
 {
     _Stream = stream;
 }