mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Made notifications work again, activation doesn't work yet due to missing ToastActivatorCLSID on the shortcut.
This commit is contained in:
parent
a29f6faa27
commit
f206046010
11 changed files with 392 additions and 269 deletions
35
GreenshotWin10Plugin/Native/NotificationActivator.cs
Normal file
35
GreenshotWin10Plugin/Native/NotificationActivator.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// ******************************************************************
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// This code is licensed under the MIT License (MIT).
|
||||
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
|
||||
// ******************************************************************
|
||||
|
||||
using GreenshotWin10Plugin.Native.Structs;
|
||||
|
||||
namespace GreenshotWin10Plugin.Native
|
||||
{
|
||||
/// <summary>
|
||||
/// Apps must implement this activator to handle notification activation.
|
||||
/// </summary>
|
||||
public abstract class NotificationActivator : INotificationActivationCallback
|
||||
{
|
||||
public void Activate(string appUserModelId, string invokedArgs, NotificationUserInputData[] data, uint dataCount)
|
||||
{
|
||||
OnActivated(invokedArgs, new NotificationUserInput(data), appUserModelId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method will be called when the user clicks on a foreground or background activation on a toast. Parent app must implement this method.
|
||||
/// </summary>
|
||||
/// <param name="arguments">The arguments from the original notification. This is either the launch argument if the user clicked the body of your toast, or the arguments from a button on your toast.</param>
|
||||
/// <param name="userInput">Text and selection values that the user entered in your toast.</param>
|
||||
/// <param name="appUserModelId">Your AUMID.</param>
|
||||
public abstract void OnActivated(string arguments, NotificationUserInput userInput, string appUserModelId);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue