mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-29 16:36:40 +01:00
Compare commits
14 Commits
dev/vanzue
...
shawn/addL
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b22e53ca70 | ||
|
|
10f4a9c2f0 | ||
|
|
e14609cbca | ||
|
|
8700edc001 | ||
|
|
db08a0d517 | ||
|
|
eb7b5a32d0 | ||
|
|
e70e6e5a71 | ||
|
|
3d1b582826 | ||
|
|
9665eb533b | ||
|
|
d5cffb7458 | ||
|
|
e74c88f853 | ||
|
|
ed505f0cb6 | ||
|
|
ad90f4b944 | ||
|
|
997af8e1c7 |
@@ -2,8 +2,10 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Programs;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
@@ -33,8 +35,9 @@ internal sealed partial class AppCommand : InvokableCommand
|
||||
{
|
||||
appManager.ActivateApplication(aumid, /*queryArguments*/ string.Empty, noFlags, out var unusedPid);
|
||||
}
|
||||
catch (System.Exception)
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
@@ -46,7 +49,14 @@ internal sealed partial class AppCommand : InvokableCommand
|
||||
// const ActivateOptions noFlags = ActivateOptions.None;
|
||||
await Task.Run(() =>
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(path) { UseShellExecute = true });
|
||||
try
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(path) { UseShellExecute = true });
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
@@ -38,9 +39,9 @@ internal sealed partial class OpenInConsoleCommand : InvokableCommand
|
||||
|
||||
Process.Start(processStartInfo);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Log.Exception($"Failed to open {Name} in console, {e.Message}", e, GetType());
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using ManagedCommon;
|
||||
using Windows.Foundation.Metadata;
|
||||
using Package = Windows.ApplicationModel.Package;
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ using System.Collections.Generic;
|
||||
using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Utils;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
using Windows.Win32;
|
||||
using Windows.Win32.Foundation;
|
||||
using Windows.Win32.System.Com;
|
||||
@@ -131,8 +133,9 @@ public partial class UWP
|
||||
u = new UWP(p);
|
||||
u.InitializeAppInfo(p.InstalledLocation);
|
||||
}
|
||||
catch (Exception )
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
return Array.Empty<UWPApplication>();
|
||||
}
|
||||
|
||||
@@ -161,8 +164,9 @@ public partial class UWP
|
||||
var path = p.InstalledLocation;
|
||||
return !f && !string.IsNullOrEmpty(path);
|
||||
}
|
||||
catch (Exception )
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -8,12 +8,14 @@ using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Commands;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CmdPal.Ext.Apps.Utils;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
using static Microsoft.CmdPal.Ext.Apps.Utils.Native;
|
||||
using PackageVersion = Microsoft.CmdPal.Ext.Apps.Programs.UWP.PackageVersion;
|
||||
using Theme = Microsoft.CmdPal.Ext.Apps.Utils.Theme;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.Apps.Programs;
|
||||
|
||||
@@ -154,8 +156,9 @@ public class UWPApplication : IProgram
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ using System.Security;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Commands;
|
||||
using Microsoft.CmdPal.Ext.Apps.Properties;
|
||||
using Microsoft.CmdPal.Ext.Apps.Utils;
|
||||
@@ -239,10 +240,12 @@ public class Win32Program : IProgram
|
||||
}
|
||||
catch (Exception e) when (e is SecurityException || e is UnauthorizedAccessException)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return InvalidProgram;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return InvalidProgram;
|
||||
}
|
||||
}
|
||||
@@ -317,11 +320,13 @@ public class Win32Program : IProgram
|
||||
}
|
||||
catch (Exception e) when (e is SecurityException || e is UnauthorizedAccessException)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return InvalidProgram;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return InvalidProgram;
|
||||
}
|
||||
}
|
||||
@@ -374,15 +379,17 @@ public class Win32Program : IProgram
|
||||
|
||||
return program;
|
||||
}
|
||||
catch (System.IO.FileLoadException)
|
||||
catch (System.IO.FileLoadException e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return InvalidProgram;
|
||||
}
|
||||
|
||||
// Only do a catch all in production. This is so make developer aware of any unhandled exception and add the exception handling in.
|
||||
// Error caused likely due to trying to get the description of the program
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return InvalidProgram;
|
||||
}
|
||||
}
|
||||
@@ -402,14 +409,17 @@ public class Win32Program : IProgram
|
||||
}
|
||||
catch (Exception e) when (e is SecurityException || e is UnauthorizedAccessException)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return InvalidProgram;
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return InvalidProgram;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return InvalidProgram;
|
||||
}
|
||||
}
|
||||
@@ -515,16 +525,19 @@ public class Win32Program : IProgram
|
||||
{
|
||||
files.AddRange(Directory.EnumerateFiles(currentDirectory, $"*.{suffix}", SearchOption.TopDirectoryOnly));
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
catch (DirectoryNotFoundException e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e) when (e is SecurityException || e is UnauthorizedAccessException)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
}
|
||||
|
||||
try
|
||||
@@ -548,9 +561,11 @@ public class Win32Program : IProgram
|
||||
}
|
||||
catch (Exception e) when (e is SecurityException || e is UnauthorizedAccessException)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
}
|
||||
}
|
||||
while (folderQueue.Count > 0);
|
||||
@@ -682,6 +697,7 @@ public class Win32Program : IProgram
|
||||
}
|
||||
catch (Exception e) when (e is SecurityException || e is UnauthorizedAccessException)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -769,8 +785,9 @@ public class Win32Program : IProgram
|
||||
icoPath = ExpandEnvironmentVariables(redirectionPath);
|
||||
return true;
|
||||
}
|
||||
catch (IOException)
|
||||
catch (IOException e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
}
|
||||
|
||||
icoPath = null;
|
||||
@@ -839,8 +856,9 @@ public class Win32Program : IProgram
|
||||
|
||||
return DeduplicatePrograms(programs.Concat(runCommandPrograms).Where(program => program?.Valid == true));
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
return Array.Empty<Win32Program>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Collections;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.Apps.Storage;
|
||||
|
||||
@@ -37,8 +38,9 @@ public class ListRepository<T> : IRepository<T>, IEnumerable<T>
|
||||
_items = new ConcurrentDictionary<int, T>(list.ToDictionary(i => i.GetHashCode()));
|
||||
#pragma warning restore CS8602 // Dereference of a possibly null reference.
|
||||
}
|
||||
catch (ArgumentException)
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
Logger.LogInfo(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Programs;
|
||||
using Microsoft.CmdPal.Ext.Apps.Storage;
|
||||
using Microsoft.CmdPal.Ext.Apps.Utils;
|
||||
using Windows.ApplicationModel;
|
||||
|
||||
@@ -93,8 +93,9 @@ internal sealed partial class PackageRepository : ListRepository<UWPApplication>
|
||||
// InitializeAppInfo will throw if there is no AppxManifest.xml for the package.
|
||||
// Note there are sometimes multiple packages per product and this doesn't necessarily mean that we haven't found the app.
|
||||
// eg. "Could not find file 'C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminalPreview_2020.616.45.0_neutral_~_8wekyb3d8bbwe\\AppxManifest.xml'."
|
||||
catch (System.IO.FileNotFoundException)
|
||||
catch (System.IO.FileNotFoundException ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.Apps.Storage;
|
||||
|
||||
@@ -47,8 +48,9 @@ internal sealed partial class Win32ProgramFileSystemWatchers : IDisposable
|
||||
{
|
||||
Directory.GetFiles(path);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError(e.Message);
|
||||
invalidPaths.Add(path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.Threading.Tasks;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Apps.Programs;
|
||||
using Win32Program = Microsoft.CmdPal.Ext.Apps.Programs.Win32Program;
|
||||
|
||||
@@ -132,8 +133,9 @@ internal sealed partial class Win32ProgramRepository : ListRepository<Programs.W
|
||||
oldApp = Win32Program.GetAppFromPath(oldPath);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
|
||||
// To remove the old app which has been renamed and to add the new application.
|
||||
@@ -192,8 +194,9 @@ internal sealed partial class Win32ProgramRepository : ListRepository<Programs.W
|
||||
app = Programs.Win32Program.GetAppFromPath(path);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
|
||||
if (app != null)
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Text;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.Apps.Utils;
|
||||
|
||||
@@ -138,9 +139,9 @@ public class ShellLinkHelper : IShellLinkHelper
|
||||
{
|
||||
((IPersistFile)link).Load(path, STGM_READ);
|
||||
}
|
||||
catch (System.IO.FileNotFoundException)
|
||||
catch (System.IO.FileNotFoundException ex)
|
||||
{
|
||||
// Log.Exception("Path could not be retrieved", ex, GetType(), path);
|
||||
Logger.LogError(ex.Message);
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -163,9 +164,9 @@ public class ShellLinkHelper : IShellLinkHelper
|
||||
((IShellLinkW)link).GetDescription(buffer, MAX_PATH);
|
||||
Description = buffer.ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Log.Exception($"Failed to fetch description for {target}, {e.Message}", e, GetType());
|
||||
Logger.LogError(ex.Message);
|
||||
Description = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Text.RegularExpressions;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Bookmarks.Properties;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
using Windows.System;
|
||||
@@ -101,7 +102,7 @@ internal sealed partial class BookmarkPlaceholderForm : FormContent
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Error launching URL: {ex.Message}");
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
|
||||
return CommandResult.GoHome();
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Bookmarks.Properties;
|
||||
using Microsoft.CmdPal.Ext.Indexer;
|
||||
using Microsoft.CommandPalette.Extensions;
|
||||
@@ -97,8 +98,7 @@ public partial class BookmarksCommandProvider : CommandProvider
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// debug log error
|
||||
Debug.WriteLine($"Error loading commands: {ex.Message}");
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
|
||||
if (_bookmarks == null)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Bookmarks.Properties;
|
||||
using Microsoft.CommandPalette.Extensions;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
@@ -34,7 +35,7 @@ internal sealed partial class OpenInTerminalCommand : InvokableCommand
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Error launching Windows Terminal: {ex.Message}");
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
|
||||
return CommandResult.Dismiss();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
using Windows.System;
|
||||
|
||||
@@ -44,7 +45,7 @@ public partial class UrlCommand : InvokableCommand
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Error launching URL: {ex.Message}");
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
|
||||
return CommandResult.Dismiss();
|
||||
@@ -87,9 +88,9 @@ public partial class UrlCommand : InvokableCommand
|
||||
return faviconUrl;
|
||||
}
|
||||
}
|
||||
catch (UriFormatException)
|
||||
catch (UriFormatException ex)
|
||||
{
|
||||
// return "🔗";
|
||||
Logger.LogError(ex.Message);
|
||||
}
|
||||
|
||||
return "🔗";
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using System.Resources;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Registry.Classes;
|
||||
using Microsoft.CmdPal.Ext.Registry.Helpers;
|
||||
using Microsoft.CmdPal.Ext.Registry.Properties;
|
||||
@@ -37,7 +38,7 @@ internal sealed partial class OpenKeyInEditorCommand : InvokableCommand
|
||||
RegistryHelper.OpenRegistryKey(entry.Key?.Name ?? entry.KeyPath);
|
||||
return true;
|
||||
}
|
||||
catch (System.ComponentModel.Win32Exception)
|
||||
catch (System.ComponentModel.Win32Exception ex)
|
||||
{
|
||||
// TODO GH #118 We need a convenient way to show errors to a user
|
||||
// MessageBox.Show(
|
||||
@@ -45,13 +46,13 @@ internal sealed partial class OpenKeyInEditorCommand : InvokableCommand
|
||||
// Resources.OpenInRegistryEditorAccessExceptionTitle,
|
||||
// MessageBoxButton.OK,
|
||||
// MessageBoxImage.Error);
|
||||
Logger.LogError(ex.Message);
|
||||
return false;
|
||||
}
|
||||
#pragma warning disable CS0168, IDE0059
|
||||
catch (Exception exception)
|
||||
{
|
||||
// TODO GH #108: Logging
|
||||
// Log.Exception("Error on opening Windows registry editor", exception, typeof(Main));
|
||||
Logger.LogError(exception.Message);
|
||||
return false;
|
||||
}
|
||||
#pragma warning restore CS0168, IDE0059
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Registry.Classes;
|
||||
using Microsoft.CmdPal.Ext.Registry.Constants;
|
||||
using Microsoft.CmdPal.Ext.Registry.Properties;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.Registry.Classes;
|
||||
using Microsoft.CmdPal.Ext.Registry.Commands;
|
||||
using Microsoft.CmdPal.Ext.Registry.Constants;
|
||||
@@ -96,6 +96,7 @@ internal static class ResultHelper
|
||||
}
|
||||
catch (Exception valueException)
|
||||
{
|
||||
Logger.LogError(valueException.Message);
|
||||
var registryEntry = new RegistryEntry(key.Name, valueException);
|
||||
|
||||
resultList.Add(new ListItem(new OpenKeyInEditorCommand(registryEntry))
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<PackageReference Include="System.ServiceProcess.ServiceController" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||
<ProjectReference Include="..\..\extensionsdk\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.TimeDate.Helpers;
|
||||
|
||||
@@ -109,10 +110,11 @@ internal static class AvailableResultsList
|
||||
{
|
||||
value = dtObject.ToString(value, CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (!containsCustomSyntax)
|
||||
{
|
||||
Logger.LogError($"Unable to format date time with format: {value}. Error: {ex.Message}");
|
||||
throw;
|
||||
}
|
||||
else
|
||||
@@ -133,6 +135,7 @@ internal static class AvailableResultsList
|
||||
}
|
||||
catch (ArgumentOutOfRangeException e)
|
||||
{
|
||||
Logger.LogError($"ArgumentOutOfRangeException with format: {formatSyntax}. Error: {e.Message}");
|
||||
results.Add(new AvailableResult()
|
||||
{
|
||||
Value = Resources.Microsoft_plugin_timedate_ErrorConvertCustomFormat,
|
||||
@@ -144,6 +147,7 @@ internal static class AvailableResultsList
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError($"Exception with format: {formatSyntax}. Error: {e.Message}");
|
||||
results.Add(new AvailableResult()
|
||||
{
|
||||
Value = Resources.Microsoft_plugin_timedate_InvalidCustomFormat + " " + formatSyntax,
|
||||
@@ -325,8 +329,9 @@ internal static class AvailableResultsList
|
||||
IconType = ResultIconType.DateTime,
|
||||
});
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Unable to convert to Windows file time: {ex.Message}");
|
||||
results.Add(new AvailableResult()
|
||||
{
|
||||
Value = Resources.Microsoft_plugin_timedate_ErrorConvertWft,
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.TimeDate.Helpers;
|
||||
|
||||
@@ -166,6 +167,7 @@ internal static class TimeAndDateHelper
|
||||
if (DateTime.TryParse(input, out timestamp))
|
||||
{
|
||||
// Known date/time format
|
||||
Logger.LogDebug($"Successfully parsed standard date/time format: '{input}' as {timestamp}");
|
||||
return true;
|
||||
}
|
||||
else if (Regex.IsMatch(input, @"^u[\+-]?\d+$"))
|
||||
@@ -179,10 +181,12 @@ internal static class TimeAndDateHelper
|
||||
{
|
||||
inputParsingErrorMsg = string.Format(CultureInfo.CurrentCulture, errorMessage, Resources.Microsoft_plugin_timedate_Unix, UnixTimeSecondsMin, UnixTimeSecondsMax);
|
||||
timestamp = new DateTime(1, 1, 1, 1, 1, 1);
|
||||
Logger.LogError($"Failed to parse unix timestamp: '{input}'. Value out of range.");
|
||||
return false;
|
||||
}
|
||||
|
||||
timestamp = DateTimeOffset.FromUnixTimeSeconds(secondsU).LocalDateTime;
|
||||
Logger.LogDebug($"Successfully parsed unix timestamp: '{input}' as {timestamp}");
|
||||
return true;
|
||||
}
|
||||
else if (Regex.IsMatch(input, @"^ums[\+-]?\d+$"))
|
||||
@@ -196,10 +200,12 @@ internal static class TimeAndDateHelper
|
||||
{
|
||||
inputParsingErrorMsg = string.Format(CultureInfo.CurrentCulture, errorMessage, Resources.Microsoft_plugin_timedate_Unix_Milliseconds, UnixTimeMillisecondsMin, UnixTimeMillisecondsMax);
|
||||
timestamp = new DateTime(1, 1, 1, 1, 1, 1);
|
||||
Logger.LogError($"Failed to parse unix millisecond timestamp: '{input}'. Value out of range.");
|
||||
return false;
|
||||
}
|
||||
|
||||
timestamp = DateTimeOffset.FromUnixTimeMilliseconds(millisecondsUms).LocalDateTime;
|
||||
Logger.LogDebug($"Successfully parsed unix millisecond timestamp: '{input}' as {timestamp}");
|
||||
return true;
|
||||
}
|
||||
else if (Regex.IsMatch(input, @"^ft\d+$"))
|
||||
@@ -212,11 +218,13 @@ internal static class TimeAndDateHelper
|
||||
{
|
||||
inputParsingErrorMsg = string.Format(CultureInfo.CurrentCulture, errorMessage, Resources.Microsoft_plugin_timedate_WindowsFileTime, WindowsFileTimeMin, WindowsFileTimeMax);
|
||||
timestamp = new DateTime(1, 1, 1, 1, 1, 1);
|
||||
Logger.LogError($"Failed to parse Windows file time: '{input}'. Value out of range.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// DateTime.FromFileTime returns as local time.
|
||||
timestamp = DateTime.FromFileTime(secondsFt);
|
||||
Logger.LogDebug($"Successfully parsed Windows file time: '{input}' as {timestamp}");
|
||||
return true;
|
||||
}
|
||||
else if (Regex.IsMatch(input, @"^oa[+-]?\d+[,.0-9]*$"))
|
||||
@@ -230,10 +238,12 @@ internal static class TimeAndDateHelper
|
||||
{
|
||||
inputParsingErrorMsg = string.Format(CultureInfo.CurrentCulture, errorMessage, Resources.Microsoft_plugin_timedate_OADate, OADateMin, OADateMax);
|
||||
timestamp = new DateTime(1, 1, 1, 1, 1, 1);
|
||||
Logger.LogError($"Failed to parse OLE Automation date: '{input}'. Value out of range.");
|
||||
return false;
|
||||
}
|
||||
|
||||
timestamp = DateTime.FromOADate(oADate);
|
||||
Logger.LogDebug($"Successfully parsed OLE Automation date: '{input}' as {timestamp}");
|
||||
return true;
|
||||
}
|
||||
else if (Regex.IsMatch(input, @"^exc[+-]?\d+[,.0-9]*$"))
|
||||
@@ -249,6 +259,7 @@ internal static class TimeAndDateHelper
|
||||
// For the if itself we use 0 as min value that we can show a special message if input is 0.
|
||||
inputParsingErrorMsg = string.Format(CultureInfo.CurrentCulture, errorMessage, Resources.Microsoft_plugin_timedate_Excel1900, Excel1900DateMin, Excel1900DateMax);
|
||||
timestamp = new DateTime(1, 1, 1, 1, 1, 1);
|
||||
Logger.LogError($"Failed to parse Excel 1900 date value: '{input}'. Value out of range.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -256,11 +267,13 @@ internal static class TimeAndDateHelper
|
||||
{
|
||||
inputParsingErrorMsg = Resources.Microsoft_plugin_timedate_InvalidInput_FakeExcel1900;
|
||||
timestamp = new DateTime(1, 1, 1, 1, 1, 1);
|
||||
Logger.LogError($"Failed to parse Excel 1900 date value: '{input}'. Invalid date (0 or 60).");
|
||||
return false;
|
||||
}
|
||||
|
||||
excDate = excDate <= 60 ? excDate + 1 : excDate;
|
||||
timestamp = DateTime.FromOADate(excDate);
|
||||
Logger.LogDebug($"Successfully parsed Excel 1900 date value: '{input}' as {timestamp}");
|
||||
return true;
|
||||
}
|
||||
else if (Regex.IsMatch(input, @"^exf[+-]?\d+[,.0-9]*$"))
|
||||
@@ -275,15 +288,18 @@ internal static class TimeAndDateHelper
|
||||
{
|
||||
inputParsingErrorMsg = string.Format(CultureInfo.CurrentCulture, errorMessage, Resources.Microsoft_plugin_timedate_Excel1904, Excel1904DateMin, Excel1904DateMax);
|
||||
timestamp = new DateTime(1, 1, 1, 1, 1, 1);
|
||||
Logger.LogError($"Failed to parse Excel 1904 date value: '{input}'. Value out of range.");
|
||||
return false;
|
||||
}
|
||||
|
||||
timestamp = DateTime.FromOADate(exfDate + 1462);
|
||||
Logger.LogDebug($"Successfully parsed Excel 1904 date value: '{input}' as {timestamp}");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
timestamp = new DateTime(1, 1, 1, 1, 1, 1);
|
||||
Logger.LogWarning($"Failed to parse input: '{input}'. Format not recognized.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||
<ProjectReference Include="..\..\extensionsdk\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.WebSearch.Helpers;
|
||||
|
||||
@@ -170,6 +171,7 @@ public static class DefaultBrowserInfo
|
||||
if (!_errorLogged)
|
||||
{
|
||||
// Log.Exception("Exception when retrieving browser path/name. Path and Name are set to use Microsoft Edge.", e, typeof(DefaultBrowserInfo));
|
||||
Logger.LogError("Exception when retrieving browser path/name. Path and Name are set to use Microsoft Edge.");
|
||||
_errorLogged = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||
<ProjectReference Include="..\..\extensionsdk\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<None Remove="Assets\WindowWalker.svg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||
<ProjectReference Include="..\..\extensionsdk\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.ServiceProcess;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.WindowsServices.Commands;
|
||||
using Microsoft.CmdPal.Ext.WindowsServices.Properties;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
@@ -147,12 +148,14 @@ public static class ServiceHelper
|
||||
// TODO GH #108 We need to figure out some logging
|
||||
// contextAPI.ShowNotification(GetLocalizedErrorMessage(action), serviceResult.DisplayName);
|
||||
// Log.Error($"The command returned {exitCode}", MethodBase.GetCurrentMethod().DeclaringType);
|
||||
Logger.LogError($"The command returned {exitCode}");
|
||||
}
|
||||
}
|
||||
catch (Win32Exception ex)
|
||||
{
|
||||
// TODO GH #108 We need to figure out some logging
|
||||
// Log.Error(ex.Message, MethodBase.GetCurrentMethod().DeclaringType);
|
||||
Logger.LogError($"Failed to change service '{serviceResult.DisplayName}' status to {action}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
#pragma warning restore IDE0059, CS0168, SA1005
|
||||
@@ -173,6 +176,7 @@ public static class ServiceHelper
|
||||
catch (Exception ex)
|
||||
{
|
||||
// TODO GH #108 We need to figure out some logging
|
||||
Logger.LogError($"Failed to open services.msc: {ex.Message}");
|
||||
}
|
||||
}
|
||||
#pragma warning restore IDE0059, CS0168, SA1005
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<PackageReference Include="System.ServiceProcess.ServiceController" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||
<ProjectReference Include="..\..\extensionsdk\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.ServiceProcess;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.WindowsServices;
|
||||
|
||||
@@ -35,10 +36,11 @@ public class ServiceResult
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
// try to log the exception in the future
|
||||
// retrieve properties from serviceController will throw exception. Such as PlatformNotSupportedException.
|
||||
Logger.LogError($"Failed to create ServiceController: {ex.GetType().Name} - {ex.Message}");
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
|
||||
|
||||
@@ -60,6 +61,7 @@ internal static class JsonSettingsListHelper
|
||||
{
|
||||
// TODO GH #108 Logging is something we have to take care of
|
||||
// Log.Exception("Error loading settings JSON file", exception, typeof(JsonSettingsListHelper));
|
||||
Logger.LogError($"Error loading settings JSON file: {exception.Message}");
|
||||
}
|
||||
#pragma warning restore CS0168
|
||||
return settings ?? new Classes.WindowsSettings();
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.WindowsSettings.Properties;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
|
||||
@@ -36,6 +37,7 @@ internal static class TranslationHelper
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
// Log.Warn($"Resource string for [{settings.Name}] not found", typeof(TranslationHelper));
|
||||
Logger.LogWarning($"Resource string for [{settings.Name}] not found");
|
||||
}
|
||||
|
||||
settings.Name = name ?? settings.Name ?? string.Empty;
|
||||
@@ -48,6 +50,7 @@ internal static class TranslationHelper
|
||||
if (string.IsNullOrEmpty(type))
|
||||
{
|
||||
// Log.Warn($"Resource string for [{settings.Type}] not found", typeof(TranslationHelper));
|
||||
Logger.LogWarning($"Resource string for [{settings.Type}] not found");
|
||||
}
|
||||
|
||||
settings.Type = type ?? settings.Type ?? string.Empty;
|
||||
@@ -69,6 +72,7 @@ internal static class TranslationHelper
|
||||
if (string.IsNullOrEmpty(translatedArea))
|
||||
{
|
||||
// Log.Warn($"Resource string for [{area}] not found", typeof(TranslationHelper));
|
||||
Logger.LogWarning($"Resource string for [{area}] not found");
|
||||
}
|
||||
|
||||
translatedAreas.Add(translatedArea ?? area);
|
||||
@@ -93,6 +97,7 @@ internal static class TranslationHelper
|
||||
if (string.IsNullOrEmpty(translatedAltName))
|
||||
{
|
||||
// Log.Warn($"Resource string for [{altName}] not found", typeof(TranslationHelper));
|
||||
Logger.LogWarning($"Resource string for [{altName}] not found");
|
||||
}
|
||||
|
||||
translatedAltNames.Add(translatedAltName ?? altName);
|
||||
@@ -108,6 +113,7 @@ internal static class TranslationHelper
|
||||
if (string.IsNullOrEmpty(note))
|
||||
{
|
||||
// Log.Warn($"Resource string for [{settings.Note}] not found", typeof(TranslationHelper));
|
||||
Logger.LogWarning($"Resource string for [{settings.Note}] not found");
|
||||
}
|
||||
|
||||
settings.Note = note ?? settings.Note ?? string.Empty;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
|
||||
|
||||
@@ -40,6 +41,7 @@ internal static class UnsupportedSettingsHelper
|
||||
|
||||
// TODO GH #108 Logging is something we have to take care of
|
||||
// Log.Warn(warningMessage, typeof(UnsupportedSettingsHelper));
|
||||
Logger.LogWarning(warningMessage);
|
||||
}
|
||||
|
||||
var currentWindowsBuild = currentBuild != uint.MinValue
|
||||
@@ -71,12 +73,9 @@ internal static class UnsupportedSettingsHelper
|
||||
{
|
||||
registryValueData = Win32.Registry.GetValue(registryKey, valueName, uint.MinValue);
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Log.Exception(
|
||||
// $"Can't get registry value for '{valueName}'",
|
||||
// exception,
|
||||
// typeof(UnsupportedSettingsHelper));
|
||||
Logger.LogError($"Can't get registry value for '{valueName}' - {ex.Message}");
|
||||
return uint.MinValue;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Linq;
|
||||
using ManagedCommon;
|
||||
|
||||
namespace Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
|
||||
|
||||
@@ -34,6 +35,7 @@ internal static class WindowsSettingsPathHelper
|
||||
{
|
||||
// TODO GH #108 Logging is something we have to take care of
|
||||
// Log.Warn($"The type property is not set for setting [{settings.Name}] in json. Skipping generating of settings path.", typeof(WindowsSettingsPathHelper));
|
||||
Logger.LogWarning($"The type property is not set for setting [{settings.Name}] in json. Skipping generating of settings path.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -41,12 +43,14 @@ internal static class WindowsSettingsPathHelper
|
||||
if (!string.IsNullOrEmpty(settings.JoinedAreaPath))
|
||||
{
|
||||
// Log.Debug($"The property [JoinedAreaPath] of setting [{settings.Name}] was filled from the json. This value is not used and will be overwritten.", typeof(WindowsSettingsPathHelper));
|
||||
Logger.LogDebug($"The property [JoinedAreaPath] of setting [{settings.Name}] was filled from the json. This value is not used and will be overwritten.");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(settings.JoinedFullSettingsPath))
|
||||
{
|
||||
// TODO GH #108 Logging is something we have to take care of
|
||||
// Log.Debug($"The property [JoinedFullSettingsPath] of setting [{settings.Name}] was filled from the json. This value is not used and will be overwritten.", typeof(WindowsSettingsPathHelper));
|
||||
Logger.LogDebug($"The property [JoinedFullSettingsPath] of setting [{settings.Name}] was filled from the json. This value is not used and will be overwritten.");
|
||||
}
|
||||
|
||||
// Generating path values.
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<PackageReference Include="System.ServiceProcess.ServiceController" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||
<ProjectReference Include="..\..\extensionsdk\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using System.Resources;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.WindowsTerminal.Helpers;
|
||||
using Microsoft.CmdPal.Ext.WindowsTerminal.Properties;
|
||||
using Microsoft.CommandPalette.Extensions;
|
||||
@@ -60,6 +61,7 @@ internal sealed partial class LaunchProfileAsAdminCommand : InvokableCommand
|
||||
//var message = Resources.run_terminal_failed;
|
||||
//Log.Exception("Failed to open Windows Terminal", ex, GetType());
|
||||
//_context.API.ShowMsg(name, message, string.Empty);
|
||||
Logger.LogError($"Failed to open Windows Terminal: {ex.Message}");
|
||||
}
|
||||
}
|
||||
#pragma warning restore IDE0059, CS0168, SA1005
|
||||
@@ -81,6 +83,7 @@ internal sealed partial class LaunchProfileAsAdminCommand : InvokableCommand
|
||||
// var message = Resources.run_terminal_failed;
|
||||
// Log.Exception("Failed to open Windows Terminal", ex, GetType());
|
||||
// _context.API.ShowMsg(name, message, string.Empty);
|
||||
Logger.LogError($"Failed to open Windows Terminal: {ex.Message}");
|
||||
}
|
||||
}
|
||||
#pragma warning restore IDE0059, CS0168
|
||||
@@ -94,6 +97,7 @@ internal sealed partial class LaunchProfileAsAdminCommand : InvokableCommand
|
||||
catch
|
||||
{
|
||||
// TODO GH #108 We need to figure out some logging
|
||||
// No need to log here, as the exception is already logged in LaunchElevated
|
||||
}
|
||||
|
||||
return CommandResult.Dismiss();
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using System.Resources;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Ext.WindowsTerminal.Helpers;
|
||||
using Microsoft.CmdPal.Ext.WindowsTerminal.Properties;
|
||||
using Microsoft.CommandPalette.Extensions;
|
||||
@@ -52,6 +53,7 @@ internal sealed partial class LaunchProfileCommand : InvokableCommand
|
||||
// var message = Resources.run_terminal_failed;
|
||||
// Log.Exception("Failed to open Windows Terminal", ex, GetType());
|
||||
// _context.API.ShowMsg(name, message, string.Empty);
|
||||
Logger.LogError($"Failed to open Windows Terminal: {ex.Message}");
|
||||
}
|
||||
}
|
||||
#pragma warning restore IDE0059, CS0168
|
||||
@@ -65,6 +67,7 @@ internal sealed partial class LaunchProfileCommand : InvokableCommand
|
||||
catch
|
||||
{
|
||||
// TODO GH #108 We need to figure out some logging
|
||||
// No need to log here, as the exception is already logged in the Launch method
|
||||
}
|
||||
|
||||
return CommandResult.Dismiss();
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
|
||||
using ManagedCommon;
|
||||
using Windows.Management.Deployment;
|
||||
|
||||
// using Wox.Plugin.Logger;
|
||||
@@ -41,6 +41,7 @@ public class TerminalQuery : ITerminalQuery
|
||||
{
|
||||
// TODO: what kind of logging should we do?
|
||||
// Log.Warn($"No Windows Terminal packages installed", typeof(TerminalQuery));
|
||||
Logger.LogWarning("No Windows Terminal packages installed");
|
||||
}
|
||||
|
||||
foreach (var terminal in Terminals)
|
||||
@@ -49,6 +50,7 @@ public class TerminalQuery : ITerminalQuery
|
||||
{
|
||||
// TODO: what kind of logging should we do?
|
||||
// Log.Warn($"Failed to find settings file {terminal.SettingsPath}", typeof(TerminalQuery));
|
||||
Logger.LogWarning($"Failed to find settings file {terminal.SettingsPath}");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<None Remove="Assets\WindowsTerminal.svg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||
<ProjectReference Include="..\..\extensionsdk\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using ManagedCommon;
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
|
||||
// using Wox.Infrastructure.Image;
|
||||
@@ -43,6 +44,7 @@ public class TerminalPackage
|
||||
{
|
||||
// Not using wox anymore, TODO: find the right new way to handle this
|
||||
// image.UriSource = new Uri(ImageLoader.ErrorIconPath);
|
||||
Logger.LogError($"Logo file not found: {LogoPath}");
|
||||
}
|
||||
|
||||
return image;
|
||||
|
||||
Reference in New Issue
Block a user