示例#1
0
        public static void event_with_struct_payload()
        {
            var obj = new Dummy.TestObject();

            Dummy.StructSimple received_struct = default(Dummy.StructSimple);

            obj.EvtWithStructEvent += (object sender, Dummy.TestObjectEvtWithStructEventArgs e) => {
                received_struct = e.Arg;
            };

            Dummy.StructSimple sent_struct = new Dummy.StructSimple(fstring: "Struct Event");

            obj.EmitEventWithStruct(sent_struct);

            Test.AssertEquals(sent_struct.Fstring, received_struct.Fstring);
            obj.Dispose();
        }