Пример #1
0
		public override IEnumerable<Tuple<object, object>> GetResourceKeyValues(MyHighlightingColor hlColor) {
			var br = new LinearGradientBrush() {
				StartPoint = StartPoint,
				EndPoint = EndPoint,
			};
			if (MappingMode != null)
				br.MappingMode = MappingMode.Value;
			for (int i = 0; i < GradientOffsets.Length; i++) {
				var gs = new GradientStop(((SolidColorBrush)hlColor.GetHighlightingBrush(i).GetBrush(null)).Color, GradientOffsets[i]);
				gs.Freeze();
				br.GradientStops.Add(gs);
			}
			br.Freeze();
			yield return new Tuple<object, object>(ResourceKey, br);
		}
 private GradientStop MakeGradientStop(Color color, double offset)
 {
     var gradStop = new GradientStop(color, offset);
     gradStop.Freeze();
     return gradStop;
 }
Пример #3
0
 public override IEnumerable<Tuple<object, object>> GetResourceKeyValues(ThemeColor hlColor)
 {
     var br = new LinearGradientBrush() {
         StartPoint = StartPoint,
         EndPoint = EndPoint,
     };
     for (int i = 0; i < GradientOffsets.Length; i++) {
         var gs = new GradientStop(((SolidColorBrush)hlColor.GetBrushByIndex(i)).Color, GradientOffsets[i]);
         gs.Freeze();
         br.GradientStops.Add(gs);
     }
     br.Freeze();
     yield return new Tuple<object, object>(ResourceKey, br);
 }