Пример #1
0
        private void EditObject()
        {
            DataObjectEditor editor = this.viewer.GetEditor();

            if (editor != null)
            {
                int num = this.listView.SelectedIndices[0];
                editor.Init(this.dataSeries[(long)num], this.dataSeries[(long)num].DateTime, this.instrument.PriceFormat, this.instrument.Id);
                if (editor.ShowDialog((IWin32Window)this) == DialogResult.OK)
                {
                    this.dataSeries.Update((long)num, editor.GetDataObject());
                    this.viewer.ResetLastItem();
                }
                editor.Dispose();
            }
            else
            {
                int num1 = (int)MessageBox.Show((IWin32Window)this, "Operation is not supported for this type of objects", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
Пример #2
0
        private void AddObject()
        {
            DataObjectEditor editor = this.viewer.GetEditor();

            if (editor != null)
            {
                DateTime dateTime = this.listView.SelectedIndices.Count > 0 ? this.dataSeries[(long)this.listView.SelectedIndices[0]].DateTime : DateTime.Now;
                editor.Init((SmartQuant.DataObject)null, dateTime, this.instrument.PriceFormat, this.instrument.Id);
                if (editor.ShowDialog((IWin32Window)this) == DialogResult.OK)
                {
                    this.dataSeries.Add(editor.GetDataObject());
                    this.viewer.ResetLastItem();
                    this.listView.VirtualListSize = (int)this.dataSeries.Count;
                }
                editor.Dispose();
            }
            else
            {
                int num = (int)MessageBox.Show((IWin32Window)this, "Operation is not supported for this type of objects", "Add New", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }