Пример #1
0
        public void Invoke(object sender, EventArgs e)
        {
            var msg = new RpcEventCallMessage
            {
                Name = Name,
                Args = new List <object> {
                    sender, e
                }
            };

            communicator.Write(RpcServices.Serialize(msg));
        }
Пример #2
0
        private void Communicator_DataReceived(object sender, MemoryMappedDataReceivedEventArgs e)
        {
            var r = (RpcEventCallMessage)RpcServices.Deserialize(e.Data);

            if (r.Name == Name)
            {
                foreach (var h in handlers)
                {
                    h(r.Args[0], (EventArgs)r.Args[1]);
                }
            }
        }