Inheritance: System.EventArgs
Exemple #1
0
        private void OnNewData(Object sender, NewDataEventArgs e)
        {
            newData = true;

            buffer = e.Buffer;
            dataLen = e.DataLen;
        }
Exemple #2
0
        public void NewDataHandler(object sender, NewDataEventArgs e)
        {
            var messages = (IEnumerable<IMessage>) new IMessage[] {};

            lock (deserializationLock)
            {
                // ensure that the deserialization can run through and change states if necessary,
                // before any more data can be recieved and deserialized
                messages = State.Deserialize(this, e.Buffer);
            }

            foreach (var message in messages)
            {
                // call the template method
                Trigger(message);
            }
        }