示例#1
0
        private void pbSave_Click(object sender, EventArgs e)
        {
            if (SearchParameters == null)
            {
                return;
            }

            frmAddElement addElementForm = new frmAddElement("", SearchParameters);

            addElementForm.ScriptContext = (ScriptContext)ScriptContext;
            addElementForm.ShowDialog();

            if (addElementForm.DialogResult == DialogResult.OK)
            {
                ScriptElement newElement = new ScriptElement()
                {
                    ElementName  = addElementForm.txtElementName.Text.Replace("<", "").Replace(">", ""),
                    ElementValue = addElementForm.ElementValueDT
                };

                ScriptContext.Elements.Add(newElement);
            }

            addElementForm.Dispose();
        }
示例#2
0
        private void pbSave_Click(object sender, EventArgs e)
        {
            frmAddElement addElementForm = new frmAddElement("", SearchParameters);

            addElementForm.ScriptElements = ScriptElements;
            addElementForm.ShowDialog();

            if (addElementForm.DialogResult == DialogResult.OK)
            {
                ScriptElement newElement = new ScriptElement()
                {
                    ElementName  = addElementForm.txtElementName.Text.Replace("<", "").Replace(">", ""),
                    ElementValue = addElementForm.ElementValueDT
                };

                ScriptElements.Add(newElement);
            }
        }