Exemple #1
0
 public static StageVmStyle Standard(
     Brush backgroundBrush,
     TicsPerStep animationSpeed,
     SwitchUseWrap maxSwitchUse)
 {
     return(new StageVmStyle
     {
         AnimationSpeed = animationSpeed,
         KeyLineBrush = Brushes.Blue,
         SwitchBrushNotUsed = Brushes.Black,
         SwitchBrushInUse = Brushes.Orange,
         SwitchBrushWasUsed = maxSwitchUse.ToSwitchBrushFunc(),
         SwitchLineWidth = 1.0,
         SwitchHSpacing = 3.25,
         StageRightMargin = 3.25,
         KeyLineThickness = 1.0,
         KeyLineHeight = 4.0,
         VPadding = 1.0,
         BackgroundBrush = backgroundBrush
     });
 }
Exemple #2
0
 public static Func <int, Brush> ToSwitchBrushFunc(this SwitchUseWrap maxUseCount)
 {
     return(useCount =>
     {
         if (useCount == 0)
         {
             return Brushes.Black;
         }
         if (maxUseCount.Value < 1)
         {
             return SwitchBrushes[SwitchBrushes.Count - 1];
         }
         var step = (colorSteps * useCount) / maxUseCount.Value;
         if (step > colorSteps - 1)
         {
             step = colorSteps - 1;
         }
         // Debug.WriteLine($"maxUseCount:{maxUseCount.Value} useCount:{useCount} step:{step}");
         return SwitchBrushes[(int)step];
     });
 }
Exemple #3
0
 public static Func <int, Brush> ToSwitchBrushFunc0(this SwitchUseWrap maxUseCount)
 {
     return(useCount =>
            (useCount < maxUseCount.Value) ? Brushes.Blue : Brushes.GreenYellow);
 }