mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[CodeQuality]Address C# static analyzer suggestions (#29765)
* Address static analyzer suggestions * address feedback
This commit is contained in:
committed by
GitHub
parent
22000228e2
commit
5e7d5d1f7f
@@ -560,7 +560,7 @@ namespace PowerLauncher
|
||||
|
||||
// To populate the AutoCompleteTextBox as soon as the selection is changed or set.
|
||||
// Setting it here instead of when the text is changed as there is a delay in executing the query and populating the result
|
||||
if (_viewModel.Results != null && !string.IsNullOrEmpty(SearchBox.QueryTextBox.Text))
|
||||
if (!string.IsNullOrEmpty(SearchBox.QueryTextBox.Text))
|
||||
{
|
||||
SearchBox.AutoCompleteTextBlock.Text = MainViewModel.GetAutoCompleteText(
|
||||
_viewModel.Results.SelectedIndex,
|
||||
|
||||
@@ -13,7 +13,6 @@ using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using global::PowerToys.GPOWrapper;
|
||||
using ManagedCommon;
|
||||
using PowerLauncher.Properties;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using Wox.Plugin;
|
||||
@@ -60,12 +59,14 @@ namespace PowerLauncher.Plugin
|
||||
{
|
||||
try
|
||||
{
|
||||
// Return a comparable produce version.
|
||||
// Return a comparable product version.
|
||||
var fileVersion = FileVersionInfo.GetVersionInfo(x.ExecuteFilePath);
|
||||
return ((uint)fileVersion.ProductMajorPart << 48)
|
||||
| ((uint)fileVersion.ProductMinorPart << 32)
|
||||
| ((uint)fileVersion.ProductBuildPart << 16)
|
||||
| ((uint)fileVersion.ProductPrivatePart);
|
||||
|
||||
// Convert each part to an unsigned 32 bit integer, then extend to 64 bit.
|
||||
return ((ulong)(uint)fileVersion.ProductMajorPart << 48)
|
||||
| ((ulong)(uint)fileVersion.ProductMinorPart << 32)
|
||||
| ((ulong)(uint)fileVersion.ProductBuildPart << 16)
|
||||
| (ulong)(uint)fileVersion.ProductPrivatePart;
|
||||
}
|
||||
catch (System.IO.FileNotFoundException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user