Ok.  Here is my updated one.  This work though.  I just hope it is
correct.  Thanks for the help in #mono to duncan and rxdan.

using System;

namespace MyStuff
{
        public interface IParameter
        {
                string ParameterName{get;set;}
        }

        public class Parameter : IParameter 
        {
                private string parmName = null;

                public string ParameterName 
                {
                        get 
                        {
                                return parmName;
                        }

                        set 
                        {
                                parmName = value;
                        }
                }
        }

        public interface ICommand
        {
                IParameter CreateParameter();
        }

        public class Command : ICommand
        {
                IParameter ICommand.CreateParameter()
                {
                        return CreateParameter();
                }

                public Parameter CreateParameter()
                {
                        return new Parameter();
                }
        }

        class MainDriver
        {
                [STAThread]
                static void Main(string[] args)
                {
                        Command cmd = new Command();            
                }
        }
}

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On
Behalf Of Daniel Morgan
Sent: Sunday, April 14, 2002 12:53 PM
To: [EMAIL PROTECTED]
Subject: [Mono-list] Derived classes returning an object that is derived

Hello,

I have a general C# question about interfaces and their derived classes.
I've been pulling my hair out on this.  How is the function
CreateParameter in Command supposed to be defined?

[...]


_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to