What is the Triplet class used for? Is it related to Tuples?(Triplet 类的用途是什么?它与元组有关吗?)
问题描述
所以我刚刚了解了 Triplet
类.我没有 ASP.NET 的经验,只有核心 .NET Framework.
So I just learnt about the Triplet
class. I have no experience with ASP.NET, only the core .NET Framework.
有人可以向我解释 Triplet 类在哪里/为什么存在吗?它像元组吗?
Can someone explain to me where/why the Triplet class exists? Is it like a Tuple?
推荐答案
是的,它非常类似于 .NET 4.0 中的 Tuple,但可以追溯到 .NET 1.0,尤其是 ASP.NET 1.0.它主要用于ViewState 序列化:
Yes, it's pretty much like Tuple from .NET 4.0, but dates back to .NET 1.0 and ASP.NET 1.0 in particular. It's primarily used in ViewState serialization:
Page 类包含一个 SavePageViewState()
,它在页面生命周期的保存视图状态阶段被调用.SavePageViewState()
方法首先创建一个包含以下三个项目的 Triplet
:
The Page class contains a
SavePageViewState()
, which is invoked during the page life cycle's save view state stage. TheSavePageViewState()
method starts by creating aTriplet
that contains the following three items:
- 页面的哈希码.此哈希码用于确保视图状态在回发之间没有被#tampered.我们将在View State and Security Implications"中更多地讨论视图状态散列.部分.
Page
的控件层次结构的集合视图状态.- 控件层次结构中控件的
ArrayList
,需要在生命周期的引发回发事件阶段由页面类显式调用.
- The page's hash code. This hash code is used to ensure that the view state hasn't been #tampered with between postbacks. We'll talk more about view state hashing in the "View State and Security Implications" section.
- The collective view state of the
Page
's control hierarchy. - An
ArrayList
of controls in the control hierarchy that need to be explicitly invoked by the page class during the raise postback event stage of the life cycle.
还有它的弟弟叫对
.
There's also its' younger brother called Pair
.
绝对没有理由您甚至应该为这些课程而烦恼,否则将会出现一团乱七八糟的无类型混乱.
There's absolutely no reason you should even bother about these classes or else an unholy untyped mess will ensue.
这篇关于Triplet 类的用途是什么?它与元组有关吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Triplet 类的用途是什么?它与元组有关吗?
基础教程推荐
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- c# Math.Sqrt 实现 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01