protected override DataTemplate SelectTemplateCore(object item, DependencyObject container) { NGCommentScore scoreType = (NGCommentScore)item; switch (scoreType) { case NGCommentScore.None: return(NoneTemplate); case NGCommentScore.Low: return(LowTemplate); case NGCommentScore.Middle: return(MiddleTemplate); case NGCommentScore.High: return(HighTemplate); case NGCommentScore.VeryHigh: return(VeryHighTemplate); case NGCommentScore.SuperVeryHigh: return(SuperVeryHighTemplate); case NGCommentScore.UltraSuperVeryHigh: return(UltraSuperVeryHighTemplate); default: throw new NotSupportedException($"not suppoert {nameof(NGCommentScore)}.{scoreType.ToString()}"); } }
public static int GetCommentScoreAmount(this NGCommentScore scoreType) { switch (scoreType) { case NGCommentScore.None: return(int.MinValue); case NGCommentScore.Low: return(-10000); case NGCommentScore.Middle: return(-7200); case NGCommentScore.High: return(-4800); case NGCommentScore.VeryHigh: return(-2400); case NGCommentScore.SuperVeryHigh: return(-600); case NGCommentScore.UltraSuperVeryHigh: return(0); default: throw new NotSupportedException(); } }