From a54a11e42c822de23b8a50f080a9bde91facc61d Mon Sep 17 00:00:00 2001 From: Scordo Date: Sun, 16 Oct 2016 09:12:31 +0200 Subject: [PATCH] Added notification: notifyserveredited --- .../TS3QueryLib.Core.Framework.csproj | 3 + .../EventArgs/ServerEditedEventArgs.cs | 65 +++++++++++++++++++ .../Server/Notification/Notifications.cs | 12 ++++ .../TS3QueryLib.Core.Silverlight.csproj | 1 + .../TS3QueryLib.Core.WP7.csproj | 3 + 5 files changed, 84 insertions(+) create mode 100644 TS3QueryLib.Core.Silverlight/Server/Notification/EventArgs/ServerEditedEventArgs.cs diff --git a/TS3QueryLib.Core.Framework/TS3QueryLib.Core.Framework.csproj b/TS3QueryLib.Core.Framework/TS3QueryLib.Core.Framework.csproj index 1428c09..ea8ea09 100644 --- a/TS3QueryLib.Core.Framework/TS3QueryLib.Core.Framework.csproj +++ b/TS3QueryLib.Core.Framework/TS3QueryLib.Core.Framework.csproj @@ -365,6 +365,9 @@ Server\Notification\EventArgs\MessageReceivedEventArgs.cs + + Server\Notification\EventArgs\ServerEditedEventArgs.cs + Server\Notification\EventArgs\TokenUsedEventArgs.cs diff --git a/TS3QueryLib.Core.Silverlight/Server/Notification/EventArgs/ServerEditedEventArgs.cs b/TS3QueryLib.Core.Silverlight/Server/Notification/EventArgs/ServerEditedEventArgs.cs new file mode 100644 index 0000000..37ecf5f --- /dev/null +++ b/TS3QueryLib.Core.Silverlight/Server/Notification/EventArgs/ServerEditedEventArgs.cs @@ -0,0 +1,65 @@ +using System; +using TS3QueryLib.Core.CommandHandling; +using TS3QueryLib.Core.Common; +using TS3QueryLib.Core.Server.Responses; + +namespace TS3QueryLib.Core.Server.Notification.EventArgs +{ + public class ServerEditedEventArgs : System.EventArgs, IDump + { + #region Properties + + public uint ReasonId { get; protected set; } + public uint InvokerId { get; protected set; } + public string InvokerName { get; protected set; } + public string InvokerUniqueId { get; protected set; } + + public string Name { get; set; } + public uint? DefaultServerGroupId { get; set; } + public uint? DefaultChannelGroupId { get; set; } + public double? PrioritySpeakerDimmModification { get; set; } + public string HostBannerUrl { get; set; } + public string HostBannerGraphicsUrl { get; set; } + public uint? HostBannerGraphicsInterval { get; set; } + public string HostButtonGraphicsUrl { get; set; } + public string HostButtonTooltip { get; set; } + public string HostButtonUrl { get; set; } + public HostBannerMode? HostBannerMode { get; set; } + + public string PhoneticName { get; set; } + public uint? IconId { get; set; } + + #endregion + + #region Constructors + + + public ServerEditedEventArgs(CommandParameterGroupList commandParameterGroupList) + { + if (commandParameterGroupList == null) + throw new ArgumentNullException(nameof(commandParameterGroupList)); + + ReasonId = commandParameterGroupList.GetParameterValue("reasonid"); + InvokerId = commandParameterGroupList.GetParameterValue("invokerid"); + InvokerName = commandParameterGroupList.GetParameterValue("invokername"); + InvokerUniqueId = commandParameterGroupList.GetParameterValue("invokeruid"); + + Name = commandParameterGroupList.GetParameterValue("virtualserver_name"); + DefaultServerGroupId = commandParameterGroupList.GetParameterValue("virtualserver_default_server_group"); + DefaultChannelGroupId = commandParameterGroupList.GetParameterValue("virtualserver_default_channel_group"); + HostBannerUrl = commandParameterGroupList.GetParameterValue("virtualserver_hostbanner_url"); + HostBannerGraphicsUrl = commandParameterGroupList.GetParameterValue("virtualserver_hostbanner_gfx_url"); + + HostBannerGraphicsInterval = commandParameterGroupList.GetParameterValue("virtualserver_hostbanner_gfx_interval"); + PrioritySpeakerDimmModification = commandParameterGroupList.GetParameterValue("virtualserver_priority_speaker_dimm_modificator"); + HostButtonTooltip = commandParameterGroupList.GetParameterValue("virtualserver_hostbutton_tooltip"); + HostButtonUrl = commandParameterGroupList.GetParameterValue("virtualserver_hostbutton_url"); + PhoneticName = commandParameterGroupList.GetParameterValue("virtualserver_name_phonetic"); + IconId = commandParameterGroupList.GetParameterValue("virtualserver_icon_id"); + HostButtonGraphicsUrl = commandParameterGroupList.GetParameterValue("virtualserver_hostbutton_gfx_url"); + HostBannerMode = (HostBannerMode?)commandParameterGroupList.GetParameterValue("virtualserver_hostbanner_mode"); + } + + #endregion + } +} \ No newline at end of file diff --git a/TS3QueryLib.Core.Silverlight/Server/Notification/Notifications.cs b/TS3QueryLib.Core.Silverlight/Server/Notification/Notifications.cs index e763a20..7003f39 100644 --- a/TS3QueryLib.Core.Silverlight/Server/Notification/Notifications.cs +++ b/TS3QueryLib.Core.Silverlight/Server/Notification/Notifications.cs @@ -94,6 +94,11 @@ public class Notifications : NotificationsBase /// public event EventHandler ChannelDeleted; + /// + /// Raised, when the current server was edited + /// + public event EventHandler ServerEdited; + /// /// Raised, when a unknown notification was received /// @@ -127,6 +132,7 @@ protected override Dictionary> GetNoti { "notifychannelpasswordchanged", HandleChannelPasswordChanged }, { "notifychannelcreated", HandleChannelCreated }, { "notifychanneldeleted", HandleChannelDeleted }, + { "notifyserveredited", HandleServerEdited }, { "*", HandleUnknownNotificationReceived }, }; } @@ -255,6 +261,12 @@ private void HandleChannelDeleted(CommandParameterGroupList parameterGroupList) ThreadPool.QueueUserWorkItem(x => ChannelDeleted(this, new ChannelDeletedEventArgs(parameterGroupList)), null); } + private void HandleServerEdited(CommandParameterGroupList parameterGroupList) + { + if (ServerEdited != null) + ThreadPool.QueueUserWorkItem(x => ServerEdited(this, new ServerEditedEventArgs(parameterGroupList)), null); + } + private void HandleUnknownNotificationReceived(CommandParameterGroupList parameterGroupList) { if (UnknownNotificationReceived != null) diff --git a/TS3QueryLib.Core.Silverlight/TS3QueryLib.Core.Silverlight.csproj b/TS3QueryLib.Core.Silverlight/TS3QueryLib.Core.Silverlight.csproj index 1b696e2..3a2ae44 100644 --- a/TS3QueryLib.Core.Silverlight/TS3QueryLib.Core.Silverlight.csproj +++ b/TS3QueryLib.Core.Silverlight/TS3QueryLib.Core.Silverlight.csproj @@ -145,6 +145,7 @@ + diff --git a/TS3QueryLib.Core.WP7/TS3QueryLib.Core.WP7.csproj b/TS3QueryLib.Core.WP7/TS3QueryLib.Core.WP7.csproj index 605a9b3..d05c5dc 100644 --- a/TS3QueryLib.Core.WP7/TS3QueryLib.Core.WP7.csproj +++ b/TS3QueryLib.Core.WP7/TS3QueryLib.Core.WP7.csproj @@ -399,6 +399,9 @@ Server\Notification\EventArgs\MessageReceivedEventArgs.cs + + Server\Notification\EventArgs\ServerEditedEventArgs.cs + Server\Notification\EventArgs\TokenUsedEventArgs.cs