Class LazyState<TState, TEncoding>
[Serializable]
public sealed class LazyState<TState, TEncoding> : IState, ISerializable where TState : IState where TEncoding : IValue
Type Parameters
TStateTEncoding
- Inheritance
-
LazyState<TState, TEncoding>
- Implements
- Inherited Members
Constructors
LazyState(TState)
public LazyState(TState loadedValue)
Parameters
loadedValueTState
LazyState(TEncoding, Func<TEncoding, TState>)
public LazyState(TEncoding serialized, Func<TEncoding, TState> loader)
Parameters
serializedTEncodingloaderFunc<TEncoding, TState>
Properties
State
public TState State { get; }
Property Value
- TState
Methods
GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo with the data needed to serialize the target object.
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe SerializationInfo to populate with data.
contextStreamingContextThe destination (see StreamingContext) for this serialization.
Exceptions
- SecurityException
The caller does not have the required permission.
GetStateOrSerializedEncoding(out TState, out TEncoding)
public bool GetStateOrSerializedEncoding(out TState loadedState, out TEncoding serialized)
Parameters
loadedStateTStateserializedTEncoding
Returns
LoadState(LazyState<TState, TEncoding>)
public static TState LoadState(LazyState<TState, TEncoding> lazyState)
Parameters
lazyStateLazyState<TState, TEncoding>
Returns
- TState
LoadStatePair<T>(KeyValuePair<T, LazyState<TState, TEncoding>>)
public static KeyValuePair<T, TState> LoadStatePair<T>(KeyValuePair<T, LazyState<TState, TEncoding>> lazyPair)
Parameters
lazyPairKeyValuePair<T, LazyState<TState, TEncoding>>
Returns
- KeyValuePair<T, TState>
Type Parameters
T
Serialize()
public IValue Serialize()
Returns
- IValue