简体   繁体   English

什么做大于/小于签署(例如行动 <List<X> &gt;)在C#中意味着什么?

[英]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 use GenericList<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.

相关问题 在C#正则表达式中,是否少于和大于需要逃脱? - Do less than and greater than need escaped in a C# regex? C# 使用 &lt; &gt;(不是大于/小于) - C# use of < > (not as greater than / less than) C#方括号和大于/小于 - C# square brackets and greater/less than C#如何使用delim加入列表,例如List <string> strList ;,然后是strList.Join(“,”) - C# how to join a list with delim, e.g., List<string> strList;, then strList.Join(“,”) C#中的“ =&gt;”符号是什么意思? - what the sign “=>” mean in C#? * 0x3e8在C#超时计算中是什么意思? - What does * 0x3e8 mean in C# timeout calculation? 什么是尖括号部分在C#中调用,例如SomeMethodName <ISomething> () - What is the angle brackets part is called in C# e.g. SomeMethodName<ISomething>() C#中的捕获设备列表(例如,麦克风,立体声混音...) - List of capture devices (e.g. Microphone, Stereo Mix…) in C# c# - 我应该使用“ref”通过引用方法传递集合(例如List)吗? - c# - should I use “ref” to pass a collection (e.g. List) by reference to a method? 在C#中使用“小于”和“大于”符号之间的类名是什么意思? - What's the purpose of having class names between “Less than” and “Greater than” symbols in C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM