public ContractBase RegisterContract(int requestId, ContractBase contract, ContractDetails IbContract) { lock (SecurityDataDic) { var optionContract = contract as OptionContract; BaseSecurityData securityData; if (optionContract != null) { securityData = new OptionData { Account = AccountSummary.MainAccount }; } else { securityData = new SecurityData { Account = AccountSummary.MainAccount } }; securityData.SetContract(contract); IbContract.UpdateSecurityData(contract); SecurityDataDic.Add(requestId, new SecuirtyDataWrapper(securityData)); return(contract); } }