public static bool ConfigTryParseHelper <T>(IPipelineComponentConfig config, InferenceCommonUtility.TryParseFunction <T> tryParseFunction, string keyName, out T value, IDiagnosticsSession trace, T defaultValue)
 {
     if (!InferenceCommonUtility.ConfigTryParseHelper <T>(config, tryParseFunction, keyName, out value, trace))
     {
         value = defaultValue;
         if (trace != null)
         {
             trace.TraceDebug <string, T>("Defaulting config value referenced by keyName: {0} to: {1}", keyName, defaultValue);
         }
         return(false);
     }
     return(true);
 }
 public static bool ConfigTryParseHelper <T>(IPipelineComponentConfig config, InferenceCommonUtility.TryParseFunction <T> tryParseFunction, string keyName, out T value, IDiagnosticsSession trace)
 {
     value = default(T);
     if (config == null || !tryParseFunction(config[keyName], out value))
     {
         if (trace != null)
         {
             trace.TraceDebug <string>("Failed to parse config value referenced by keyName: {0}.", keyName);
         }
         return(false);
     }
     return(true);
 }