private void TickerButtonClick(object sender, EventArgs e) { var dlg = new RobotTimeframesForm(BaseRobot.ParseTickerTimeframeString(tickerTextBox.Text)); if (dlg.ShowDialog() != DialogResult.OK) { return; } tickerTextBox.Text = BaseRobot.GetStringFromTickerTimeframe(dlg.UpdatedGraphics); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { var timeFramesString = value as string; if (string.IsNullOrEmpty(timeFramesString)) return value; var timeFrames = BaseRobot.ParseTickerTimeframeString(timeFramesString); var dlg = new RobotTimeframesForm(timeFrames); if (dlg.ShowDialog() != DialogResult.OK) return value; return dlg.UpdatedGraphics.Count == 0 ? string.Empty : BaseRobot.GetStringFromTickerTimeframe(dlg.UpdatedGraphics); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { var timeFramesString = value as string; if (string.IsNullOrEmpty(timeFramesString)) { return(value); } var timeFrames = BaseRobot.ParseTickerTimeframeString(timeFramesString); var dlg = new RobotTimeframesForm(timeFrames); if (dlg.ShowDialog() != DialogResult.OK) { return(value); } return(dlg.UpdatedGraphics.Count == 0 ? string.Empty : BaseRobot.GetStringFromTickerTimeframe(dlg.UpdatedGraphics)); }
private void GridRobotUserHitCell(object sender, MouseEventArgs e, int rowIndex, FastColumn col, RobotGridItem gridItem) { var robot = gridItem.Robot; // показать меню выбора Magic-a, // подсветить в первую очередь, незанятые номера if (col.PropertyName == RobotGridItem.speciman.Property(p => p.Magic) && e.Button == MouseButtons.Left) { ShowMagicMenu(e, gridItem, rowIndex); return; } // показать окно настройки тикеров для робота if (col.PropertyName == RobotGridItem.speciman.Property(p => p.HumanRTickers) && e.Button == MouseButtons.Left) { var dlg = new RobotTimeframesForm(robot.Graphics); if (dlg.ShowDialog() != DialogResult.OK) return; robot.Graphics = dlg.UpdatedGraphics; gridRobot.UpdateRow(rowIndex, gridItem); gridRobot.InvalidateCell(col, rowIndex); return; } // настроить робота if ((/*col.PropertyName == "TypeName" || */e.Clicks > 1) && e.Button == MouseButtons.Left) { ShowRobotParamsDialog(robot); } }
private void TickerButtonClick(object sender, EventArgs e) { var dlg = new RobotTimeframesForm(BaseRobot.ParseTickerTimeframeString(tickerTextBox.Text)); if (dlg.ShowDialog() != DialogResult.OK) return; tickerTextBox.Text = BaseRobot.GetStringFromTickerTimeframe(dlg.UpdatedGraphics); }