static private TryGetAndRemove ( string>.Dictionary |
||
dict | string>.Dictionary | |
name | string | |
value | string | |
required | bool | |
return | bool |
internal static bool TryGetAndRemove(Dictionary <string, string> dict, string name, out TimeSpan value, bool required) { if (ConfigurationHelper.TryGetAndRemove(dict, name, out string tmp, required) && TimeSpan.TryParse(tmp, out value)) { return(true); } if (required) { throw new Exception("Missing or invalid parameter: " + (String.IsNullOrEmpty(name) ? "element content" : name)); } value = TimeSpan.Zero; return(false); }