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 ManageableVolatilitySurfaceSnapshot Subtract(ManageableVolatilitySurfaceSnapshot a, ManageableVolatilitySurfaceSnapshot b) { return(new ManageableVolatilitySurfaceSnapshot(Subtract(a.Values, b.Values))); }
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) )); }