// ********************************************************************** public static void Deactivate() { foreach (IConnector connector in connectors) { IStockProvider sp = connector as IStockProvider; if (sp != null) { sp.Unsubscribe(); } ITicksProvider tp = connector as ITicksProvider; if (tp != null) { tp.Unsubscribe(); } ISettingsProvider stp = connector as ISettingsProvider; if (stp != null) { stp.Unsubscribe(); } ITradesProvider trp = connector as ITradesProvider; if (trp != null) { trp.Unsubscribe(); } } Activated = false; }
// ********************************************************************** public static void SetMode(bool replay, bool nullTader) { if (isReplayMode != replay) { if (isReplayMode = replay) { foreach (IConnector connector in connectors) { IStockProvider sp = connector as IStockProvider; if (sp != null) { sp.Unsubscribe(); } ITicksProvider tp = connector as ITicksProvider; if (tp != null) { tp.Unsubscribe(); } ISettingsProvider stp = connector as ISettingsProvider; if (stp != null) { stp.Unsubscribe(); } ITradesProvider trp = connector as ITradesProvider; if (trp != null) { trp.Unsubscribe(); } } } } isNullTrader = nullTader; Activate(); }