Esempio n. 1
0
        private void ButtonCandleAddClick(object sender, EventArgs e)
        {
            var form = new ChronometerForm();

            if (form.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }
            BarSettings data = form.Data;

            data.IsUserDefined = true;
            BarSettingsStorage.Instance.GetCollection().Add(data);
            gridCandles.DataBind(BarSettingsStorage.Instance.GetCollection());
            gridCandles.CheckSize();
        }
Esempio n. 2
0
        private void ButtonCandleChangeClick(object sender, EventArgs e)
        {
            var selectedRows = gridCandles.rows.Where(r => r.Selected).ToList();

            if (selectedRows.Count == 0)
            {
                return;
            }
            var         form = new ChronometerForm();
            BarSettings data = (BarSettings)selectedRows[0].ValueObject;

            form.Data = data;
            form.SetReadOnly(!data.IsUserDefined);
            if (form.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }
            BarSettingsStorage.Instance.RemoveBarSettingsByName(data.Title);
            data = form.Data;
            data.IsUserDefined = true;
            BarSettingsStorage.Instance.GetCollection().Add(data);
            gridCandles.DataBind(BarSettingsStorage.Instance.GetCollection());
            gridCandles.CheckSize();
        }
Esempio n. 3
0
 private void ButtonCandleAddClick(object sender, EventArgs e)
 {
     var form = new ChronometerForm();
     if (form.ShowDialog(this) == DialogResult.Cancel)
         return;
     BarSettings data = form.Data;
     data.IsUserDefined = true;
     BarSettingsStorage.Instance.GetCollection().Add(data);
     gridCandles.DataBind(BarSettingsStorage.Instance.GetCollection());
     gridCandles.CheckSize();
 }
Esempio n. 4
0
 private void ButtonCandleChangeClick(object sender, EventArgs e)
 {
     var selectedRows = gridCandles.rows.Where(r => r.Selected).ToList();
     if (selectedRows.Count == 0)
         return;
     var form = new ChronometerForm();
     BarSettings data = (BarSettings) selectedRows[0].ValueObject;
     form.Data = data;
     form.SetReadOnly(!data.IsUserDefined);
     if (form.ShowDialog(this) == DialogResult.Cancel)
         return;
     BarSettingsStorage.Instance.RemoveBarSettingsByName(data.Title);
     data = form.Data;
     data.IsUserDefined = true;
     BarSettingsStorage.Instance.GetCollection().Add(data);
     gridCandles.DataBind(BarSettingsStorage.Instance.GetCollection());
     gridCandles.CheckSize();
 }