SerializationInfoExtensionsReplaceValue Method

Replaces a value with the specified old and new names in the SerializationInfo.

Definition

Namespace: KGySoft.Serialization.Binary
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public static bool ReplaceValue(
	this SerializationInfo info,
	string oldName,
	string newName,
	Object? value,
	Type? type = null
)

Parameters

info  SerializationInfo
The SerializationInfo to be updated.
oldName  String
The name of the entry to be removed.
newName  String
The name of the entry to be added.
value  Object
The new value to be set.
type  Type  (Optional)
The type of the value to be added. This parameter is optional.
Default value: .

Return Value

Boolean
if an entry with the specified old name existed in the SerializationInfo and the replacement has been performed; otherwise, .

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SerializationInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also