, , .
public static T GetNode<T>() where T : NodeBase
{
if (typeof(T) == typeof(SpecialNode))
{
return MySpecialNode;
}
return default(T);
}
, : MySpecialNode: (T)(NodeBase)MySpecialNode ( , , T SpecialNode).
; , , , MySpecialNode T. , :
public T Get<T>() {
if (typeof(T).FullName.Equals("System.Int32"))
return 5;
else
return default(T);
}
? , ; , T, , 5 , . (, I , T int, , - System.Type.FullName.)
if (typeof(T) == typeof(SpecialNode)) .