Ejemplo n.º 1
0
        private void UpdateDependence(int n)
        {
            ItemSelectorForm ItemSelect = new ItemSelectorForm();
            DialogResult     R          = ItemSelect.ShowDialog();

            if (R == DialogResult.OK)
            {
                List <int> Returned = ItemSelectorForm.ReturnItems;
                if (Returned.Count == 0)
                {
                    return;
                }
                ;
                for (int i = 0; i < Returned.Count; i++)
                {
                    if (!ItemList[n].Dependence.Contains(Returned[i]))
                    {
                        ItemList[n].Dependence.Add(Returned[i]);
                    }
                    ;
                }
                ;
                FillDependence(n);
            }
            ;
        }
Ejemplo n.º 2
0
        private void UpdateConditional(int n, int?conditionalIndex = null)
        {
            List <int> selectedItems = null;

            if (conditionalIndex.HasValue)
            {
                selectedItems = ItemList[n].Conditional[conditionalIndex.Value];
            }
            ItemSelectorForm ItemSelect = new ItemSelectorForm(selectedItems);
            DialogResult     R          = ItemSelect.ShowDialog();

            if (R == DialogResult.OK)
            {
                List <int> Returned = ItemSelectorForm.ReturnItems;
                if (Returned.Count == 0)
                {
                    return;
                }
                ;
                if (conditionalIndex.HasValue)
                {
                    ItemList[n].Conditional[conditionalIndex.Value] = Returned;
                }
                else
                {
                    ItemList[n].Conditional.Add(Returned);
                }
                FillConditional(n);
            }
            ;
        }
Ejemplo n.º 3
0
        private void button_goto_Click(object sender, EventArgs e)
        {
            var itemSelect = new ItemSelectorForm(checkboxes: false);
            var result     = itemSelect.ShowDialog();

            if (result == DialogResult.OK && ItemSelectorForm.ReturnItems.Any())
            {
                var itemIndex = ItemSelectorForm.ReturnItems.First();
                nItem.Value = itemIndex;
            }
        }
Ejemplo n.º 4
0
        private void lConditional_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            var index = lConditional.IndexFromPoint(e.Location);

            if (index != ListBox.NoMatches)
            {
                var conditions = ItemList[n].Conditional[index];
                if (conditions.Count == 1)
                {
                    nItem.Value = conditions[0];
                }
                else
                {
                    var itemSelect = new ItemSelectorForm(checkboxes: false, highlightedItems: conditions);
                    var result     = itemSelect.ShowDialog();
                    if (result == DialogResult.OK && ItemSelectorForm.ReturnItems.Any())
                    {
                        var itemIndex = ItemSelectorForm.ReturnItems.First();
                        nItem.Value = itemIndex;
                    }
                }
            }
        }