Class LazyState<TState, TEncoding>
[Serializable]
public sealed class LazyState<TState, TEncoding> : IState, ISerializable where TState : IState where TEncoding : IValue
Type Parameters
TState
TEncoding
- Inheritance
-
LazyState<TState, TEncoding>
- Implements
- Inherited Members
Constructors
LazyState(TState)
public LazyState(TState loadedValue)
Parameters
loadedValue
TState
LazyState(TEncoding, Func<TEncoding, TState>)
public LazyState(TEncoding serialized, Func<TEncoding, TState> loader)
Parameters
serialized
TEncodingloader
Func<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
info
SerializationInfoThe SerializationInfo to populate with data.
context
StreamingContextThe 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
loadedState
TStateserialized
TEncoding
Returns
LoadState(LazyState<TState, TEncoding>)
public static TState LoadState(LazyState<TState, TEncoding> lazyState)
Parameters
lazyState
LazyState<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
lazyPair
KeyValuePair<T, LazyState<TState, TEncoding>>
Returns
- KeyValuePair<T, TState>
Type Parameters
T
Serialize()
public IValue Serialize()
Returns
- IValue