Here are the examples of the csharp api System.Func.InvokeGracefully() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
19
Source : DotNetExtensions.cs
with MIT License
from liangxiegame
with MIT License
from liangxiegame
public static void Example()
{
// action
System.Action action = () => Log.I("action called");
action.InvokeGracefully(); // if (action != null) action();
// func
Func<int> func = () => 1;
func.InvokeGracefully();
/*
public static T InvokeGracefully<T>(this Func<T> selfFunc)
{
return null != selfFunc ? selfFunc() : default(T);
}
*/
// delegate
TestDelegate testDelegate = () => { };
testDelegate.InvokeGracefully();
}