public override void ConvertToJavascript(JavascriptConversionContext context) { if (context.Node is MethodCallExpression methodCall) { if (methodCall.Method.DeclaringType == typeof(MyClassWithEnum)) { switch (methodCall.Method.Name) { case "SetGender": { context.PreventDefault(); using (context.Operation(JavascriptOperationTypes.Call)) { using (context.Operation(JavascriptOperationTypes.IndexerProperty)) { context.WriteNode(methodCall.Object); context.WriteAccessor("SetGender"); } context.WriteManyIsolated('(', ')', ',', methodCall.Arguments); } return; } } } } }