Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions source/BulkCrapUninstaller/BulkCrapUninstaller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,23 @@
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\KlocTools\KlocTools.csproj" />
<ProjectReference Include="..\NBug_custom\NBug.csproj" />
<ProjectReference Include="..\NetSettingBinder\NetSettingBinder.csproj" />
<ItemGroup>
<ProjectReference Include="..\KlocTools\KlocTools.csproj" />
<ProjectReference Include="..\NBug_custom\NBug.csproj" />
<ProjectReference Include="..\NetSettingBinder\NetSettingBinder.csproj" />
<ProjectReference Include="..\ObjectListView\ObjectListView.csproj" />
<ProjectReference Include="..\PortableSettingsProvider\PortableSettingsProvider.csproj" />
<ProjectReference Include="..\SimpleTreeMap\SimpleTreeMap.csproj" />
<ProjectReference Include="..\UninstallTools\UninstallTools.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" />
</ItemGroup>
<ProjectReference Include="..\UninstallTools\UninstallTools.csproj" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="BulkCrapUninstallerTests" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" />
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Localisable.Designer.cs">
Expand All @@ -84,4 +88,4 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
</Project>
71 changes: 39 additions & 32 deletions source/BulkCrapUninstaller/Forms/Windows/MainWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 25 additions & 13 deletions source/BulkCrapUninstaller/Forms/Windows/MainWindow.resx
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,18 @@
<data name="olvColumnSystemComponent.Text" xml:space="preserve">
<value>System Component</value>
</data>
<data name="olvColumnSystemComponent.Width" type="System.Int32, mscorlib">
<value>40</value>
</data>
<data name="olvColumnProtected.Text" xml:space="preserve">
<value>Protected</value>
</data>
<data name="olvColumnSystemComponent.Width" type="System.Int32, mscorlib">
<value>40</value>
</data>
<data name="olvColumnStatus.Text" xml:space="preserve">
<value>Status</value>
</data>
<data name="olvColumnStatus.Width" type="System.Int32, mscorlib">
<value>120</value>
</data>
<data name="olvColumnProtected.Text" xml:space="preserve">
<value>Protected</value>
</data>
<data name="olvColumnProtected.Width" type="System.Int32, mscorlib">
<value>40</value>
</data>
Expand Down Expand Up @@ -2261,12 +2267,18 @@
<data name="&gt;&gt;olvColumnSystemComponent.Name" xml:space="preserve">
<value>olvColumnSystemComponent</value>
</data>
<data name="&gt;&gt;olvColumnSystemComponent.Type" xml:space="preserve">
<value>BrightIdeasSoftware.OLVColumn, ObjectListView, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;olvColumnProtected.Name" xml:space="preserve">
<value>olvColumnProtected</value>
</data>
<data name="&gt;&gt;olvColumnSystemComponent.Type" xml:space="preserve">
<value>BrightIdeasSoftware.OLVColumn, ObjectListView, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;olvColumnStatus.Name" xml:space="preserve">
<value>olvColumnStatus</value>
</data>
<data name="&gt;&gt;olvColumnStatus.Type" xml:space="preserve">
<value>BrightIdeasSoftware.OLVColumn, ObjectListView, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;olvColumnProtected.Name" xml:space="preserve">
<value>olvColumnProtected</value>
</data>
<data name="&gt;&gt;olvColumnProtected.Type" xml:space="preserve">
<value>BrightIdeasSoftware.OLVColumn, ObjectListView, Culture=neutral, PublicKeyToken=null</value>
</data>
Expand Down Expand Up @@ -3344,4 +3356,4 @@
<metadata name="usageTracker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 60</value>
</metadata>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,55 @@
Apache License Version 2.0
*/

using System.Drawing;
using BulkCrapUninstaller.Properties;
using UninstallTools;

namespace BulkCrapUninstaller.Functions.ApplicationList
{
internal static class ApplicationListConstants
{
public static ApplicationListColors Colors => Settings.Default.MiscColorblind ? ApplicationListColors.ColorBlind : ApplicationListColors.Normal;

public static Color GetApplicationBackColor(ApplicationUninstallerEntry entry)
{
if (Settings.Default.AdvancedHighlightSpecial)
{
using System;
using System.ComponentModel;
using System.Drawing;
using BulkCrapUninstaller.Controls;
using BulkCrapUninstaller.Properties;
using UninstallTools;
using UninstallToolsLocalisation = UninstallTools.Properties.Localisation;

namespace BulkCrapUninstaller.Functions.ApplicationList
{
internal static class ApplicationListConstants
{
private static readonly ComponentResourceManager ListLegendResources = new(typeof(ListLegend));

public static ApplicationListColors Colors => Settings.Default.MiscColorblind ? ApplicationListColors.ColorBlind : ApplicationListColors.Normal;

public static string GetApplicationStatusText(ApplicationUninstallerEntry entry)
{
if (entry == null) return Localisable.Empty;

if (Settings.Default.AdvancedHighlightSpecial)
{
if (entry.UninstallerKind == UninstallerType.WindowsFeature)
return entry.UninstallerKind.GetLocalisedName();

if (entry.UninstallerKind == UninstallerType.StoreApp)
return entry.UninstallerKind.GetLocalisedName();

if (entry.IsOrphaned)
return UninstallToolsLocalisation.IsOrphaned;
}

if (!entry.IsValid && Settings.Default.AdvancedTestInvalid)
return UninstallToolsLocalisation.UninstallStatus_Invalid;

if (Settings.Default.AdvancedTestCertificates)
{
var result = entry.IsCertificateValid(true);
if (result.HasValue)
return result.Value ? GetListLegendText("labelVerified.Text", "Verified certificate") : GetListLegendText("labelUnverified.Text", "Unverified certificate");
}

return Localisable.Empty;
}

public static Color GetApplicationBackColor(ApplicationUninstallerEntry entry)
{
if (Settings.Default.AdvancedHighlightSpecial)
{
if (entry.UninstallerKind == UninstallerType.WindowsFeature)
return Colors.WindowsFeatureColor;

Expand Down Expand Up @@ -64,8 +99,13 @@ public static Color GetApplicationTreemapColor(ApplicationUninstallerEntry entry
? Colors.VerifiedColor
: Colors.UnverifiedColor;
}

return Color.White;
}
}
}

return Color.White;
}

private static string GetListLegendText(string resourceName, string fallback)
{
return ListLegendResources.GetString(resourceName) ?? fallback;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,15 @@ public void SetupListView()
_reference.olvColumnGuid.AspectGetter = ListViewDelegates.ColumnGuidAspectGetter;
_reference.olvColumnGuid.GroupKeyGetter = ListViewDelegates.ColumnGuidGroupKeyGetter;

_reference.olvColumnSystemComponent.AspectName = RegistryFactory.RegistryNameSystemComponent;
_reference.olvColumnSystemComponent.AspectToStringConverter = ListViewDelegates.BoolToYesNoAspectConverter;
_reference.olvColumnSystemComponent.GroupKeyToTitleConverter = ListViewDelegates.BoolToYesNoAspectConverter;

_reference.olvColumnIs64.AspectGetter =
y => (y as ApplicationUninstallerEntry)?.Is64Bit.GetLocalisedName();
_reference.olvColumnSystemComponent.AspectName = RegistryFactory.RegistryNameSystemComponent;
_reference.olvColumnSystemComponent.AspectToStringConverter = ListViewDelegates.BoolToYesNoAspectConverter;
_reference.olvColumnSystemComponent.GroupKeyToTitleConverter = ListViewDelegates.BoolToYesNoAspectConverter;

_reference.olvColumnStatus.AspectGetter =
y => ApplicationListConstants.GetApplicationStatusText(y as ApplicationUninstallerEntry);

_reference.olvColumnIs64.AspectGetter =
y => (y as ApplicationUninstallerEntry)?.Is64Bit.GetLocalisedName();

_reference.olvColumnProtected.AspectToStringConverter = ListViewDelegates.BoolToYesNoAspectConverter;
_reference.olvColumnProtected.GroupKeyToTitleConverter = ListViewDelegates.BoolToYesNoAspectConverter;
Expand Down Expand Up @@ -267,4 +270,4 @@ public void UpdateColumnFiltering(bool anyUninstallers)
_updateThrottleTimer.Start();
}
}
}
}
Loading