Dev2.Instrumentation.Tracker.Perform C# (CSharp) Method

Perform() static private method

static private Perform ( Func action, bool async = false ) : void
action Func
async bool
return void
        static void Perform(Func<GenericReturn> action, bool async = false)
        {
            if (AppSettings.CollectUsageStats)
            {
                try
                {
                    if (async)
                    {
                        Task.Run(action).ContinueWith(t => WriteError(t.Result));
                    }
                    else
                    {
                        var result = action();
                        WriteError(result);
                    }
                }
                // ReSharper disable EmptyGeneralCatchClause
                catch
                // ReSharper restore EmptyGeneralCatchClause
                {
                    // this is a tracker issue ;(
                }
            }
        }