开发者

Work with generic

I have a class look like this:

public class NamSetup: INameSetup
{
     static List<Name> nbames= new List<Name>();
     ....
     public List<Name> GetClients()
        {
            return names;
        }

     public List<Name> AddName(Name name)
     {
        names.Add(name);
        return GetClients();
     }
 }

I just want to make another class with names: myName.cs Inside myName.cs and want to call the AddName methode above. Do you kn开发者_如何学Pythonow to to do it?

Thank you in advance


 class MyName
 {
    public MyName()
    { 
        NamSetup nm = new NamSetup(); 
        nm.AddName(new Name());
    }
 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜