Fix some typos

This commit is contained in:
Kristen Schau
2024-09-18 18:56:23 -04:00
parent 36195db409
commit 5ceb38671a
5 changed files with 29 additions and 25 deletions

View File

@@ -52,7 +52,7 @@ public sealed partial class AllAppsPage : ListPage
// * RegistryAppProgramPaths
// for now. I've disabled the "PATH" source too, because it's n o i s y
//
// This also doesn't include Packaged apps, cause they're enumerated entirely seperately.
// This also doesn't include Packaged apps, cause they're enumerated entirely separately.
var cache = AppCache.Instance.Value;
var uwps = cache.UWPs;
var win32s = cache.Win32s;

View File

@@ -20,7 +20,7 @@ internal sealed partial class AppAction : InvokableCommand
Icon = new(_app.IcoPath);
}
internal static async Task StartApp(string amuid)
internal static async Task StartApp(string aumid)
{
var appManager = new ApplicationActivationManager();
const ActivateOptions noFlags = ActivateOptions.None;
@@ -28,7 +28,7 @@ internal sealed partial class AppAction : InvokableCommand
{
try
{
appManager.ActivateApplication(amuid, /*queryArguments*/ string.Empty, noFlags, out var unusedPid);
appManager.ActivateApplication(aumid, /*queryArguments*/ string.Empty, noFlags, out var unusedPid);
}
catch (System.Exception)
{

View File

@@ -148,7 +148,7 @@ public class ShellLinkHelper : IShellLinkHelper
((IShellLinkW)link).Resolve(ref hwnd, 0);
const int MAX_PATH = 260;
StringBuilder buffer = new StringBuilder(MAX_PATH);
var buffer = new StringBuilder(MAX_PATH);
var data = default(WIN32_FIND_DATAW);
((IShellLinkW)link).GetPath(buffer, buffer.Capacity, ref data, SLGP_FLAGS.SLGP_SHORTPATH);
@@ -169,7 +169,7 @@ public class ShellLinkHelper : IShellLinkHelper
Description = string.Empty;
}
StringBuilder argumentBuffer = new StringBuilder(MAX_PATH);
var argumentBuffer = new StringBuilder(MAX_PATH);
((IShellLinkW)link).GetArguments(argumentBuffer, argumentBuffer.Capacity);
Arguments = argumentBuffer.ToString();

View File

@@ -89,7 +89,7 @@ public partial class UWP
// http://www.hanselman.com/blog/GetNamespacesFromAnXMLDocumentWithXPathDocumentAndLINQToXML.aspx
private static string[] XmlNamespaces(string path)
{
XDocument z = XDocument.Load(path);
var z = XDocument.Load(path);
if (z.Root != null)
{
var namespaces = z.Root.Attributes().

View File

@@ -94,10 +94,10 @@ public class UWPApplication : IProgram
// logoUri = "";
Enabled = true;
CanRunElevated = IfApplicationcanRunElevated();
CanRunElevated = IfApplicationCanRunElevated();
}
private bool IfApplicationcanRunElevated()
private bool IfApplicationCanRunElevated()
{
if (EntryPoint == "Windows.FullTrustApplication")
{
@@ -119,7 +119,11 @@ public class UWPApplication : IProgram
{
var namespaceManager = new XmlNamespaceManager(xmlDoc.NameTable);
namespaceManager.AddNamespace("uap10", "http://schemas.microsoft.com/appx/manifest/uap/windows10/10");
var trustLevelNode = xmlRoot.SelectSingleNode("//*[local-name()='Application' and @uap10:TrustLevel]", namespaceManager); // According to https://learn.microsoft.com/windows/apps/desktop/modernize/grant-identity-to-nonpackaged-apps#create-a-package-manifest-for-the-sparse-package and https://learn.microsoft.com/uwp/schemas/appxpackage/uapmanifestschema/element-application#attributes
// According to
// https://learn.microsoft.com/windows/apps/desktop/modernize/grant-identity-to-nonpackaged-apps#create-a-package-manifest-for-the-sparse-package
// and https://learn.microsoft.com/uwp/schemas/appxpackage/uapmanifestschema/element-application#attributes
var trustLevelNode = xmlRoot.SelectSingleNode("//*[local-name()='Application' and @uap10:TrustLevel]", namespaceManager);
if (trustLevelNode?.Attributes?["uap10:TrustLevel"]?.Value == "mediumIL")
{
@@ -263,7 +267,7 @@ public class UWPApplication : IProgram
{ PackageVersion.Windows8, new List<int> { 100 } },
};
private bool SetScaleIcons(string path, string colorscheme, bool highContrast = false)
private bool SetScaleIcons(string path, string colorScheme, bool highContrast = false)
{
var extension = Path.GetExtension(path);
if (extension != null)
@@ -283,8 +287,8 @@ public class UWPApplication : IProgram
{
if (highContrast)
{
paths.Add($"{prefix}.scale-{factor}_{colorscheme}{extension}");
paths.Add($"{prefix}.{colorscheme}_scale-{factor}{extension}");
paths.Add($"{prefix}.scale-{factor}_{colorScheme}{extension}");
paths.Add($"{prefix}.{colorScheme}_scale-{factor}{extension}");
}
else
{
@@ -313,7 +317,7 @@ public class UWPApplication : IProgram
return false;
}
private bool SetTargetSizeIcon(string path, string colorscheme, bool highContrast = false)
private bool SetTargetSizeIcon(string path, string colorScheme, bool highContrast = false)
{
var extension = Path.GetExtension(path);
if (extension != null)
@@ -329,8 +333,8 @@ public class UWPApplication : IProgram
{
if (highContrast)
{
var suffixThemePath = $"{prefix}.targetsize-{factor}_{colorscheme}{extension}";
var prefixThemePath = $"{prefix}.{colorscheme}_targetsize-{factor}{extension}";
var suffixThemePath = $"{prefix}.targetsize-{factor}_{colorScheme}{extension}";
var prefixThemePath = $"{prefix}.{colorScheme}_targetsize-{factor}{extension}";
paths.Add(suffixThemePath);
paths.Add(prefixThemePath);
@@ -369,27 +373,27 @@ public class UWPApplication : IProgram
return false;
}
private bool SetColoredIcon(string path, string colorscheme)
private bool SetColoredIcon(string path, string colorScheme)
{
var isSetColoredScaleIcon = SetScaleIcons(path, colorscheme);
var isSetColoredScaleIcon = SetScaleIcons(path, colorScheme);
if (isSetColoredScaleIcon)
{
return true;
}
var isSetColoredTargetIcon = SetTargetSizeIcon(path, colorscheme);
var isSetColoredTargetIcon = SetTargetSizeIcon(path, colorScheme);
if (isSetColoredTargetIcon)
{
return true;
}
var isSetHighContrastScaleIcon = SetScaleIcons(path, colorscheme, true);
var isSetHighContrastScaleIcon = SetScaleIcons(path, colorScheme, true);
if (isSetHighContrastScaleIcon)
{
return true;
}
var isSetHighContrastTargetIcon = SetTargetSizeIcon(path, colorscheme, true);
var isSetHighContrastTargetIcon = SetTargetSizeIcon(path, colorScheme, true);
if (isSetHighContrastTargetIcon)
{
return true;
@@ -398,27 +402,27 @@ public class UWPApplication : IProgram
return false;
}
private bool SetHighContrastIcon(string path, string colorscheme)
private bool SetHighContrastIcon(string path, string colorScheme)
{
var isSetHighContrastScaleIcon = SetScaleIcons(path, colorscheme, true);
var isSetHighContrastScaleIcon = SetScaleIcons(path, colorScheme, true);
if (isSetHighContrastScaleIcon)
{
return true;
}
var isSetHighContrastTargetIcon = SetTargetSizeIcon(path, colorscheme, true);
var isSetHighContrastTargetIcon = SetTargetSizeIcon(path, colorScheme, true);
if (isSetHighContrastTargetIcon)
{
return true;
}
var isSetColoredScaleIcon = SetScaleIcons(path, colorscheme);
var isSetColoredScaleIcon = SetScaleIcons(path, colorScheme);
if (isSetColoredScaleIcon)
{
return true;
}
var isSetColoredTargetIcon = SetTargetSizeIcon(path, colorscheme);
var isSetColoredTargetIcon = SetTargetSizeIcon(path, colorScheme);
if (isSetColoredTargetIcon)
{
return true;