{
return as_generator(
indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
- << indent.inc() << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));\n"
+ << indent.inc() << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.Arg));\n"
<< indent.inc() << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n"
).generate(sink, attributes::unused, *context);
}
match const str_table[] =
{
- {"string", [] { return "e.arg"; }}
- , {"stringshare", [] { return "e.arg"; }}
+ {"string", [] { return "e.Arg"; }}
+ , {"stringshare", [] { return "e.Arg"; }}
};
auto str_accept_func = [&](std::string const& conversion)
match const value_table [] =
{
- {"bool", [] { return "e.arg ? (byte) 1 : (byte) 0"; }}
- , {"Eina.Error", [] { return "(int)e.arg"; }}
- , {nullptr, [] { return "e.arg"; }}
+ {"bool", [] { return "e.Arg ? (byte) 1 : (byte) 0"; }}
+ , {"Eina.Error", [] { return "(int)e.Arg"; }}
+ , {nullptr, [] { return "e.Arg"; }}
};
auto value_accept_func = [&](std::string const& conversion)
if (eina::optional<bool> b = type_match::get_match(value_table, filter_func, value_accept_func))
return *b;
- return value_accept_func("e.args");
+ return value_accept_func("e.Args");
}
bool operator()(grammar::attributes::klass_name const&) const
{
auto const& indent = current_indentation(*context);
return as_generator(
indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
- << indent.inc() << "IntPtr info = e.arg.NativeHandle;\n"
+ << indent.inc() << "IntPtr info = e.Arg.NativeHandle;\n"
<< indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
).generate(sink, attributes::unused, *context);
}
std::string info_variable;
if (type.outer.base_type == "iterator")
- info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.arg, ") + (is_own ? "true" : "false") + ");\n";
+ info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
else if (type.outer.base_type == "accessor")
- info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToAccessor(e.arg, ") + (is_own ? "true" : "false") + ");\n";
+ info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToAccessor(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
else if (type.outer.base_type == "array")
- info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeArray(e.arg, ") + (is_own ? "true" : "false") + ");\n";
+ info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeArray(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
else if (type.outer.base_type == "list")
- info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeList(e.arg, ") + (is_own ? "true" : "false") + ");\n";
+ info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeList(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
else
- info_variable = "IntPtr info = e.arg.Handle;\n";
+ info_variable = "IntPtr info = e.Arg.Handle;\n";
return as_generator(indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
<< indent.inc() << info_variable
<< indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
if (!as_generator(scope_tab(2) << "/// </summary>\n"
<< scope_tab(2) << "/// <value>" << documentation_string << "</value>\n"
- << scope_tab(2) << "public " << type << " arg { get; set; }\n"
+ << scope_tab(2) << "public " << type << " Arg { get; set; }\n"
<< scope_tab << "}\n\n"
).generate(sink, std::make_tuple(evt.documentation.summary, *etype), context))
return false;
auto sub_context = change_indentation(indent.inc().inc(), context);
if (!as_generator(", info => new " << wrapper_args_type << "{ "
- << "arg = ").generate(arg_initializer_sink, attributes::unused, context))
+ << "Arg = ").generate(arg_initializer_sink, attributes::unused, context))
return false;
if (!(*etype).original_type.visit(unpack_event_args_visitor<decltype(arg_initializer_sink), decltype(sub_context)>{arg_initializer_sink, &sub_context, *etype}))
return false;
string received_string = null;
obj.EvtWithStringEvent += (object sender, Dummy.TestObjectEvtWithStringEventArgs e) => {
- received_string = e.arg;
+ received_string = e.Arg;
};
obj.EmitEventWithString("Some args");
int received_int= 0;
obj.EvtWithIntEvent += (object sender, Dummy.TestObjectEvtWithIntEventArgs e) => {
- received_int = e.arg;
+ received_int = e.Arg;
};
obj.EmitEventWithInt(-1984);
bool received_bool = false;
obj.EvtWithBoolEvent += (object sender, Dummy.TestObjectEvtWithBoolEventArgs e) => {
- received_bool = e.arg;
+ received_bool = e.Arg;
};
obj.EmitEventWithBool(true);
var obj = new Dummy.TestObject();
uint received_uint = 0;
obj.EvtWithUintEvent += (object sender, Dummy.TestObjectEvtWithUintEventArgs e) => {
- received_uint = e.arg;
+ received_uint = e.Arg;
};
obj.EmitEventWithUint(0xbeef);
var obj = new Dummy.TestObject();
float received_float = 0;
obj.EvtWithFloatEvent += (object sender, Dummy.TestObjectEvtWithFloatEventArgs e) => {
- received_float = e.arg;
+ received_float = e.Arg;
};
obj.EmitEventWithFloat(3.14f);
double received_double = 0;
double reference = float.MaxValue + 42;
obj.EvtWithDoubleEvent += (object sender, Dummy.TestObjectEvtWithDoubleEventArgs e) => {
- received_double = e.arg;
+ received_double = e.Arg;
};
obj.EmitEventWithDouble(reference);
Dummy.TestObject received_obj = null;
obj.EvtWithObjEvent += (object sender, Dummy.TestObjectEvtWithObjEventArgs e) => {
- received_obj = e.arg;
+ received_obj = e.Arg;
};
var sent_obj = new Dummy.TestObject();
Eina.Error received_error = 0;
obj.EvtWithErrorEvent += (object sender, Dummy.TestObjectEvtWithErrorEventArgs e) => {
- received_error = e.arg;
+ received_error = e.Arg;
};
Eina.Error sent_error = -2001;
Dummy.StructSimple received_struct = default(Dummy.StructSimple);
obj.EvtWithStructEvent += (object sender, Dummy.TestObjectEvtWithStructEventArgs e) => {
- received_struct = e.arg;
+ received_struct = e.Arg;
};
Dummy.StructSimple sent_struct = new Dummy.StructSimple(fstring: "Struct Event");
Dummy.StructComplex received_struct = default(Dummy.StructComplex);
obj.EvtWithStructComplexEvent += (object sender, Dummy.TestObjectEvtWithStructComplexEventArgs e) => {
- received_struct = e.arg;
+ received_struct = e.Arg;
};
Dummy.StructComplex sent_struct = StructHelpers.structComplexWithValues();
sent.Append("Ghi");
obj.EvtWithArrayEvent += (object sender, Dummy.TestObjectEvtWithArrayEventArgs e) => {
- received = e.arg as List<string>;
+ received = e.Arg as List<string>;
};
obj.EmitEventWithArray(sent);
// attach to evt with int
EventHandler<Dummy.TestObjectEvtWithIntEventArgs> cb = (object sender, Dummy.TestObjectEvtWithIntEventArgs args) => {
callbackCalled = true;
- received = args.arg;
+ received = args.Arg;
Test.Assert(Object.ReferenceEquals(sender, wref.Target));
};