private DrawingControlBase FieldBindingListAddingNew(FieldModel fm) { fieldBindingList.Add(fm); switch (fm.FieldType) { case FieldType.DataBlock: DataBlockContainer dbc = PaintManager.CurrentView.CreateADataBlock(fm); dgv_Fields.Refresh(); return(dbc); case FieldType.Line: SplitterControl sc = PaintManager.CurrentView.CreateASplitter(fm); dgv_Fields.Refresh(); return(sc); default: bool editing = true; if (!string.IsNullOrEmpty(fm.FieldName)) { editing = false; } FieldControl fc = PaintManager.CurrentView.CreateAField(fm, editing); dgv_Fields.Refresh(); return(fc); } }
public DataBlockContainer CreateADataBlock(FieldModel fm) { DataBlockContainer dbc = new DataBlockContainer(fm); fields.Add(dbc); dbc.DrawingControlBaseSelectedEvent += Fc_FieldControlClickEvent; this.Controls.Add(dbc); dbc.SizePercentNow = SizePercentNow; dbc.BringToFront(); dbc.FixedLocationInPage = dbc.FixedLocationInPage; return(dbc); }