예제 #1
0
 public QueryResult <SolidBrush> GetBrushFor(DataMeterValueCategory dataMeterValueCategory)
 {
     if (DataMeterValueBrushes.ContainsKey(dataMeterValueCategory))
     {
         return(QueryResult <SolidBrush> .Create(DataMeterValueBrushes[dataMeterValueCategory]));
     }
     return(QueryResult <SolidBrush> .Empty);
 }
예제 #2
0
 public Color?GetColorFor(DataMeterValueCategory dataMeterValueCategory)
 {
     if (DataMeterValueBrushes.ContainsKey(dataMeterValueCategory))
     {
         return(DataMeterValueBrushes[dataMeterValueCategory]);
     }
     return(null);
 }
예제 #3
0
        public QueryResult <SolidBrush> GetBrushFor(DataMeterValueCategory dataMeterValueCategory)
        {
            var result = DatameterColourDefinitions.Instance.GetColorFor(dataMeterValueCategory);

            if (result.HasValue)
            {
                var color = result.Value.ToSysDrawingColor();
                return(BrushCache.GetOrAdd(color, c => new SolidBrush(result.Value.ToSysDrawingColor())).ToQueryResult());
            }
            return(QueryResult <SolidBrush> .Empty);
        }
예제 #4
0
 public DataMeterResult(
     DataMeter dataMeter,
     int amount,
     decimal percentageScore,
     DataMeterValueCategory valueCategory
     )
 {
     _dataMeter      = dataMeter;
     PercentageScore = percentageScore;
     ValueCategory   = valueCategory;
     Amount          = amount;
 }
예제 #5
0
 public Threshold(int minMeasureUnitTreshold, int maxMeasureUnitThreshold, DataMeterValueCategory category)
 {
     MinMeasureUnitThreshold = minMeasureUnitTreshold;
     MaxMeasureUnitThreshold = maxMeasureUnitThreshold;
     Category = category;
 }