private void AfterAccessNotification(TokenCacheNotificationArgs args)
{
lock (@lock)
{
if (File.Exists(_cacheFilePath) && this.HasStateChanged)
{
try
{
byte[] state = this.Serialize();
byte[] data = ProtectedData.Protect(state, null, DataProtectionScope.CurrentUser);
File.WriteAllBytes(_cacheFilePath, data);
this.HasStateChanged = false;
}
catch (Exception exception)
{
Git.Trace.WriteLine($"! {exception.Message}");
}
}
}
}