Exemple #1
0
 private void ModifyButton_Click(object sender, EventArgs e)
 {
     if (_suggestions.Length > 0)
     {
         _edit_window = new AssistantModifyWindow(GetCurrentSuggestion());
         if (_edit_window.ShowDialog() == DialogResult.OK)
         {
             SetCurrentSuggestion(_edit_window.ModifiedSuggestion);
             UpdateIterations();
             UpdateSpeed();
             LoadSelectedSuggestion();
         }
         _edit_window.Dispose();
         _edit_window = null;
     }
 }
Exemple #2
0
        private void NewButton_Click(object sender, EventArgs e)
        {
            _edit_window = new AssistantModifyWindow(new Suggestion(new UserActionList(), new Dictionary <UserAction, List <ContextLib.DataContainers.Monitoring.Generalizations.Generalization> >()));
            if (_edit_window.ShowDialog() == DialogResult.OK)
            {
                List <Suggestion> sugs = new List <Suggestion>(_suggestions);
                sugs.Reverse();
                sugs.Add(_edit_window.ModifiedSuggestion);
                sugs.Reverse();
                _suggestions     = sugs.ToArray();
                _max_suggestions = _suggestions.Length;

                List <int> it = new List <int>(_iterations);
                it.Reverse();
                it.Add(1);
                it.Reverse();
                _iterations = it.ToArray();

                List <float> sp = new List <float>(_speeds);
                sp.Reverse();
                sp.Add(1.0f);
                sp.Reverse();
                _speeds = sp.ToArray();

                List <bool> ig = new List <bool>(_ignore_speed);
                ig.Reverse();
                ig.Add(false);
                ig.Reverse();
                _ignore_speed = ig.ToArray();

                UpdateCurrentSuggestion();
                UpdateIterations();
                UpdateSpeed();
                LoadSelectedSuggestion();
            }
            _edit_window.Dispose();
            _edit_window = null;
        }