Example #1
0
 public override void setPricer(FloatingRateCouponPricer pricer)
 {
     if (pricer_ != null)
     {
         pricer_.unregisterWith(update);
     }
     pricer_ = pricer;
     if (pricer_ != null)
     {
         pricer_.registerWith(update);
     }
     update();
     underlying_.setPricer(pricer);
 }
        public virtual void setPricer(FloatingRateCouponPricer pricer)
        {
            if (pricer_ != null) // remove from the old observable
            {
                pricer_.unregisterWith(update);
            }

            pricer_ = pricer;

            if (pricer_ != null)
            {
                pricer_.registerWith(update);  // add to observers of new pricer
            }
            update();                          // fire the change event to notify observers of this
        }