c# - 如何创建用户定义类的ArrayList

标签 c#

我有一个类假设函数

我正在写这样的代码

class FunctionsList
{

  public ArrayList<Function> functionList // this resuls in error while in Java i have done same
  { 
     get;
     set;
  }
}

while Function class is defined below

public class Function 
{
   public String Name
   {
         get; set;
   }

   public String Signature
   {
         get; set;
   }
}

我在 C# 中做错的地方请告诉

最佳答案

我.NET你需要使用List<Function> 。类(class) ArrayList 仅存在于非通用版本中,并且基本上已被 List<T> 取代.

关于c# - 如何创建用户定义类的ArrayList,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6840102/

相关文章:

c# - 找到 A 和 B 的不同合格组合,多对多 A :B exclusions

c# - 在另一个等待中使用等待

c# - WPF:自定义控件中的多个内容呈现器?

c# - ASP.NET MVC 对象引用未设置为对象的实例

c# - 如何获取构建的、编码的 ViewState 的值?

c# - 在 MVVM WPF 应用程序中使用本地 ViewModel

c# - 通过制作一个网格优化绘图 3d 模型

c# - 如何在 ASP.NET MVC 中使用另一个 cshtml 文件作为 SelectPDF header ?

c# - Entity Framework - 带排序依据和分组依据的 Linq 查询

c# - 打开一个文件夹并最大化窗口