Triplet 类的用途是什么?它与元组有关吗?

What is the Triplet class used for? Is it related to Tuples?(Triplet 类的用途是什么?它与元组有关吗?)

本文介绍了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. The SavePageViewState() method starts by creating a Triplet that contains the following three items:

  1. 页面的哈希码.此哈希码用于确保视图状态在回发之间没有被#tampered.我们将在View State and Security Implications"中更多地讨论视图状态散列.部分.
  2. Page 的控件层次结构的集合视图状态.
  3. 控件层次结构中控件的ArrayList,需要在生命周期的引发回发事件阶段由页面类显式调用.
  1. 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.
  2. The collective view state of the Page's control hierarchy.
  3. 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 类的用途是什么?它与元组有关吗?

基础教程推荐