Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ActionItemsEventArgs.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 namespace SiliconStudio.ActionStack
6 {
7  /// <summary>
8  /// Base class for action stack events arguments.
9  /// </summary>
10  /// <typeparam name="T">The type of <see cref="IActionItem"/> related to this event.</typeparam>
11  public class ActionItemsEventArgs<T> : EventArgs where T : class, IActionItem
12  {
13  /// <summary>
14  /// Gets the array of <see cref="IActionItem"/> related to this event.
15  /// </summary>
16  public T[] ActionItems { get; private set; }
17 
18  /// <summary>
19  /// Initializes a new instance of the <see cref="ActionItemsEventArgs{T}"/> with a single item.
20  /// </summary>
21  /// <param name="actionItem">The action item related to this event.</param>
22  public ActionItemsEventArgs(T actionItem)
23  : this(new[] { actionItem })
24  {
25  }
26 
27  /// <summary>
28  /// Initializes a new instance of the <see cref="ActionItemsEventArgs{T}"/> with an array of action items.
29  /// </summary>
30  /// <param name="actionItems">The action items related to this event.</param>
31  public ActionItemsEventArgs(T[] actionItems)
32  {
33  if (actionItems == null)
34  throw new ArgumentNullException("actionItems");
35 
36  ActionItems = actionItems;
37  }
38  }
39 }
ActionItemsEventArgs(T[] actionItems)
Initializes a new instance of the ActionItemsEventArgs{T} with an array of action items...
Base interface for action items.
Definition: IActionItem.cs:10
ActionItemsEventArgs(T actionItem)
Initializes a new instance of the ActionItemsEventArgs{T} with a single item.