Skip to content

Commit

Permalink
Fix Indentation on certain code-blocks
Browse files Browse the repository at this point in the history
- Fix indent on jump labels
- Fix indent on switch-case block
  • Loading branch information
Nirmal4G authored and michael-hawker committed May 17, 2021
1 parent bc8c356 commit 63cbb4a
Show file tree
Hide file tree
Showing 9 changed files with 257 additions and 257 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ csharp_new_line_between_query_expression_clauses = true
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_case_contents_when_block = false
csharp_indent_labels = no_change
csharp_indent_switch_labels = true

# Space preferences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,28 +171,28 @@ protected override object GetPatternCore(PatternInterface patternInterface)
switch (patternInterface)
{
case PatternInterface.Invoke:
{
if (!this.OwningGrid.IsReadOnly &&
this.OwningColumn != null &&
!this.OwningColumn.IsReadOnly)
{
if (!this.OwningGrid.IsReadOnly &&
this.OwningColumn != null &&
!this.OwningColumn.IsReadOnly)
{
return this;
}

break;
return this;
}

break;
}

case PatternInterface.ScrollItem:
{
if (this.OwningGrid.HorizontalScrollBar != null &&
this.OwningGrid.HorizontalScrollBar.Maximum > 0)
{
if (this.OwningGrid.HorizontalScrollBar != null &&
this.OwningGrid.HorizontalScrollBar.Maximum > 0)
{
return this;
}

break;
return this;
}

break;
}

case PatternInterface.GridItem:
case PatternInterface.SelectionItem:
case PatternInterface.TableItem:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,15 @@ protected override object GetPatternCore(PatternInterface patternInterface)
case PatternInterface.Table:
return this;
case PatternInterface.ScrollItem:
{
if (this.OwningDataGrid.VerticalScrollBar != null &&
this.OwningDataGrid.VerticalScrollBar.Maximum > 0)
{
if (this.OwningDataGrid.VerticalScrollBar != null &&
this.OwningDataGrid.VerticalScrollBar.Maximum > 0)
{
return this;
}

break;
return this;
}

break;
}
}

return base.GetPatternCore(patternInterface);
Expand Down
134 changes: 67 additions & 67 deletions Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,24 +488,24 @@ private ColorChannel GetActiveColorSpectrumThirdDimension()
{
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.SaturationValue:
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.ValueSaturation:
{
// Hue
return ColorChannel.Channel1;
}
{
// Hue
return ColorChannel.Channel1;
}

case Windows.UI.Xaml.Controls.ColorSpectrumComponents.HueValue:
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.ValueHue:
{
// Saturation
return ColorChannel.Channel2;
}
{
// Saturation
return ColorChannel.Channel2;
}

case Windows.UI.Xaml.Controls.ColorSpectrumComponents.HueSaturation:
case Windows.UI.Xaml.Controls.ColorSpectrumComponents.SaturationHue:
{
// Value
return ColorChannel.Channel3;
}
{
// Value
return ColorChannel.Channel3;
}
}

return ColorChannel.Alpha; // Error, should never get here
Expand Down Expand Up @@ -671,31 +671,31 @@ private void UpdateColorControlValues()
switch (this.GetActiveColorSpectrumThirdDimension())
{
case ColorChannel.Channel1:
{
// Hue
this.ColorSpectrumThirdDimensionSlider.Minimum = 0;
this.ColorSpectrumThirdDimensionSlider.Maximum = 360;
this.ColorSpectrumThirdDimensionSlider.Value = hue;
break;
}
{
// Hue
this.ColorSpectrumThirdDimensionSlider.Minimum = 0;
this.ColorSpectrumThirdDimensionSlider.Maximum = 360;
this.ColorSpectrumThirdDimensionSlider.Value = hue;
break;
}

case ColorChannel.Channel2:
{
// Saturation
this.ColorSpectrumThirdDimensionSlider.Minimum = 0;
this.ColorSpectrumThirdDimensionSlider.Maximum = 100;
this.ColorSpectrumThirdDimensionSlider.Value = staturation;
break;
}
{
// Saturation
this.ColorSpectrumThirdDimensionSlider.Minimum = 0;
this.ColorSpectrumThirdDimensionSlider.Maximum = 100;
this.ColorSpectrumThirdDimensionSlider.Value = staturation;
break;
}

case ColorChannel.Channel3:
{
// Value
this.ColorSpectrumThirdDimensionSlider.Minimum = 0;
this.ColorSpectrumThirdDimensionSlider.Maximum = 100;
this.ColorSpectrumThirdDimensionSlider.Value = value;
break;
}
{
// Value
this.ColorSpectrumThirdDimensionSlider.Minimum = 0;
this.ColorSpectrumThirdDimensionSlider.Maximum = 100;
this.ColorSpectrumThirdDimensionSlider.Value = value;
break;
}
}
}

Expand Down Expand Up @@ -885,29 +885,29 @@ private void SetColorChannel(
switch (channel)
{
case ColorChannel.Channel1:
{
hue = Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 360);
break;
}
{
hue = Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 360);
break;
}

case ColorChannel.Channel2:
{
saturation = Math.Clamp((double.IsNaN(newValue) ? 0 : newValue) / 100, 0, 1);
break;
}
{
saturation = Math.Clamp((double.IsNaN(newValue) ? 0 : newValue) / 100, 0, 1);
break;
}

case ColorChannel.Channel3:
{
value = Math.Clamp((double.IsNaN(newValue) ? 0 : newValue) / 100, 0, 1);
break;
}
{
value = Math.Clamp((double.IsNaN(newValue) ? 0 : newValue) / 100, 0, 1);
break;
}

case ColorChannel.Alpha:
{
// Unlike color channels, default to no transparency
alpha = Math.Clamp((double.IsNaN(newValue) ? 100 : newValue) / 100, 0, 1);
break;
}
{
// Unlike color channels, default to no transparency
alpha = Math.Clamp((double.IsNaN(newValue) ? 100 : newValue) / 100, 0, 1);
break;
}
}

newRgbColor = Uwp.Helpers.ColorHelper.FromHsv(
Expand Down Expand Up @@ -936,29 +936,29 @@ private void SetColorChannel(
switch (channel)
{
case ColorChannel.Channel1:
{
red = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
break;
}
{
red = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
break;
}

case ColorChannel.Channel2:
{
green = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
break;
}
{
green = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
break;
}

case ColorChannel.Channel3:
{
blue = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
break;
}
{
blue = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
break;
}

case ColorChannel.Alpha:
{
// Unlike color channels, default to no transparency
alpha = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 255 : newValue, 0, 255));
break;
}
{
// Unlike color channels, default to no transparency
alpha = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 255 : newValue, 0, 255));
break;
}
}

newRgbColor = new Color()
Expand Down
Loading

0 comments on commit 63cbb4a

Please sign in to comment.