Skip to content

Commit 1c897d0

Browse files
committed
#32 Fixed order of channel ids
1 parent 445b738 commit 1c897d0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

TS3QueryLib.Core.Silverlight/Server/Notification/EventArgs/ChannelDeletedEventArgs.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ public ChannelDeletedEventArgs(CommandParameterGroupList commandParameterGroupLi
2525
if (commandParameterGroupList == null)
2626
throw new ArgumentNullException(nameof(commandParameterGroupList));
2727

28-
ChannelId = commandParameterGroupList.GetParameterValue<int?>("cid");
28+
List<int> channelIds = commandParameterGroupList.Select(pg => pg.GetParameterValue<int>("cid")).ToList();
29+
30+
ChannelId = channelIds.Count > 0 ? (int?)channelIds.Last() : null;
2931
InvokerId = commandParameterGroupList.GetParameterValue<int?>("invokerid");
3032
InvokerName = commandParameterGroupList.GetParameterValue<string>("invokername");
3133

32-
SubChannelIdList = commandParameterGroupList.Skip(1).Select(pg => pg.GetParameterValue<int>("cid")).ToList();
34+
SubChannelIdList = channelIds.GetRange(0, Math.Max(0, channelIds.Count - 1));
3335
}
3436

3537
#endregion

0 commit comments

Comments
 (0)