Ejemplo n.º 1
0
        private void OnComponentConfigurationListChanged(object sender,
                                                         BuildListEventArgs <BuildComponentConfiguration> e)
        {
            if (_multiMap == null)
            {
                _multiMap =
                    new BuildMultiSet <string, BuildComponentConfiguration>();
            }

            switch (e.ChangeType)
            {
            case BuildListChangeType.Added:
                BuildComponentConfiguration addedItem = e.ChangedItem;
                _multiMap.Add(addedItem.ComponentName, addedItem);
                break;

            case BuildListChangeType.Removed:
                BuildComponentConfiguration removedItem = e.ChangedItem;
                _multiMap.Remove(removedItem.ComponentName, removedItem);
                break;

            case BuildListChangeType.Replaced:
                BuildComponentConfiguration changedItem      = e.ChangedItem;
                BuildComponentConfiguration replacedWithItem = e.ReplacedWith;
                _multiMap.Remove(changedItem.ComponentName, changedItem);
                _multiMap.Add(replacedWithItem.ComponentName, replacedWithItem);
                break;

            case BuildListChangeType.Cleared:
                _multiMap.Clear();
                break;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// This raises the collection changed event with the specified event
 /// information
 /// </summary>
 /// <param name="e">
 /// The <see cref="BuildListEventArgs{T}"/> specifying the event
 /// information.
 /// </param>
 protected virtual void FireChanged(BuildListEventArgs <T> e)
 {
     if (Changed != null)
     {
         Changed(this, e);
     }
 }