Hi Team,
Kindly find below method(TestCall) which is from Oxygene
{$SCOPEDENUMS ON}
WeekDay = public flags (Monday, Tuesday, Wednessday);
WeekDays = public set of WeekDay;
function Class1.TestCall(WD: WeekDays): Boolean;
begin
var w : WeekDays := [WeekDay.Tuesday, WeekDay.Wednessday];
if WeekDay.Wednessday in w then // This is working as its only in Oxygene world
result := True else
result := False;
if WeekDay.Wednessday in WD then // This is NOT working as WD is comming from C# world
result := True else
result := False;
end;
- When we are calling this method from C# application ‘in’ operator failing and return false.
- When calling from C#, Method(TestCall) asking for the casting as below
class1.TestCall((int)WeekDay.Wednessday); // Need to do casting
Please find attached sample project for more details.
Could you please have a look into this, Let us know if required more details.
ClassLibrary1.zip (203.2 KB)
Thankyou!