Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Create()

static LazyHelper System.LazyHelper.Create ( LazyThreadSafetyMode mode,
bool useDefaultConstructor )
inlinestaticpackage

Definition at line 83 of file LazyHelper.cs.

84 {
85 switch (mode)
86 {
87 case LazyThreadSafetyMode.None:
88 if (!useDefaultConstructor)
89 {
90 return NoneViaFactory;
91 }
92 return NoneViaConstructor;
93 case LazyThreadSafetyMode.PublicationOnly:
94 if (!useDefaultConstructor)
95 {
97 }
99 case LazyThreadSafetyMode.ExecutionAndPublication:
100 {
101 LazyState state = (useDefaultConstructor ? LazyState.ExecutionAndPublicationViaConstructor : LazyState.ExecutionAndPublicationViaFactory);
102 return new LazyHelper(state);
103 }
104 default:
105 throw new ArgumentOutOfRangeException("mode", SR.Lazy_ctor_ModeInvalid);
106 }
107 }
LazyHelper(LazyState state)
Definition LazyHelper.cs:23
static readonly LazyHelper NoneViaFactory
Definition LazyHelper.cs:11
static readonly LazyHelper PublicationOnlyViaFactory
Definition LazyHelper.cs:15
static readonly LazyHelper NoneViaConstructor
Definition LazyHelper.cs:9
static readonly LazyHelper PublicationOnlyViaConstructor
Definition LazyHelper.cs:13
LazyState
Definition LazyState.cs:4

References System.LazyHelper.LazyHelper(), System.SR.Lazy_ctor_ModeInvalid, System.LazyHelper.NoneViaConstructor, System.LazyHelper.NoneViaFactory, System.LazyHelper.PublicationOnlyViaConstructor, System.LazyHelper.PublicationOnlyViaFactory, and System.state.

Referenced by System.Lazy< T, TMetadata >.Lazy().