public VariablesUpdateMessage(GeneralParametersUpdate general, SecurityParametersUpdate security, AssetParametersUpdate asset, RiskTypeParametersUpdate tradinglimit)
 {
     this.General = general;
     this.Security = security;
     this.Asset = asset;
     this.TradingLimit = tradinglimit;
 }
Beispiel #2
0
 public void Update(GeneralParametersUpdate general, SecurityParametersUpdate security, AssetParametersUpdate assets, RiskTypeParametersUpdate tradinglimit)
 {
     if (general != null)
     {
         general.CopyTo(Game.State.General);
         TTSFormManager.Instance.EnforceAllowedWindows();
         ((Client)ThreadHelper.MainThread).EnforceAllowedWindows();
     }
     if (security != null)
     {
         security.CopyTo(Game.State.Securities[security.Ticker].Parameters);
         GameManager.UpdateStatus(Game.State.Current);
     }
     if (assets != null)
     {
         DataTable dataTable = new System.Collections.Generic.List<AssetParametersUpdate>(new AssetParametersUpdate[]
         {
             assets
         }).ToDataTable("AssetInfoUpdateTable");
         DataRow dataRow = this.AssetInfoTable.Rows.Find(assets.Ticker);
         foreach (DataColumn dataColumn in dataTable.Columns)
         {
             dataRow[dataColumn.ColumnName] = dataTable.Rows[0][dataColumn.ColumnName];
         }
         Game.State.AssetContainerView.RaiseUpdate();
     }
     if (tradinglimit != null)
     {
         tradinglimit.CopyTo(Game.State.RiskTypes[tradinglimit.Name]);
     }
     if (general != null || security != null || assets != null || tradinglimit != null)
     {
         Game.VariablesUpdated();
     }
 }