Skip to content

Commit bc30180

Browse files
committed
Refactor repo with ponytail cleanup
1 parent 07af427 commit bc30180

299 files changed

Lines changed: 47890 additions & 58785 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

App.xaml.cs

Lines changed: 469 additions & 497 deletions
Large diffs are not rendered by default.

AssemblyInfo.cs

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
1-
/*
2-
* ThreadPilot - Advanced Windows Process and Power Plan Manager
3-
* Copyright (C) 2025 Prime Build
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU Affero General Public License as published by
7-
* the Free Software Foundation, version 3 only.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU Affero General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU Affero General Public License
15-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16-
*/
17-
using System.Runtime.CompilerServices;
18-
using System.Windows;
19-
20-
[assembly: InternalsVisibleTo("ThreadPilot.Core.Tests")]
21-
22-
[assembly: ThemeInfo(
23-
ResourceDictionaryLocation.None, // where theme specific resource dictionaries are located
24-
// (used if a resource is not found in the page,
25-
// or application resource dictionaries)
26-
ResourceDictionaryLocation.SourceAssembly) // where the generic resource dictionary is located
27-
// (used if a resource is not found in the page,
28-
// app, or any theme specific resource dictionaries)
29-
]
30-
1+
using System.Runtime.CompilerServices;
2+
using System.Windows;
3+
4+
[assembly: InternalsVisibleTo("ThreadPilot.Core.Tests")]
5+
6+
[assembly: ThemeInfo(
7+
ResourceDictionaryLocation.None, // where theme specific resource dictionaries are located
8+
// (used if a resource is not found in the page,
9+
// or application resource dictionaries)
10+
ResourceDictionaryLocation.SourceAssembly) // where the generic resource dictionary is located
11+
// (used if a resource is not found in the page,
12+
// app, or any theme specific resource dictionaries)
13+
]
14+

Converters/BoolToColorConverter.cs

Lines changed: 41 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,41 @@
1-
/*
2-
* ThreadPilot - Advanced Windows Process and Power Plan Manager
3-
* Copyright (C) 2025 Prime Build
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU Affero General Public License as published by
7-
* the Free Software Foundation, version 3 only.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU Affero General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU Affero General Public License
15-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16-
*/
17-
namespace ThreadPilot
18-
{
19-
using System;
20-
using System.Globalization;
21-
using System.Windows;
22-
using System.Windows.Data;
23-
using System.Windows.Media;
24-
25-
public class BoolToColorConverter : IValueConverter
26-
{
27-
public static readonly BoolToColorConverter Instance = new();
28-
29-
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
30-
{
31-
if (value is bool boolValue)
32-
{
33-
return boolValue
34-
? ResolveBrush("TextFillColorPrimaryBrush", System.Windows.Media.Brushes.Black)
35-
: ResolveBrush("TextFillColorSecondaryBrush", System.Windows.Media.Brushes.Gray);
36-
}
37-
38-
return ResolveBrush("TextFillColorSecondaryBrush", System.Windows.Media.Brushes.Gray);
39-
}
40-
41-
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
42-
{
43-
throw new NotImplementedException();
44-
}
45-
46-
private static System.Windows.Media.Brush ResolveBrush(string key, System.Windows.Media.Brush fallback)
47-
{
48-
if (System.Windows.Application.Current?.TryFindResource(key) is System.Windows.Media.Brush brush)
49-
{
50-
return brush;
51-
}
52-
53-
return fallback;
54-
}
55-
}
56-
}
57-
1+
namespace ThreadPilot
2+
{
3+
using System;
4+
using System.Globalization;
5+
using System.Windows;
6+
using System.Windows.Data;
7+
using System.Windows.Media;
8+
9+
public class BoolToColorConverter : IValueConverter
10+
{
11+
public static readonly BoolToColorConverter Instance = new();
12+
13+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14+
{
15+
if (value is bool boolValue)
16+
{
17+
return boolValue
18+
? ResolveBrush("TextFillColorPrimaryBrush", System.Windows.Media.Brushes.Black)
19+
: ResolveBrush("TextFillColorSecondaryBrush", System.Windows.Media.Brushes.Gray);
20+
}
21+
22+
return ResolveBrush("TextFillColorSecondaryBrush", System.Windows.Media.Brushes.Gray);
23+
}
24+
25+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
26+
{
27+
throw new NotImplementedException();
28+
}
29+
30+
private static System.Windows.Media.Brush ResolveBrush(string key, System.Windows.Media.Brush fallback)
31+
{
32+
if (System.Windows.Application.Current?.TryFindResource(key) is System.Windows.Media.Brush brush)
33+
{
34+
return brush;
35+
}
36+
37+
return fallback;
38+
}
39+
}
40+
}
41+
Lines changed: 27 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,27 @@
1-
/*
2-
* ThreadPilot - Advanced Windows Process and Power Plan Manager
3-
* Copyright (C) 2025 Prime Build
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU Affero General Public License as published by
7-
* the Free Software Foundation, version 3 only.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU Affero General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU Affero General Public License
15-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16-
*/
17-
namespace ThreadPilot
18-
{
19-
using System;
20-
using System.Globalization;
21-
using System.Windows;
22-
using System.Windows.Data;
23-
24-
public class BoolToFontWeightConverter : IValueConverter
25-
{
26-
public static readonly BoolToFontWeightConverter Instance = new();
27-
28-
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
29-
{
30-
if (value is bool boolValue && boolValue)
31-
{
32-
return FontWeights.Bold;
33-
}
34-
return FontWeights.Normal;
35-
}
36-
37-
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
38-
{
39-
throw new NotImplementedException();
40-
}
41-
}
42-
}
43-
1+
namespace ThreadPilot
2+
{
3+
using System;
4+
using System.Globalization;
5+
using System.Windows;
6+
using System.Windows.Data;
7+
8+
public class BoolToFontWeightConverter : IValueConverter
9+
{
10+
public static readonly BoolToFontWeightConverter Instance = new();
11+
12+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
13+
{
14+
if (value is bool boolValue && boolValue)
15+
{
16+
return FontWeights.Bold;
17+
}
18+
return FontWeights.Normal;
19+
}
20+
21+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22+
{
23+
throw new NotImplementedException();
24+
}
25+
}
26+
}
27+
Lines changed: 29 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,29 @@
1-
/*
2-
* ThreadPilot - Advanced Windows Process and Power Plan Manager
3-
* Copyright (C) 2025 Prime Build
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU Affero General Public License as published by
7-
* the Free Software Foundation, version 3 only.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU Affero General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU Affero General Public License
15-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16-
*/
17-
namespace ThreadPilot.Converters
18-
{
19-
using System;
20-
using System.Globalization;
21-
using System.Windows.Data;
22-
23-
/// <summary>
24-
/// Converts boolean values to strings based on parameter format.
25-
/// </summary>
26-
public class BoolToStringConverter : IValueConverter
27-
{
28-
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
29-
{
30-
if (value is bool boolValue && parameter is string paramString)
31-
{
32-
var parts = paramString.Split('|');
33-
if (parts.Length == 2)
34-
{
35-
return boolValue ? parts[0] : parts[1];
36-
}
37-
}
38-
39-
return value?.ToString() ?? string.Empty;
40-
}
41-
42-
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
43-
{
44-
throw new NotImplementedException();
45-
}
46-
}
47-
}
48-
1+
namespace ThreadPilot.Converters
2+
{
3+
using System;
4+
using System.Globalization;
5+
using System.Windows.Data;
6+
7+
public class BoolToStringConverter : IValueConverter
8+
{
9+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
10+
{
11+
if (value is bool boolValue && parameter is string paramString)
12+
{
13+
var parts = paramString.Split('|');
14+
if (parts.Length == 2)
15+
{
16+
return boolValue ? parts[0] : parts[1];
17+
}
18+
}
19+
20+
return value?.ToString() ?? string.Empty;
21+
}
22+
23+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
24+
{
25+
throw new NotImplementedException();
26+
}
27+
}
28+
}
29+
Lines changed: 31 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,31 @@
1-
/*
2-
* ThreadPilot - Advanced Windows Process and Power Plan Manager
3-
* Copyright (C) 2025 Prime Build
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU Affero General Public License as published by
7-
* the Free Software Foundation, version 3 only.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU Affero General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU Affero General Public License
15-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16-
*/
17-
namespace ThreadPilot
18-
{
19-
using System;
20-
using System.Globalization;
21-
using System.Windows;
22-
using System.Windows.Data;
23-
24-
public class BoolToVisibilityConverter : IValueConverter
25-
{
26-
public static readonly BoolToVisibilityConverter Instance = new();
27-
28-
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
29-
{
30-
if (value is bool boolValue && boolValue)
31-
{
32-
return Visibility.Visible;
33-
}
34-
return Visibility.Collapsed;
35-
}
36-
37-
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
38-
{
39-
if (value is Visibility visibility)
40-
{
41-
return visibility == Visibility.Visible;
42-
}
43-
return false;
44-
}
45-
}
46-
}
47-
1+
namespace ThreadPilot
2+
{
3+
using System;
4+
using System.Globalization;
5+
using System.Windows;
6+
using System.Windows.Data;
7+
8+
public class BoolToVisibilityConverter : IValueConverter
9+
{
10+
public static readonly BoolToVisibilityConverter Instance = new();
11+
12+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
13+
{
14+
if (value is bool boolValue && boolValue)
15+
{
16+
return Visibility.Visible;
17+
}
18+
return Visibility.Collapsed;
19+
}
20+
21+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22+
{
23+
if (value is Visibility visibility)
24+
{
25+
return visibility == Visibility.Visible;
26+
}
27+
return false;
28+
}
29+
}
30+
}
31+

0 commit comments

Comments
 (0)