提交 aa5e20de 编写于 作者: C CyrusNajmabadi

Remove unused TypeSwitch function.

上级 776198fd
......@@ -8,28 +8,6 @@ internal static partial class ObjectExtensions
{
#region TypeSwitch on Func<T>
public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TBaseType, TResult> defaultFunc = null)
where TDerivedType1 : TBaseType
where TDerivedType2 : TBaseType
{
if (obj is TDerivedType1)
{
return matchFunc1((TDerivedType1)obj);
}
else if (obj is TDerivedType2)
{
return matchFunc2((TDerivedType2)obj);
}
else if (defaultFunc != null)
{
return defaultFunc(obj);
}
else
{
return default(TResult);
}
}
public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TBaseType, TResult> defaultFunc = null)
where TDerivedType1 : TBaseType
where TDerivedType2 : TBaseType
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册