private void EditObject() { DataObjectEditor editor = this.viewer.GetEditor(); if (editor != null) { int num = this.listView.SelectedIndices[0]; editor.Init((IDataObject)this.dataSeries[num], this.priceFormat); if (editor.ShowDialog((IWin32Window)this) == DialogResult.OK) { this.dataSeries.Update(num, (object)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); } }
private void AddObject() { DataObjectEditor editor = this.viewer.GetEditor(); if (editor != null) { editor.Init((IDataObject)null, this.priceFormat); if (editor.ShowDialog((IWin32Window)this) == DialogResult.OK) { IDataObject dataObject = editor.GetDataObject(); this.dataSeries.Add(dataObject.DateTime, dataObject); this.viewer.ResetLastItem(); this.listView.VirtualListSize = 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); } }