示例#1
0
        /// <summary>
        /// Перетаскивание значений
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listBox2_AfterDrop(object sender, AfterDropEventArgs e)
        {
            string s = e.Data as string;

            domains[listBox1.SelectedItem.ToString()].ListVal.RemoveAt(e.SIndex);
            domains[listBox1.SelectedItem.ToString()].ListVal.Insert(e.FIndex, s);
        }
示例#2
0
        /// <summary>
        /// После перетаскивания в окне доменов
        /// </summary>
        void listBox1_AfterDrop(object sender, AfterDropEventArgs e)
        {
            ValueDomain d = domains.Vals[e.SIndex];

            domains.RemoveAt(e.SIndex);
            domains.Insert(e.FIndex, d.Name, d);
        }
示例#3
0
        /// <summary>
        /// Перетаскивание переменных
        /// </summary>
        private void listBox1_AfterDrop(object sender, AfterDropEventArgs e)
        {
            Variable pr = vars[e.Data as string];

            vars.RemoveAt(e.SIndex);
            vars.Insert(e.FIndex, e.Data as string, pr);
        }
示例#4
0
 protected virtual void AfterDragDrop(AfterDropEventArgs e)
 {
     if (AfterDrop != null)
     {
         AfterDrop(this, e);
     }
 }
示例#5
0
        /// <summary>
        /// Перетаскивание правил
        /// </summary>
        private void lstRules_AfterDrop(object sender, AfterDropEventArgs e)
        {
            string s  = (e.Data as string);
            Rule   pr = rules[s.Substring(0, s.IndexOf(':'))];

            rules.RemoveAt(e.SIndex);
            rules.Insert(e.FIndex, pr.Name, pr);
        }
示例#6
0
 /// <summary>
 /// Отпустили кнопку - кладем элемент на место
 /// </summary>
 void DragListBox_MouseUp(object sender, MouseEventArgs e)
 {
     if (de == DragDropEffects.Move)
     {
         de     = DragDropEffects.None;
         fIndex = this.IndexFromPoint(e.X, e.Y);
         if (fIndex > this.Items.Count)
         {
             fIndex = this.Items.Count;
         }
         this.Items.Insert(++fIndex, s);
         dt.Dispose();
         // событие
         AfterDropEventArgs MyE = new AfterDropEventArgs(sIndex, fIndex, s);
         AfterDragDrop(MyE);
     }
 }
示例#7
0
 /// <summary>
 /// Перетаскивание посылок
 /// </summary>
 private void lstReasons_AfterDrop(object sender, AfterDropEventArgs e)
 { // e.Data - Fact !
     rules[getSelectedRuleName()].Reasons.RemoveAt(e.SIndex);
     rules[getSelectedRuleName()].Reasons.Insert(e.FIndex, e.Data as Fact);
 }
示例#8
0
 /// <summary>
 /// Перетаскивание значений в домене
 /// </summary>
 private void listBox2_AfterDrop(object sender, AfterDropEventArgs e)
 {
     es.Domains[comboBox1.SelectedItem.ToString()].ListVal.RemoveAt(e.SIndex);
     es.Domains[comboBox1.SelectedItem.ToString()].ListVal.Insert(e.FIndex, e.Data as string);
 }