private void miSchemeAddElem_Click(object sender, EventArgs e) { // добавление элемента SchemeView.Element elem; if (sender == miSchemeAddStText || sender == btnSchemeAddStText) { elem = new SchemeView.StaticText(); } else if (sender == miSchemeAddDynText || sender == btnSchemeAddDynText) { elem = new SchemeView.DynamicText(); } else if (sender == miSchemeAddStPic || sender == btnSchemeAddStPic) { elem = new SchemeView.StaticPicture(); } else // miSchemeAddDynPic или btnSchemeAddDynPic { elem = new SchemeView.DynamicPicture(); } elem.ID = editorData.SchemeView.GetNextElementID(); editorData.AddedElement = elem; miSchemeCancelAddElem.Enabled = btnSchemeCancelAddElem.Enabled = true; }
private void miSchemeAddElem_Click(object sender, EventArgs e) { // добавление элемента SchemeView.Element elem; if (sender == miSchemeAddStText || sender == btnSchemeAddStText) elem = new SchemeView.StaticText(); else if (sender == miSchemeAddDynText || sender == btnSchemeAddDynText) elem = new SchemeView.DynamicText(); else if (sender == miSchemeAddStPic || sender == btnSchemeAddStPic) elem = new SchemeView.StaticPicture(); else // miSchemeAddDynPic или btnSchemeAddDynPic elem = new SchemeView.DynamicPicture(); elem.ID = editorData.SchemeView.GetNextElementID(); editorData.AddedElement = elem; miSchemeCancelAddElem.Enabled = btnSchemeCancelAddElem.Enabled = true; }