private static UpdateAction <ManageableMarketDataSnapshot> PrepareSurfaceAddAction(VolatilitySurfaceKey key, ManageableVolatilitySurfaceSnapshot value)
        {
            var valueClone = value.Clone();

            return(new UpdateAction <ManageableMarketDataSnapshot>(
                       delegate(ManageableMarketDataSnapshot snap)
            {
                snap._volatilitySurfaces.Add(key, valueClone.Clone());
                snap.InvokePropertyChanged(new PropertyChangedEventArgs("VolatilitySurfaces"));
            }
                       ));
        }
 private static UpdateAction <ManageableMarketDataSnapshot> PrepareSurfaceRemoveAction(VolatilitySurfaceKey volatilitySurfaceKey, ManageableVolatilitySurfaceSnapshot manageableVolatilitySurfaceSnapshot)
 {
     return(new UpdateAction <ManageableMarketDataSnapshot>(
                delegate(ManageableMarketDataSnapshot snap)
     {
         snap._volatilitySurfaces.Remove(volatilitySurfaceKey);
         snap.InvokePropertyChanged(new PropertyChangedEventArgs("VolatilitySurfaces"));
     },
                OverriddenVolatilitySurfaceDisappearingWarning.Of(volatilitySurfaceKey, manageableVolatilitySurfaceSnapshot)
                ));
 }
Exemple #3
0
 public static IEnumerable <Warning> Of(VolatilitySurfaceKey key, ManageableVolatilitySurfaceSnapshot value)
 {
     return(value.HaveOverrides() ? new Warning[] { new OverriddenVolatilitySurfaceDisappearingWarning(key) } : new Warning[] { });
 }
Exemple #4
0
 private OverriddenVolatilitySurfaceDisappearingWarning(VolatilitySurfaceKey key)
     : base(string.Format("Volatility Surface {0} will not be present in the new snapshot, overrides will be lost", key))
 {
 }
Exemple #5
0
 private OverriddenVolatilitySurfaceDisappearingWarning(VolatilitySurfaceKey key)
     : base(string.Format("Volatility Surface {0} will not be present in the new snapshot, overrides will be lost", key))
 {
 }
Exemple #6
0
 public static IEnumerable<Warning> Of(VolatilitySurfaceKey key, ManageableVolatilitySurfaceSnapshot value)
 {
     return value.HaveOverrides() ? new Warning[] { new OverriddenVolatilitySurfaceDisappearingWarning(key) } : new Warning[] { };
 }