コード例 #1
0
        public void NullEventHandlerValue()
        {
            EventValues eventValues = new EventValues();

            eventValues.AddAll(null);
            Assert.AreEqual(0, eventValues.Events.Count);
        }
コード例 #2
0
        public void OneEventValue()
        {
            EventValues eventValues = new EventValues();

            eventValues.AddHandler(new MyEventHandler());
            Assert.AreEqual(1, eventValues.Events.Count);
        }
コード例 #3
0
        public void CopyEventHandlerValues()
        {
            EventValues eventValues = new EventValues();

            eventValues.AddHandler(new MyEventHandler());
            eventValues.AddHandler(new MyEventHandler());
            Assert.AreEqual(1, eventValues.Events.Count);
            EventValues eventValues2 = new EventValues(eventValues);

            Assert.AreEqual(1, eventValues2.Events.Count);
        }
コード例 #4
0
 /// <summary>
 /// Copy all given argument values into this object.
 /// </summary>
 /// <param name="other">
 /// The <see cref="Oragon.Spring.Objects.Factory.Config.EventValues"/>
 /// to be used to populate this instance.
 /// </param>
 public void AddAll(EventValues other)
 {
     if (other != null)
     {
         foreach (IList handlers in other.EventHandlers.Values)
         {
             foreach (IEventHandlerValue handler in handlers)
             {
                 AddHandler(handler);
             }
         }
     }
 }
コード例 #5
0
        public void EmptyEventValues()
        {
            EventValues eventValues = new EventValues();

            Assert.AreEqual(0, eventValues.Events.Count);
        }
コード例 #6
0
 /// <summary>
 /// Creates a new instance of the
 /// <see cref="Oragon.Spring.Objects.Factory.Config.EventValues"/> class.
 /// </summary>
 /// <param name="other">
 /// The <see cref="Oragon.Spring.Objects.Factory.Config.EventValues"/>
 /// to be used to populate this instance.
 /// </param>
 public EventValues(EventValues other)
 {
     AddAll(other);
 }