public void Add(TypedDataType key, ICommand value) { if (value == null) { throw new ArgumentNullException("value"); } Routes.Add(key, value); }
/// <summary> /// Initializes a new instance of the <see cref="TypedData"/> class. /// </summary> /// <param name="dataType">Type of the data.</param> /// <param name="data">The data with the type described by <paramref name="dataType"/>.</param> /// <param name="name">The name of the data.</param> /// <exception cref="ArgumentNullException"><paramref name="data"/> is null.</exception> /// <exception cref="ArgumentNullException"><paramref name="name"/> is null.</exception> public TypedData(TypedDataType dataType, object data, string name) { if (data == null && dataType != TypedDataType.None) { throw new ArgumentNullException("data"); } if (name == null) { throw new ArgumentNullException("name"); } DataType = dataType; Data = data; Name = name; }