-4

我有一个类代理,Process Track Manager。

我向 Proxy 的构造函数发送了一个 Process 类的实例。进程类有一个列表 As

public List<TrackManager> l = new List<TrackManager>();

我将 2 个跟踪管理器实例添加到列表中。

从另一个类调用 UpdateClient,我如何访问列表中 TrackManager 的方法?

4

1 回答 1

0

You could first try to implement a method from your first class, for example:

//Class Example
    public void UpdateClient(int n){
l[n].myMethod();
}

Then in the class you want to instance your object you could do this: (Asuming you have an object "Example" built in your constructor, or somewhere before):

public void RandomMethod()
{
//code...
    ex.updateClient(n);
//Being ex an instance of the class Example
}
于 2012-10-26T14:34:32.910 回答