Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

binding - how to prevent a duplicate method

$
0
0

I'm binding a jar, and it is creating this in the auto-generated binding wrapper

#pragma warning disable 0649
            public EventHandler<MessageEventArgs> OnMessageHandler;
#pragma warning restore 0649

            public void OnMessage (byte[] data)
            {
                var __h = OnMessageHandler;
                if (__h != null)
                    __h (sender, new MessageEventArgs (data));
            }
#pragma warning disable 0649
            public EventHandler<MessageEventArgs> OnMessageHandler;
#pragma warning restore 0649

            public void OnMessage (string message)
            {
                var __h = OnMessageHandler;
                if (__h != null)
                    __h (sender, new MessageEventArgs (message));
            }

This won't build because OnMessageHandler is declared twice. I can manually delete one of the instances (I really only need the one that handles the string parameter) and it works, but this has to be done every time we do a clean build.

a. is there a better way to handle this, rather than deleting the one I don't use?

b. how can I automate this? Is there a Transform mapping I can add that will handle it?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>