Exemple #1
0
        /// <summary>
        /// Called when [close].
        /// </summary>
        protected virtual void OnClose( )
        {
            bool cancel = false;
            DataProcessingEventHandler handler = CloseStream;

            if (handler != null)
            {
                DataProcessingEventArgs ea = new DataProcessingEventArgs
                                                 (this);
                handler
                (
                    this,
                    ea);
            }
            if (!cancel)
            {
                InnerStream.Close();
            }
        }
Exemple #2
0
        /// <summary>
        /// Called when [flush].
        /// </summary>
        protected virtual void OnFlush( )
        {
            bool cancel = false;
            DataProcessingEventHandler handler = FlushStream;

            if (handler != null)
            {
                DataProcessingEventArgs ea = new DataProcessingEventArgs
                                                 (this);
                handler
                (
                    this,
                    ea);
                cancel = ea.Cancel;
            }
            if (!cancel)
            {
                InnerStream.Flush();
            }
        }