Provides access to user data associated with the object.
Namespace: DotNext Assembly: DotNext.dll Syntaxpublic readonly ref struct UserDataStorage
Properties | Edit this page View Source IsValid
Gets a value indicating that this storage is valid.
Declarationpublic bool IsValid { get; }
Property Value Methods | Edit this page View Source Capture()
Extracts a copy of all custom data in this storage.
Declarationpublic IReadOnlyDictionary<string, object> Capture()
Returns | Edit this page View Source CopyTo(object)
Replaces user data of the object with the copy of the current one.
Declarationpublic void CopyTo(object obj)
Parameters Type Name Description object obj
The object which user data has to be replaced with the copy of the current one.
| Edit this page View Source Equals(object?)Determines whether this storage is attached to the given object.
Declarationpublic override bool Equals(object? other)
Parameters Type Name Description object other
Other object to check.
Returns Type Description booltrue, if this storage is attached to other
object; otherwise, false.
Computes identity hash code for this storage.
Declarationpublic override int GetHashCode()
Returns Type Description int
The identity hash code for this storage.
Overrides | Edit this page View Source GetOrSet<TValue>(UserDataSlot<TValue>)Gets existing user data or creates a new data and return it.
Declarationpublic TValue GetOrSet<TValue>(UserDataSlot<TValue> slot) where TValue : notnull, new()
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
Returns Type Description TValueThe data associated with the slot.
Type Parameters Name Description TValueThe type of user data associated with arbitrary object.
Exceptions | Edit this page View Source GetOrSet<TValue>(UserDataSlot<TValue>, delegate*<TValue>)Gets existing user data or creates a new data and return it.
Declaration[CLSCompliant(false)]
public TValue GetOrSet<TValue>(UserDataSlot<TValue> slot, delegate*<TValue> valueFactory)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
delegate*<TValue> valueFactoryThe value supplier which is called when no user data exists.
Returns Type Description TValueThe data associated with the slot.
Type Parameters Name Description TValueThe type of user data associated with arbitrary object.
Exceptions | Edit this page View Source GetOrSet<TValue>(UserDataSlot<TValue>, Func<TValue>)Gets existing user data or creates a new data and return it.
Declarationpublic TValue GetOrSet<TValue>(UserDataSlot<TValue> slot, Func<TValue> valueFactory)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
Func<TValue> valueFactoryThe value supplier which is called when no user data exists.
Returns Type Description TValueThe data associated with the slot.
Type Parameters Name Description TValueThe type of user data associated with arbitrary object.
Exceptions | Edit this page View Source GetOrSet<TBase, T>(UserDataSlot<TBase>)Gets existing user data or creates a new data and return it.
Declarationpublic TBase GetOrSet<TBase, T>(UserDataSlot<TBase> slot) where T : class, TBase, new()
Parameters Type Name Description UserDataSlot<TBase> slot
The slot identifying user data.
Returns Type Description TBaseThe data associated with the slot.
Type Parameters Name Description TBaseThe type of user data associated with arbitrary object.
TThe derived type with public parameterless constructor.
Exceptions | Edit this page View Source GetOrSet<TValue, TFactory>(UserDataSlot<TValue>, TFactory)Gets existing user data or creates a new data and return it.
Declarationpublic TValue GetOrSet<TValue, TFactory>(UserDataSlot<TValue> slot, TFactory valueFactory) where TFactory : struct, ISupplier<TValue>
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
TFactory valueFactoryThe value supplier which is called when no user data exists.
Returns Type Description TValueThe data associated with the slot.
Type Parameters Name Description TValueThe type of user data associated with arbitrary object.
TFactoryThe type of the factory.
Exceptions | Edit this page View Source GetOrSet<T, TValue>(UserDataSlot<TValue>, T, delegate*<T, TValue>)Gets existing user data or creates a new data and return it.
Declaration[CLSCompliant(false)]
public TValue GetOrSet<T, TValue>(UserDataSlot<TValue> slot, T arg, delegate*<T, TValue> valueFactory)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
T argThe argument to be passed into factory.
delegate*<T, TValue> valueFactoryThe value supplier which is called when no user data exists.
Returns Type Description TValueThe data associated with the slot.
Type Parameters Name Description TThe type of the argument to be passed into factory.
TValueThe type of user data associated with arbitrary object.
Exceptions | Edit this page View Source GetOrSet<T, TValue>(UserDataSlot<TValue>, T, Func<T, TValue>)Gets existing user data or creates a new data and return it.
Declarationpublic TValue GetOrSet<T, TValue>(UserDataSlot<TValue> slot, T arg, Func<T, TValue> valueFactory)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
T argThe argument to be passed into factory.
Func<T, TValue> valueFactoryThe value supplier which is called when no user data exists.
Returns Type Description TValueThe data associated with the slot.
Type Parameters Name Description TThe type of the argument to be passed into factory.
TValueThe type of user data associated with arbitrary object.
Exceptions | Edit this page View Source GetOrSet<T1, T2, TValue>(UserDataSlot<TValue>, T1, T2, delegate*<T1, T2, TValue>)Gets existing user data or creates a new data and return it.
Declaration[CLSCompliant(false)]
public TValue GetOrSet<T1, T2, TValue>(UserDataSlot<TValue> slot, T1 arg1, T2 arg2, delegate*<T1, T2, TValue> valueFactory)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
T1 arg1The first argument to be passed into factory.
T2 arg2The second argument to be passed into factory.
delegate*<T1, T2, TValue> valueFactoryThe value supplier which is called when no user data exists.
Returns Type Description TValueThe data associated with the slot.
Type Parameters Name Description T1The type of the first argument to be passed into factory.
T2The type of the second argument to be passed into factory.
TValueThe type of user data associated with arbitrary object.
Exceptions | Edit this page View Source GetOrSet<T1, T2, TValue>(UserDataSlot<TValue>, T1, T2, Func<T1, T2, TValue>)Gets existing user data or creates a new data and return it.
Declarationpublic TValue GetOrSet<T1, T2, TValue>(UserDataSlot<TValue> slot, T1 arg1, T2 arg2, Func<T1, T2, TValue> valueFactory)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
T1 arg1The first argument to be passed into factory.
T2 arg2The second argument to be passed into factory.
Func<T1, T2, TValue> valueFactoryThe value supplier which is called when no user data exists.
Returns Type Description TValueThe data associated with the slot.
Type Parameters Name Description T1The type of the first argument to be passed into factory.
T2The type of the second argument to be passed into factory.
TValueThe type of user data associated with arbitrary object.
Exceptions | Edit this page View Source Get<TValue>(UserDataSlot<TValue>)Gets user data.
Declarationpublic TValue? Get<TValue>(UserDataSlot<TValue> slot)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
Returns Type Description TValueUser data; or default(V)
if there is no user data associated with slot
.
Type of data.
Exceptions | Edit this page View Source Get<TValue>(UserDataSlot<TValue>, TValue?)Gets user data.
Declarationpublic TValue? Get<TValue>(UserDataSlot<TValue> slot, TValue? defaultValue)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
TValue defaultValueDefault value to be returned if no user data contained in this collection.
Returns Type Description TValueUser data.
Type Parameters Name Description TValueType of data.
Exceptions | Edit this page View Source Remove<TValue>(UserDataSlot<TValue>)Removes user data slot.
Declarationpublic bool Remove<TValue>(UserDataSlot<TValue> slot)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
Returns Type Description booltrue, if data is removed from this collection.
Type Parameters Name Description TValueThe type of user data.
Exceptions | Edit this page View Source Remove<TValue>(UserDataSlot<TValue>, out TValue)Removes user data slot.
Declarationpublic bool Remove<TValue>(UserDataSlot<TValue> slot, out TValue userData)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
TValue userDataRemove user data.
Returns Type Description booltrue, if data is removed from this collection.
Type Parameters Name Description TValueThe type of user data.
Exceptions | Edit this page View Source Set<TValue>(UserDataSlot<TValue>, TValue)Sets user data.
Declarationpublic void Set<TValue>(UserDataSlot<TValue> slot, TValue userData)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
TValue userDataUser data to be saved in this collection.
Type Parameters Name Description TValueType of data.
Exceptions | Edit this page View Source ToString()Returns textual representation of this storage.
Declarationpublic override string? ToString()
Returns Type Description string
The textual representation of this storage.
Overrides | Edit this page View Source TryGet<TValue>(UserDataSlot<TValue>, out TValue)Tries to get user data.
Declarationpublic bool TryGet<TValue>(UserDataSlot<TValue> slot, out TValue userData)
Parameters Type Name Description UserDataSlot<TValue> slot
The slot identifying user data.
TValue userDataUser data.
Returns Type Description booltrue, if user data slot exists in this collection.
Type Parameters Name Description TValueType of data.
Exceptions Operators | Edit this page View Source operator ==(UserDataStorage, UserDataStorage)Determines whether two stores are for the same object.
Declarationpublic static bool operator ==(UserDataStorage first, UserDataStorage second)
Parameters Returns Type Description bool
true, if two stores are for the same object; otherwise, false.
| Edit this page View Source operator !=(UserDataStorage, UserDataStorage)Determines whether two stores are not for the same object.
Declarationpublic static bool operator !=(UserDataStorage first, UserDataStorage second)
Parameters Returns Type Description bool
true, if two stores are not for the same object; otherwise, false.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4