mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
19 lines
399 B
C#
19 lines
399 B
C#
using System;
|
|
using System.Runtime.Serialization;
|
|
|
|
public static class CommonExtensions
|
|
{
|
|
/// <inheritdoc cref="SerializationInfo.GetValue(string, Type)"/>
|
|
public static T GetValue<T>(this SerializationInfo info, string name)
|
|
{
|
|
try
|
|
{
|
|
return (T)info.GetValue(name, typeof(T));
|
|
}
|
|
catch
|
|
{
|
|
return default;
|
|
}
|
|
}
|
|
}
|