/// <summary> /// Создать <see cref="PortfoliosPanel"/>. /// </summary> public PortfoliosPanel() { InitializeComponent(); AlertBtn.SchemaChanged += RaiseChangedCommand; var cmdSvc = ConfigManager.GetService <IStudioCommandService>(); cmdSvc.Register <PositionCommand>(this, true, cmd => AlertBtn.Process(new PositionChangeMessage { SecurityId = cmd.Position.Key.Item1, PortfolioName = cmd.Position.Key.Item2, ServerTime = TimeHelper.NowWithOffset, }.Add(PositionChangeTypes.CurrentValue, cmd.Position.Value))); cmdSvc.Register <BindConnectorCommand>(this, true, cmd => { if (!cmd.CheckControl(this)) { return; } ShowToolBar = false; }); WhenLoaded(() => new RequestBindSource(this).SyncProcess(this)); }
public override void Save(SettingsStorage storage) { storage.SetValue("GridSettings", TradesGrid.Save()); storage.SetValue("Securities", _securityIds.ToArray()); storage.SetValue("AlertSettings", AlertBtn.Save()); storage.SetValue("VolumeFilter", VolumeFilter.Value); }
public override void Save(SettingsStorage storage) { base.Save(storage); storage.SetValue("SubscribeNews", SubscribeNews); storage.SetValue("NewsGrid", NewsGrid.Save()); storage.SetValue("AlertSettings", AlertBtn.Save()); }
public override void Dispose() { var cmdSvc = ConfigManager.GetService <IStudioCommandService>(); cmdSvc.UnRegister <ResetedCommand>(this); cmdSvc.UnRegister <NewTradesCommand>(this); AlertBtn.Dispose(); }
public override void Load(SettingsStorage storage) { base.Load(storage); SubscribeNews = storage.GetValue("SubscribeNews", false); NewsGrid.Load(storage.GetValue <SettingsStorage>("NewsGrid")); var alertSettings = storage.GetValue <SettingsStorage>("AlertSettings"); if (alertSettings != null) { AlertBtn.Load(alertSettings); } }
/******************************************************************** * CÓDIGO ACIMA, ADICIONA SOMBRA NO WINDOWS FORM /\ /\ /\ /\ ********************************************************************/ #endregion DLL SHADOW public AlertBig(string _title, string _message, AlertType type, AlertBtn btn, bool focus = false) { InitializeComponent(); title.Text = _title; message.Text = _message; switch (type) { case AlertType.success: icon.Image = Properties.Resources.success; break; case AlertType.info: icon.Image = Properties.Resources.info; break; case AlertType.warning: icon.Image = Properties.Resources.warning; break; case AlertType.error: icon.Image = Properties.Resources.error; break; } switch (btn) { case AlertBtn.YesNo: btnNo.Visible = true; btnSim.Visible = true; if (focus) { btnNo.Focus(); } else { btnSim.Focus(); } break; case AlertBtn.OK: btnOk.Visible = true; btnOk.Focus(); break; } Eventos(); Retorno(); }
private void AddTrades(IEnumerable <Trade> trades) { if (!_securityIds.IsEmpty()) { trades = trades.Where(t => _securityIds.Contains(t.Security.Id)); } if (_volumeFilter != null && _volumeFilter > 0) { trades = trades.Where(t => t.Volume >= _volumeFilter); } TradesGrid.Trades.AddRange(trades); AlertBtn.Process(trades.Select(t => t.ToMessage())); }
public override void Load(SettingsStorage storage) { base.Load(storage); SubscribeNews = storage.GetValue("SubscribeNews", false); NewsGrid.NewsProvider = ConfigManager.GetService <INewsProvider>(); NewsGrid.Load(storage.GetValue <SettingsStorage>("NewsGrid")); var alertSettings = storage.GetValue <SettingsStorage>("AlertSettings"); if (alertSettings != null) { AlertBtn.Load(alertSettings); } }
public override void Load(SettingsStorage storage) { var panelSettings = storage.GetValue <SettingsStorage>("PositionsPanel"); if (panelSettings != null) { ((IPersistable)PositionsPanel).Load(panelSettings); } var alertSettings = storage.GetValue <SettingsStorage>("AlertSettings"); if (alertSettings != null) { AlertBtn.Load(alertSettings); } }
public override void Load(SettingsStorage storage) { TradesGrid.Load(storage.GetValue <SettingsStorage>("GridSettings")); _securityIds.SyncDo(list => { list.Clear(); list.AddRange(storage.GetValue("Securities", ArrayHelper.Empty <string>())); }); var alertSettings = storage.GetValue <SettingsStorage>("AlertSettings"); if (alertSettings != null) { AlertBtn.Load(alertSettings); } VolumeFilter.Value = storage.GetValue <decimal?>("VolumeFilter"); }
public NewsPanel() { InitializeComponent(); NewsGrid.PropertyChanged += (s, e) => RaiseChangedCommand(); NewsGrid.SelectionChanged += (s, e) => new SelectCommand <News>(NewsGrid.SelectedNews, false).Process(this); AlertBtn.SchemaChanged += RaiseChangedCommand; GotFocus += (s, e) => new SelectCommand <News>(NewsGrid.SelectedNews, false).Process(this); var cmdSvc = ConfigManager.GetService <IStudioCommandService>(); cmdSvc.Register <NewNewsCommand>(this, false, cmd => { NewsGrid.News.Add(cmd.News); AlertBtn.Process(cmd.News.ToMessage()); }); cmdSvc.Register <ResetedCommand>(this, false, cmd => NewsGrid.News.Clear()); }
/// <summary> /// Создать <see cref="PortfoliosPanel"/>. /// </summary> public PortfoliosPanel() { InitializeComponent(); AlertBtn.SchemaChanged += RaiseChangedCommand; var cmdSvc = ConfigManager.GetService <IStudioCommandService>(); cmdSvc.Register <PositionCommand>(this, true, cmd => AlertBtn.Process(cmd.Position.ToMessage(TimeHelper.Now))); cmdSvc.Register <BindConnectorCommand>(this, true, cmd => { if (!cmd.CheckControl(this)) { return; } ShowToolBar = false; }); WhenLoaded(() => new RequestBindSource(this).SyncProcess(this)); }
public override void Load(SettingsStorage storage) { var gridSettings = storage.GetValue <SettingsStorage>("SecurityPicker"); if (gridSettings != null) { SecurityPicker.Load(gridSettings); } var alertSettings = storage.GetValue <SettingsStorage>("AlertSettings"); if (alertSettings != null) { AlertBtn.Load(alertSettings); } _securityIds.SyncDo(list => { list.Clear(); list.AddRange(storage.GetValue("Securities", ArrayHelper <string> .EmptyArray)); }); }
public override void Save(SettingsStorage storage) { storage.SetValue("SecurityPicker", SecurityPicker.Save()); storage.SetValue("AlertSettings", AlertBtn.Save()); storage.SetValue("Securities", _securityIds.ToArray()); }
public override void Dispose() { ConfigManager.GetService <IStudioCommandService>().UnRegister <PositionCommand>(this); PositionsPanel.Dispose(); AlertBtn.Dispose(); }
public override void Save(SettingsStorage storage) { storage.SetValue("PositionsPanel", PositionsPanel.Save()); storage.SetValue("AlertSettings", AlertBtn.Save()); }