Public Access
30 lines
943 B
C#
30 lines
943 B
C#
namespace MeetingAssistant.Recording;
|
|
|
|
internal static class NotificationActivationArguments
|
|
{
|
|
public static IReadOnlyDictionary<string, string> Parse(string argumentText)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(argumentText))
|
|
{
|
|
return new Dictionary<string, string>();
|
|
}
|
|
|
|
var arguments = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
foreach (var pair in argumentText.Split(['&', ';'], StringSplitOptions.RemoveEmptyEntries))
|
|
{
|
|
var separatorIndex = pair.IndexOf('=');
|
|
if (separatorIndex < 0)
|
|
{
|
|
arguments[Uri.UnescapeDataString(pair)] = "";
|
|
continue;
|
|
}
|
|
|
|
var key = Uri.UnescapeDataString(pair[..separatorIndex]);
|
|
var value = Uri.UnescapeDataString(pair[(separatorIndex + 1)..]);
|
|
arguments[key] = value;
|
|
}
|
|
|
|
return arguments;
|
|
}
|
|
}
|