public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { //打开属性编辑器修改数据 Control control = context.Instance as Control; PropertyDescriptor descriptor = context.PropertyDescriptor; StripTabCursorCollection tabCursor = descriptor.GetValue(context.Instance) as StripTabCursorCollection; // 强制变更,以将变更写入文件 PropertyDescriptor backColorProperty = TypeDescriptor.GetProperties(control)["BackColor"]; backColorProperty.SetValue(control, control.BackColor); return(CollectionPropertyEditorForm <StripTabCursor> .EditValue(descriptor.Name, tabCursor, () => { tabCursor.Add(new StripTabCursor()); }, true)); }
/// <summary> /// TabCursor infomation form /// </summary> public StripTabCursorInfoForm(StripChartX parentChart) { InitializeComponent(); this._cursors = parentChart.TabCursors; this._parentChart = parentChart; RefreshCursorInfo(); SetFormLocation(parentChart); const string formNameFormat = "{0} Tab Cursors"; this.Text = string.Format(formNameFormat, parentChart.Name); this._isInternalOperation = false; RefreshSeriesNames(); this._parentChart.TabCursorChanged += RefreshCursorValue; this._parentChart.AfterPlot += RefreshCursorXYValue; // RunTimeEditable为false时,tabCursor的添加删除按钮不使能 if (!parentChart.TabCursors.RunTimeEditable) { tableLayoutPanel_buttonPanel.Enabled = false; } }
internal StripTabCursorDesignTimeCollection(StripTabCursorCollection collection) { this._collection = collection; this.SyncRoot = new object(); }