public static bool TryParse(string text, out TStatType result) { if (text.Match(Keywords.w_NONE)) { result = TStatType.SERIES; } else if (text.Match(Keywords.w_NO)) { result = TStatType.SERIES; } else if (text.Match(Keywords.w_AVG)) { result = TStatType.AVG; } else if (text.Match(Keywords.w_MIN)) { result = TStatType.MIN; } else if (text.Match(Keywords.w_MAX)) { result = TStatType.MAX; } else if (text.Match(Keywords.w_RANGE)) { result = TStatType.RANGE; } else { result = (TStatType)(-1); return(false); } return(true); }
/// <summary> /// Setter for the internal stats container builder. /// It is mutable and allows for changes pre-build. /// </summary> /// <param name="stat">Stat type.</param> /// <returns>The value that was set.</returns> public int this[TStatType stat] { set { BuilderDictionary[stat] = value; } }
public static string ParseStr(this TStatType value) { switch (value) { case TStatType.AVG: return(Keywords.w_AVG); case TStatType.MAX: return(Keywords.w_MAX); case TStatType.MIN: return(Keywords.w_MIN); case TStatType.RANGE: return(Keywords.w_RANGE); case TStatType.SERIES: return(Keywords.w_NONE); default: return(null); } }
/// <summary> /// Setter for the internal stats container builder. /// It is mutable and allows for changes pre-build. /// </summary> /// <param name="stat">Stat type.</param> /// <returns>The value that was set.</returns> public int this[TStatType stat] { //Don't use expression body set due to appveyor failure set { BuilderDictionary[stat] = value; } }