Esempio n. 1
0
        protected void Edit_Click(object sender, EventArgs e)
        {
            if (valueControl.SelectedIndex >= 0)
            {
                int index = valueControl.SelectedIndex;
                using (XmlForm form = new XmlForm())
                {
                    form.LoadDefinition(this.ItemType, null);
                    form.Tag = this.FindForm().Tag;
                    form.Design("", page);
                    if ("ParameterItem" == this.ItemType)
                    {
                        form.AddGlobalData("ruleId", Parent.Parent.Controls[1].Controls[0].Controls[1].Text);
                    }
                    ListItemsObject dgo = (ListItemsObject)valueControl.Items[index];
                    form.SetShapeXml(String.Format("<properties>{0}</properties>", dgo.Column.InnerXml));
                    DialogResult result = form.ShowDialog(this);

                    if (result == DialogResult.OK)
                    {
                        XmlDocument xdoc = form.GetShapeXml(this.ItemName);

                        valueControl.Items[index] = new ListItemsObject(xdoc.DocumentElement, ComplexLabel, ComplexPattern, childPattern);
                    }
                }
            }
        }
Esempio n. 2
0
 private void Down_Click(object sender, EventArgs e)
 {
     if (valueControl.SelectedIndex >= 0)
     {
         int             index = valueControl.SelectedIndex;
         int             max   = valueControl.Items.Count;
         ListItemsObject obj   = (ListItemsObject)valueControl.Items[index];
         valueControl.Items.RemoveAt(index);
         if (index == max - 1)
         {
             valueControl.Items.Insert(0, obj);
             valueControl.SelectedIndex = 0;
         }
         else
         {
             valueControl.Items.Insert(index + 1, obj);
             valueControl.SelectedIndex = index + 1;
         }
     }
 }