formatowanie kodu

This commit is contained in:
2025-10-31 15:05:50 +01:00
parent 5996598d2a
commit 0f0a78954c
3 changed files with 12 additions and 13 deletions
+3 -3
View File
@@ -100,7 +100,7 @@ namespace Haftmittel
{ {
List<Historia> czysta = new List<Historia>(); List<Historia> czysta = new List<Historia>();
if (h.Count() > 2) if (h.Count > 2)
{ {
string temp = h.FirstOrDefault().wartosc.Trim(); string temp = h.FirstOrDefault().wartosc.Trim();
czysta.Add(h.FirstOrDefault()); czysta.Add(h.FirstOrDefault());
@@ -312,7 +312,7 @@ namespace Haftmittel
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(string.Format("Problem z tabelą {0}. {1}", _dtTowar.TableName, ex.Message)); MessageBox.Show($"Problem z tabelą {_dtTowar.TableName}. {ex.Message}");
} }
try try
@@ -321,7 +321,7 @@ namespace Haftmittel
} }
catch (Exception) catch (Exception)
{ {
MessageBox.Show(string.Format("Problem z tabelą {0}", _dtL.TableName)); MessageBox.Show($"Problem z tabelą {_dtL.TableName}");
} }
#endregion #endregion
+4 -5
View File
@@ -9,9 +9,9 @@ namespace Haftmittel
{ {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{ {
if (value is bool) if (value is bool v)
{ {
if ((bool)value) if (v)
{ {
return Brushes.Red; return Brushes.Red;
} }
@@ -28,9 +28,9 @@ namespace Haftmittel
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{ {
if (value is Brushes) if (value is Brush b)
{ {
if ((value as Brush) == Brushes.Red) if (b == Brushes.Red)
{ {
return true; return true;
} }
@@ -38,7 +38,6 @@ namespace Haftmittel
{ {
return false; return false;
} }
} }
else else
{ {
+4 -4
View File
@@ -12,9 +12,9 @@ namespace Haftmittel
{ {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {
if (value is bool) if (value is bool b)
{ {
if ((bool)value) if (b)
{ {
return 1; return 1;
} }
@@ -31,9 +31,9 @@ namespace Haftmittel
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{ {
if (value is double) if (value is double d)
{ {
return ((double)value == 1); return d == 1;
} }
else else
{ {