Exemplo n.º 1
0
        private void DeleteParameters_Click(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;
            ParameterKeyValuePair param         = button.DataContext as ParameterKeyValuePair;
            LayerChainItem        selectedLayer = ChainListBox.SelectedItem as LayerChainItem;

            int index = selectedLayer.ParameterKeys.IndexOf(param.Key.Value);

            selectedLayer.ParameterKeys.RemoveAt(index);
            selectedLayer.ParameterValues.RemoveAt(index);

            Parameters.Remove(param);

            if (ParameterRemoved != null)
            {
                ParameterRemoved(this, new ParameterAddedOrRemovedEventArgs(false, selectedLayer, param));
            }
        }
Exemplo n.º 2
0
        private void AddParameter_Click(object sender, RoutedEventArgs e)
        {
            ParameterKeyValuePair param         = new ParameterKeyValuePair(KeyBox.Text, ValueBox.Text);
            LayerChainItem        selectedLayer = ChainListBox.SelectedItem as LayerChainItem;

            if (selectedLayer.ParameterKeys.Contains(KeyBox.Text))
            {
                int index = selectedLayer.ParameterKeys.IndexOf(KeyBox.Text);
                selectedLayer.ParameterKeys.RemoveAt(index);
                selectedLayer.ParameterValues.RemoveAt(index);
            }
            selectedLayer.ParameterKeys.Add(KeyBox.Text);
            selectedLayer.ParameterValues.Add(ValueBox.Text);

            Parameters.Add(param);

            if (ParameterAdded != null)
            {
                ParameterAdded(this, new ParameterAddedOrRemovedEventArgs(true, selectedLayer, param));
            }
        }
Exemplo n.º 3
0
 public ParameterAddedOrRemovedEventArgs(bool added, LayerChainItem layer, ParameterKeyValuePair parameter)
 {
     Added = added;
     Layer = layer;
     Parameter = parameter;
 }
Exemplo n.º 4
0
        private void AddParameter_Click(object sender, RoutedEventArgs e)
        {
            ParameterKeyValuePair param = new ParameterKeyValuePair(KeyBox.Text, ValueBox.Text);
            LayerChainItem selectedLayer = ChainListBox.SelectedItem as LayerChainItem;

            if (selectedLayer.ParameterKeys.Contains(KeyBox.Text))
            {
                int index = selectedLayer.ParameterKeys.IndexOf(KeyBox.Text);
                selectedLayer.ParameterKeys.RemoveAt(index);
                selectedLayer.ParameterValues.RemoveAt(index);
            }
            selectedLayer.ParameterKeys.Add(KeyBox.Text);
            selectedLayer.ParameterValues.Add(ValueBox.Text);

            Parameters.Add(param);

            if (ParameterAdded != null)
                ParameterAdded(this, new ParameterAddedOrRemovedEventArgs(true, selectedLayer, param));
        }
Exemplo n.º 5
0
 public ParameterAddedOrRemovedEventArgs(bool added, LayerChainItem layer, ParameterKeyValuePair parameter)
 {
     Added     = added;
     Layer     = layer;
     Parameter = parameter;
 }