Forum: IronRuby Implementing generic interface

A7f8c7e88d607e6d93d681be1bcae53c?d=identicon&s=25 Arseny Sizov (Guest)
on 2010-11-09 09:59
(Received via mailing list)
Hi all,

I need to implement .NET generic interface and pass this implementation
to
.NET generic method. Is it possible in IronRuby?

What I have in .NET:

interface Subscriber {
        void Subscribe<TMessage>(IMessagesListener<TMessage> listener)
where TMessage : IBasicMessage;
}

    public interface IMessagesListener<in TMessage>
        where TMessage : IBasicMessage
    {
        void Handle(TMessage message);
    }

I need to rewrite this code in ironruby:

class MyMessageListener <TMyMessage> :
        IMessageListener<TMyMessage>
{
            void IMessagesListener<TMyMessage>.Handle(TMyMessage
message)
            {

            }
}

subscriber.Subscribe<TMyMessage>(new MyMessageListener<TMyMessage>());

Is it possible?

Thanks in advance.


Best regards,
Arseny Sizov.




---

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and delete this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for
additional EU corporate and regulatory disclosures.
This topic is locked and can not be replied to.