private bool IsCanvasParamValid(string shapeName, string paramName, string paramValue, out int paramIntValue) { paramIntValue = 0; if (!int.TryParse(paramValue, out int result) || result < 0) { logger.LogParameterError(paramName, paramValue, shapeName); return(false); } paramIntValue = result; return(true); }