public bool CompleteTransfersFromPreviousRun(int arbitrationRunId) { //Get arbitration run record from the db: ArbitrationRun previousRun = ArbitrationRun.GetArbitrationRunFromDbById(arbitrationRunId); //Ensure the given was in live mode, as this is to poin to completing transfers from a simulated run if (previousRun.ArbitrationMode == ArbitrationMode.Simulation) { ArbitrationManagerFailureEventHandler handler = ErrorOccured; //Only throw the event is there is a listener if (handler != null) { handler(this, new ArbitrationManagerFailureEventArgs("Arbitration run " + arbitrationRunId + " was ran in simulation mode; no point in completing transfers for it.")); return(false); } } //First need to build up the exchange list, as it is needed by the transfer manager. List <BaseExchange> previousRunExchangeList = BuildExchangeListFromPreviousRun(previousRun); TransferManager.DetectAndExecuteRollupTransfers_Live(1, previousRun.Id.Value, previousRunExchangeList); return(true); }
private void OnError(string messageBoxMessage, Exception exception, string logExceptionPrefix = "") { ArbitrationManagerFailureEventHandler handler = ErrorOccured; //Stop this run. Stop(); log.Error(logExceptionPrefix + Environment.NewLine + exception); //Only throw the event is there is a listener if (handler != null) { handler(this, new ArbitrationManagerFailureEventArgs(messageBoxMessage)); } }