Merge pull request #38 from zadjii-msft/dev/crutkas/additionalCleanup

Dev/crutkas/additional cleanup
This commit is contained in:
Clint Rutkas
2024-09-05 10:14:59 -07:00
committed by GitHub
6 changed files with 28 additions and 26 deletions

View File

@@ -12,8 +12,8 @@ namespace AllApps.Programs;
public interface IAppxFactory
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "Implements COM Interface")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Forced by system")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Forced by system")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Implements COM Interface")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Implements COM Interface")]
void _VtblGap0_2(); // skip 2 methods
internal IAppxManifestReader CreateManifestReader(IStream inputStream);

View File

@@ -12,15 +12,15 @@ namespace AllApps.Programs;
public interface IAppxManifestReader
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "Implements COM Interface")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "<Pending>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Implements COM Interface")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Implements COM Interface")]
void _VtblGap0_1(); // skip 1 method
IAppxManifestProperties GetProperties();
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "Implements COM Interface")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "<Pending>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Implements COM Interface")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Implements COM Interface")]
void _VtblGap1_5(); // skip 5 methods
IAppxManifestApplicationsEnumerator GetApplications();

View File

@@ -37,7 +37,7 @@ public class ShellLinkHelper : IShellLinkHelper
}
[Flags]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "<Pending>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Implements COM Interface")]
public enum SLR_FLAGS
{
SLR_NO_UI = 0x1,

View File

@@ -116,8 +116,9 @@ public class ExtensionService : IExtensionService, IDisposable
{
if (package.Id?.FullName == extension.Package?.Id?.FullName)
{
var (CmdPalProvider, classId) = await GetCmdPalExtensionPropertiesAsync(extension);
return CmdPalProvider != null && classId.Count != 0;
var (cmdPalProvider, classId) = await GetCmdPalExtensionPropertiesAsync(extension);
return cmdPalProvider != null && classId.Count != 0;
}
}
@@ -134,22 +135,22 @@ public class ExtensionService : IExtensionService, IDisposable
return (null, classIds);
}
var CmdPalProvider = GetSubPropertySet(properties, "CmdPalProvider");
if (CmdPalProvider is null)
var cmdPalProvider = GetSubPropertySet(properties, "CmdPalProvider");
if (cmdPalProvider is null)
{
return (null, classIds);
}
var activation = GetSubPropertySet(CmdPalProvider, "Activation");
var activation = GetSubPropertySet(cmdPalProvider, "Activation");
if (activation is null)
{
return (CmdPalProvider, classIds);
return (cmdPalProvider, classIds);
}
// Handle case where extension creates multiple instances.
classIds.AddRange(GetCreateInstanceList(activation));
return (CmdPalProvider, classIds);
return (cmdPalProvider, classIds);
}
private static async Task<IEnumerable<AppExtension>> GetInstalledAppExtensionsAsync()

View File

@@ -10,11 +10,11 @@ namespace WindowsCommandPalette.Views;
public sealed partial class DetailsControl : UserControl
{
private readonly DetailsViewModel ViewModel;
public DetailsViewModel ViewModel { get; set; }
public DetailsControl(DetailsViewModel vm)
{
this.ViewModel = vm;
this.InitializeComponent();
ViewModel = vm;
InitializeComponent();
}
}

View File

@@ -18,26 +18,26 @@ namespace WindowsCommandPalette.Views;
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class ListPage : Page, System.ComponentModel.INotifyPropertyChanged
public sealed partial class ListPage : Page, INotifyPropertyChanged
{
private ListPageViewModel? ViewModel;
public ListPageViewModel? ViewModel { get; set; }
public event PropertyChangedEventHandler? PropertyChanged;
private ListItemViewModel? _SelectedItem;
private ListItemViewModel? _selectedItem;
public ListItemViewModel? SelectedItem
{
get => _SelectedItem;
get => _selectedItem;
set
{
_SelectedItem = value;
PropertyChanged?.Invoke(this, new System.ComponentModel.PropertyChangedEventArgs(nameof(SelectedItem)));
PropertyChanged?.Invoke(this, new System.ComponentModel.PropertyChangedEventArgs(nameof(MoreCommandsAvailable)));
_selectedItem = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectedItem)));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(MoreCommandsAvailable)));
if (ViewModel != null && _SelectedItem?.Details != null && ViewModel.Page.ShowDetails)
if (ViewModel != null && _selectedItem?.Details != null && ViewModel.Page.ShowDetails)
{
this.DetailsContent.Child = new DetailsControl(_SelectedItem.Details);
this.DetailsContent.Child = new DetailsControl(_selectedItem.Details);
this.DetailsContent.Visibility = Visibility.Visible;
this.DetailsColumn.Width = new GridLength(2, GridUnitType.Star);
}
@@ -125,6 +125,7 @@ public sealed partial class ListPage : Page, System.ComponentModel.INotifyProper
{
ShowMode = FlyoutShowMode.Standard,
};
MoreCommandsButton.Flyout.ShowAt(MoreCommandsButton, options);
ActionsDropdown.SelectedIndex = 0;
ActionsDropdown.Focus(FocusState.Programmatic);