コード例 #1
0
        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;
        }
コード例 #2
0
ファイル: FrmMain.cs プロジェクト: NoExceptions/scada
        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;
        }