How to bind iOS library with multiple constructors with the same C# signature

JayDeBoerJayDeBoer USUniversity

Hello, I am trying to bind a iOS library with the following constructors.

- (id)initDirectExchangeWithName:(NSString*)theName onChannel:(AMQPChannel*)theChannel isPassive:(BOOL)passive isDurable:(BOOL)durable getsAutoDeleted:(BOOL)autoDelete;
- (id)initFanoutExchangeWithName:(NSString*)theName onChannel:(AMQPChannel*)theChannel isPassive:(BOOL)passive isDurable:(BOOL)durable getsAutoDeleted:(BOOL)autoDelete;
- (id)initTopicExchangeWithName:(NSString*)theName onChannel:(AMQPChannel*)theChannel isPassive:(BOOL)passive isDurable:(BOOL)durable getsAutoDeleted:(BOOL)autoDelete;

The catch is that they only differ by the Objective-C method names. They all share the same parameters. My current C# bindings look like this.

[Export ("initDirectExchangeWithName:onChannel:isPassive:isDurable:getsAutoDeleted:")]
IntPtr Constructor(string name, AMQPChannel channel, bool isPassive, bool isDurable, bool isAutoDelete);

[Export ("initFanoutExchangeWithName:onChannel:isPassive:isDurable:getsAutoDeleted:")]
IntPtr Constructor(string name, AMQPChannel channel, bool isPassive, bool isDurable, bool isAutoDelete);

[Export ("initTopicExchangeWithName:onChannel:isPassive:isDurable:getsAutoDeleted:")]
IntPtr Constructor(string name, AMQPChannel channel, bool isPassive, bool isDurable, bool isAutoDelete);

The problem is that in C# I am not allowed to have multiple constructors with the same parameters for obvious reasons.

How do I overcome this?

Thanks for the help!

Jay

Best Answer

Answers

  • JayDeBoerJayDeBoer USUniversity

    @DaveHunt That was my backup plan if there was no other way. :) Thanks for the confirmation.

Sign In or Register to comment.