我看到这样的 C# 代码允许我在类属性上使用 foreach 循环。
public class EstimateDetailsModel : IEnumerable<string>
{
public string Dma { get; set; }
public string Callsign { get; set; }
public string Description { get; set; }
public IEnumerator<string> GetEnumerator()
{
yield return Dma;
yield return Callsign;
yield return Description;
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
}
请帮忙。如何使用 vb.net 制作这样的东西?