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 aTripletthat 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
ArrayListof 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 类的用途是什么?它与元组有关吗?
基础教程推荐
- JSON.NET 中基于属性的类型解析 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
