-
Hi Daniel,
Maybe our tool does not have this functionality for now and you want to create a suggestion? What result do you expect to see (please post small result sample)?
Thanks,
Andrew -
Hi Andrew.
This feature called Colllection Initilalizers from C# 3, you know it.
Input:
=====
#region Constructor
public PriorityToBrushConverter()
{
_HorizontalGradientBrush = new LinearGradientBrush { StartPoint = new System.Windows.Point(0, 0), EndPoint = new System.Windows.Point(0, 1) };
_HorizontalGradientBrush.GradientStops.Add(
new GradientStop(Color.FromRgb(0xFF, 0x99, 0x99), 0));
_HorizontalGradientBrush.GradientStops.Add(
new GradientStop(Color.FromRgb(0xFF, 0x99, 0x33), 0.25));
_HorizontalGradientBrush.GradientStops.Add(
new GradientStop(Color.FromRgb(0xFF, 0x00, 0x66), 0.75));
_HorizontalGradientBrush.GradientStops.Add(
new GradientStop(Colors.Red, 1));
_brush = _HorizontalGradientBrush;
}
#endregionOutput:
======#region Constructor
public PriorityToBrushConverter()
{
_HorizontalGradientBrush = new LinearGradientBrush { StartPoint = new System.Windows.Point(0, 0), EndPoint = new System.Windows.Point(0, 1) };
_HorizontalGradientBrush.GradientStops() {
new GradientStop(Color.FromRgb(0xFF, 0x99, 0x99), 0),
new GradientStop(Color.FromRgb(0xFF, 0x99, 0x99), 0.25),
new GradientStop(Color.FromRgb(0xFF, 0x99, 0x99), 0.5),
new GradientStop(Color.FromRgb(0xFF, 0x99, 0x99), 1)};
#endregion
Thanks,
Daniel Shitrit. -
Hi Daniel,
Thanks for more information. I see your standpoint now. We don't support this functionality at present, but your idea sounds useful. Therefore, I have converted this Bug Report to a Suggestion.
Thank,
Andrew -
Andrew,
I have a CodeRush T-Shirt that is not update -:)
with all my suggestions that are in satus of:
(Accepted - Release TBD)
1 Solution
Hi Daniel,
We just discovered that there is another ticket exist requesting the same functionality - Improve Convert to Initializer/Decompose Initializer to work on collection initializers as well. I'm going to close this ticket and add your ideas to the earlier ticket. Thank you for sharing your ideas with us.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.
Facebook
Twitter
Google+