Adds OnLoad and OnUnload methods to the credential provider and tile

This commit is contained in:
Ryan Newington
2024-01-07 14:32:56 +11:00
parent 6f9fecb137
commit 65506d9945
4 changed files with 29 additions and 0 deletions
@@ -60,6 +60,8 @@ namespace Lithnet.CredentialProvider
Marshal.AddRef(intPtr);
}
this.OnLoad();
return HRESULT.S_OK;
}
catch (Exception ex)
@@ -83,6 +85,8 @@ namespace Lithnet.CredentialProvider
this.credentialProviderEventsAdviseContext = IntPtr.Zero;
}
this.OnUnload();
return HRESULT.S_OK;
}
catch (Exception ex)
@@ -174,6 +174,16 @@ namespace Lithnet.CredentialProvider
/// <param name="inboundSerialization">The inbound serialized credential </param>
public virtual void OnSetSerialization(CredentialSerialization inboundSerialization) { }
/// <summary>
/// This method is first called when the credential provider is initialized. Override this method to perform any initialization tasks
/// </summary>
public virtual void OnLoad() { }
/// <summary>
/// The method is called when the credential provider is being unloaded. Override this method to perform any cleanup tasks
/// </summary>
public virtual void OnUnload() { }
private void BuildControls()
{
if (this.Controls == null)
@@ -22,6 +22,8 @@ namespace Lithnet.CredentialProvider
Marshal.AddRef(intPtr);
}
this.OnLoad();
return HRESULT.S_OK;
}
catch (Exception ex)
@@ -45,6 +47,8 @@ namespace Lithnet.CredentialProvider
this.events = null;
}
this.OnUnload();
return HRESULT.S_OK;
}
catch (Exception ex)
@@ -135,6 +135,17 @@ namespace Lithnet.CredentialProvider
this.events2.EndFieldUpdates();
}
/// <summary>
/// This method is called when the credential provider tile is initialized. Override this method to perform any initialization tasks
/// </summary>
public virtual void OnLoad() { }
/// <summary>
/// The method is called when the credential provider tile is being unloaded. Override this method to perform any cleanup tasks
/// </summary>
public virtual void OnUnload() { }
/// <summary>
/// Called after the tile has been initialized. Override this method to perform post-initialization actions.
/// </summary>