[英]What do greater/less than sign (e.g. Action<List<X>>) mean in C#?
example: 例:
public event Action<List<WKSProfile>> WorkstationProfileChanged;
I have trouble understanding the the above member. 我无法理解上述成员。 Does it imply that it returns : 它是否意味着它返回:
Action<List<WKSProfile>>
This is the syntax to specify generic type parameters . 这是指定泛型类型参数的语法。
In a generic type or method definition, a type parameters is a placeholder for a specific type that a client specifies when they instantiate a variable of the generic type. 在泛型类型或方法定义中,类型参数是客户端在实例化泛型类型的变量时指定的特定类型的占位符。 A generic class, such as
GenericList<T>
listed in Introduction to Generics (C# Programming Guide), cannot be used as-is because it is not really a type; 泛型类(例如,泛型简介(C#编程指南)中列出的泛型类GenericList<T>
不能按原样使用,因为它实际上不是一个类型; it is more like a blueprint for a type. 它更像是一种类型的蓝图。 To useGenericList<T>
, client code must declare and instantiate a constructed type by specifying a type argument inside the angle brackets. 要使用GenericList<T>
,客户端代码必须通过在尖括号内指定类型参数来声明和实例化构造的类型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.