Add ReloadUserTiles method and update IsAutoLogon property

- Added ReloadUserTiles method to CredentialProviderBase to notify LogonUI of tile modifications.
- Introduced private field isAutoLogon in CredentialTile.
- Updated IsAutoLogon property in CredentialTile to use a backing field and call ReloadUserTiles on set.
- Corrected typo in XML documentation for CreateParentWindowHwnd method.
This commit is contained in:
Ryan Newington
2024-10-17 07:41:11 +11:00
parent 4f78753016
commit 2e9e21aee6
2 changed files with 20 additions and 2 deletions
@@ -115,6 +115,14 @@ namespace Lithnet.CredentialProvider
/// </summary>
public abstract bool ShouldIncludeGenericTile();
/// <summary>
/// Notifies LogonUI that one of more of the tile items has been modified, and should be reloaded
/// </summary>
public void ReloadUserTiles()
{
this.NotifyHostOfTileCollectionChange();
}
/// <summary>
/// Adds additional user tiles to the collection, and notifies LogonUI that new tiles are available
/// </summary>
@@ -15,6 +15,7 @@ namespace Lithnet.CredentialProvider
private protected ICredentialProviderCredentialEvents2 events2;
private protected ControlCollection controls;
private bool isAutoLogon;
protected CredentialTile(CredentialProviderBase credentialProvider)
{
@@ -37,7 +38,16 @@ namespace Lithnet.CredentialProvider
/// <summary>
/// Gets a value that indicates if the user should be automatically logged on when the tile is selected. The tile must also have IsDefault set to true.
/// </summary>
public bool IsAutoLogon { get; set; }
public bool IsAutoLogon
{
get => this.isAutoLogon;
set
{
this.isAutoLogon = value;
this.CredentialProvider.ReloadUserTiles();
}
}
/// <summary>
/// Gets a value indicating if this should be the default time
@@ -87,7 +97,7 @@ namespace Lithnet.CredentialProvider
/// Gets the HWND of the parent of the credential provider, and notifies LogonUI or CredUI that we need to create a Window
/// </summary>
/// <returns>A HWND to the parentobject</returns>
/// <exception cref="InvalidOperationException">The method was called before the host has advised that is ready to rpovide events</exception>
/// <exception cref="InvalidOperationException">The method was called before the host has advised that is ready to provide events</exception>
/// <exception cref="COMException">The request to obtain the parent window HWND failed</exception>
public IntPtr CreateParentWindowHwnd()
{