private void addEmptyMappingLogicControl() { if (this.mapping != null) { var mappingLogic = new MappingLogic(string.Empty); this.mapping.addMappingLogic(mappingLogic); this.addMappingLogicControl(mappingLogic); } }
private MappingLogicControl addMappingLogicControl(MappingLogic logic) { var mappingLogicControl = new MappingLogicControl(); mappingLogicControl.deleteButtonClicked += mappingLogicDeleteButtonClicked; mappingLogicControl.mappingLogicTextChanged += mappingLogicChanged; mappingLogicControl.selectedContextChanged += mappingLogicChanged; mappingLogicControl.AutoSizeMode = AutoSizeMode.GrowAndShrink; mappingLogicControl.BorderStyle = BorderStyle.FixedSingle; mappingLogicControl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; mappingLogicControl.TabIndex = mappingLogicPanel.Controls.Count; mappingLogicControl.setContexts(this.contexts); mappingLogicControl.mappingLogic = logic; mappingLogicControl.Show(); if (mappingLogicPanel.Controls.Count >= 1) { this.Height = this.Height + mappingLogicControl.Height + padding; } this.mappingLogicPanel.Controls.Add(mappingLogicControl, 0, mappingLogicPanel.Controls.Count); this.enableDisable(); return(mappingLogicControl); }