213 lines
8.9 KiB
C#
213 lines
8.9 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.Runtime.ExceptionServices;
|
|
using System.Runtime.InteropServices;
|
|
using System.Runtime.Serialization;
|
|
using System.Threading;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace System
|
|
{
|
|
/// <summary>Provides support for lazy initialization.</summary>
|
|
/// <typeparam name="T">The type of object that is being lazily initialized.</typeparam>
|
|
// Token: 0x02000092 RID: 146
|
|
[Token(Token = "0x2000092")]
|
|
[ComVisible(false)]
|
|
[DebuggerTypeProxy(typeof(System_LazyDebugView<>))]
|
|
[DebuggerDisplay("ThreadSafetyMode={Mode}, IsValueCreated={IsValueCreated}, IsValueFaulted={IsValueFaulted}, Value={ValueForDebugDisplay}")]
|
|
[Serializable]
|
|
public class Lazy<T>
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Lazy`1" /> class. When lazy initialization occurs, the default constructor of the target type is used.</summary>
|
|
// Token: 0x0600046B RID: 1131 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x600046B")]
|
|
[Address(RVA = "0x358F030", Offset = "0x358E030", VA = "0x18358F030")]
|
|
public Lazy()
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Lazy`1" /> class. When lazy initialization occurs, the specified initialization function is used.</summary>
|
|
/// <param name="valueFactory">The delegate that is invoked to produce the lazily initialized value when it is needed.</param>
|
|
/// <exception cref="T:System.ArgumentNullException">
|
|
/// <paramref name="valueFactory" /> is <see langword="null" />.</exception>
|
|
// Token: 0x0600046C RID: 1132 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x600046C")]
|
|
[Address(RVA = "0x358F1B0", Offset = "0x358E1B0", VA = "0x18358F1B0")]
|
|
public Lazy(Func<T> valueFactory)
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Lazy`1" /> class that uses the default constructor of <paramref name="T" /> and the specified thread-safety mode.</summary>
|
|
/// <param name="mode">One of the enumeration values that specifies the thread safety mode.</param>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
|
/// <paramref name="mode" /> contains an invalid value.</exception>
|
|
// Token: 0x0600046D RID: 1133 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x600046D")]
|
|
[Address(RVA = "0x358EF50", Offset = "0x358DF50", VA = "0x18358EF50")]
|
|
public Lazy(LazyThreadSafetyMode mode)
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Lazy`1" /> class that uses the specified initialization function and thread-safety mode.</summary>
|
|
/// <param name="valueFactory">The delegate that is invoked to produce the lazily initialized value when it is needed.</param>
|
|
/// <param name="mode">One of the enumeration values that specifies the thread safety mode.</param>
|
|
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
|
/// <paramref name="mode" /> contains an invalid value.</exception>
|
|
/// <exception cref="T:System.ArgumentNullException">
|
|
/// <paramref name="valueFactory" /> is <see langword="null" />.</exception>
|
|
// Token: 0x0600046E RID: 1134 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x600046E")]
|
|
[Address(RVA = "0x358F060", Offset = "0x358E060", VA = "0x18358F060")]
|
|
public Lazy(Func<T> valueFactory, LazyThreadSafetyMode mode)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600046F RID: 1135 RVA: 0x00002082 File Offset: 0x00000282
|
|
[Token(Token = "0x600046F")]
|
|
[Address(RVA = "0x358E6C0", Offset = "0x358D6C0", VA = "0x18358E6C0")]
|
|
private static object GetObjectFromMode(LazyThreadSafetyMode mode)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x06000470 RID: 1136 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6000470")]
|
|
[Address(RVA = "0x358EC50", Offset = "0x358DC50", VA = "0x18358EC50")]
|
|
[OnSerializing]
|
|
private void OnSerializing(StreamingContext context)
|
|
{
|
|
}
|
|
|
|
/// <summary>Creates and returns a string representation of the <see cref="P:System.Lazy`1.Value" /> property for this instance.</summary>
|
|
/// <returns>The result of calling the <see cref="M:System.Object.ToString" /> method on the <see cref="P:System.Lazy`1.Value" /> property for this instance, if the value has been created (that is, if the <see cref="P:System.Lazy`1.IsValueCreated" /> property returns <see langword="true" />). Otherwise, a string indicating that the value has not been created.</returns>
|
|
/// <exception cref="T:System.NullReferenceException">The <see cref="P:System.Lazy`1.Value" /> property is <see langword="null" />.</exception>
|
|
// Token: 0x06000471 RID: 1137 RVA: 0x00002082 File Offset: 0x00000282
|
|
[Token(Token = "0x6000471")]
|
|
[Address(RVA = "0x358EC80", Offset = "0x358DC80", VA = "0x18358EC80", Slot = "3")]
|
|
public override string ToString()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x17000087 RID: 135
|
|
// (get) Token: 0x06000472 RID: 1138 RVA: 0x00004170 File Offset: 0x00002370
|
|
[Token(Token = "0x17000087")]
|
|
internal LazyThreadSafetyMode Mode
|
|
{
|
|
[Token(Token = "0x6000472")]
|
|
[Address(RVA = "0x358F240", Offset = "0x358E240", VA = "0x18358F240")]
|
|
get
|
|
{
|
|
return LazyThreadSafetyMode.None;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value that indicates whether a value has been created for this <see cref="T:System.Lazy`1" /> instance.</summary>
|
|
/// <returns>
|
|
/// <see langword="true" /> if a value has been created for this <see cref="T:System.Lazy`1" /> instance; otherwise, <see langword="false" />.</returns>
|
|
// Token: 0x17000088 RID: 136
|
|
// (get) Token: 0x06000473 RID: 1139 RVA: 0x00004188 File Offset: 0x00002388
|
|
[Token(Token = "0x17000088")]
|
|
public bool IsValueCreated
|
|
{
|
|
[Token(Token = "0x6000473")]
|
|
[Address(RVA = "0x358F1E0", Offset = "0x358E1E0", VA = "0x18358F1E0")]
|
|
get
|
|
{
|
|
return default(bool);
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the lazily initialized value of the current <see cref="T:System.Lazy`1" /> instance.</summary>
|
|
/// <returns>The lazily initialized value of the current <see cref="T:System.Lazy`1" /> instance.</returns>
|
|
/// <exception cref="T:System.MemberAccessException">The <see cref="T:System.Lazy`1" /> instance is initialized to use the default constructor of the type that is being lazily initialized, and permissions to access the constructor are missing.</exception>
|
|
/// <exception cref="T:System.MissingMemberException">The <see cref="T:System.Lazy`1" /> instance is initialized to use the default constructor of the type that is being lazily initialized, and that type does not have a public, parameterless constructor.</exception>
|
|
/// <exception cref="T:System.InvalidOperationException">The initialization function tries to access <see cref="P:System.Lazy`1.Value" /> on this instance.</exception>
|
|
// Token: 0x17000089 RID: 137
|
|
// (get) Token: 0x06000474 RID: 1140 RVA: 0x00002082 File Offset: 0x00000282
|
|
[Token(Token = "0x17000089")]
|
|
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
|
public T Value
|
|
{
|
|
[Token(Token = "0x6000474")]
|
|
[Address(RVA = "0x358F2C0", Offset = "0x358E2C0", VA = "0x18358F2C0")]
|
|
get
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000475 RID: 1141 RVA: 0x00002082 File Offset: 0x00000282
|
|
[Token(Token = "0x6000475")]
|
|
[Address(RVA = "0x358E7B0", Offset = "0x358D7B0", VA = "0x18358E7B0")]
|
|
private T LazyInitValue()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x06000476 RID: 1142 RVA: 0x00002082 File Offset: 0x00000282
|
|
[Token(Token = "0x6000476")]
|
|
[Address(RVA = "0x358E160", Offset = "0x358D160", VA = "0x18358E160")]
|
|
private Lazy<T>.Boxed CreateValue()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x040001E5 RID: 485
|
|
[Token(Token = "0x40001E5")]
|
|
private static readonly Func<T> ALREADY_INVOKED_SENTINEL;
|
|
|
|
// Token: 0x040001E6 RID: 486
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x0")]
|
|
[Token(Token = "0x40001E6")]
|
|
private object m_boxed;
|
|
|
|
// Token: 0x040001E7 RID: 487
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x0")]
|
|
[Token(Token = "0x40001E7")]
|
|
[NonSerialized]
|
|
private Func<T> m_valueFactory;
|
|
|
|
// Token: 0x040001E8 RID: 488
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x0")]
|
|
[Token(Token = "0x40001E8")]
|
|
[NonSerialized]
|
|
private object m_threadSafeObj;
|
|
|
|
// Token: 0x02000093 RID: 147
|
|
[Token(Token = "0x2000093")]
|
|
[Serializable]
|
|
private class Boxed
|
|
{
|
|
// Token: 0x06000478 RID: 1144 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6000478")]
|
|
[Address(RVA = "0x2427900", Offset = "0x2426900", VA = "0x182427900")]
|
|
internal Boxed(T value)
|
|
{
|
|
}
|
|
|
|
// Token: 0x040001E9 RID: 489
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x0")]
|
|
[Token(Token = "0x40001E9")]
|
|
internal T m_value;
|
|
}
|
|
|
|
// Token: 0x02000094 RID: 148
|
|
[Token(Token = "0x2000094")]
|
|
private class LazyInternalExceptionHolder
|
|
{
|
|
// Token: 0x06000479 RID: 1145 RVA: 0x00002050 File Offset: 0x00000250
|
|
[Token(Token = "0x6000479")]
|
|
[Address(RVA = "0x358E120", Offset = "0x358D120", VA = "0x18358E120")]
|
|
internal LazyInternalExceptionHolder(Exception ex)
|
|
{
|
|
}
|
|
|
|
// Token: 0x040001EA RID: 490
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x0")]
|
|
[Token(Token = "0x40001EA")]
|
|
internal ExceptionDispatchInfo m_edi;
|
|
}
|
|
}
|
|
}
|