Node.net.Modules.Streams.NodeReadableStream.OnAttach C# (CSharp) Method

OnAttach() private method

Recieve notification that an event has been attached.
private OnAttach ( string name ) : void
name string
return void
        private void OnAttach(string name)
        {
            switch (name)
            {
                case "data":
                    // Send any data messages that may be in the queue.
                    lock (this.m_ResumeLock)
                    {
                        List<DataEventArgs> copy = this.m_Queue.Where(r => true).ToList();
                        this.m_Queue.Clear();
                        foreach (DataEventArgs e in copy)
                        {
                            if (this.m_PipeDestination != null)
                                this.m_PipeDestination.write(new NodeBuffer(this.Env, e.Data, 0, e.Data.Length)); // TODO: Support writing as string as well?
                            if (this.OnData != null)
                                this.OnData(this, e);
                        }
                    }
                    return;
            }
        }