Ejemplo n.º 1
0
        /// <summary> Löscht das ausgewählte Szenario </summary>
        public void Delete()
        {
            /// <summary> Index des ausgewählten Szenarios </summary>
            int      index    = AllScenarios.IndexOf(AllScenarios.Where(p => p.IsSelected == true).FirstOrDefault());
            Scenario scenario = AllScenarios.ElementAt(index);

            _scenarioRepository.DeleteScenario(scenario);
            BlueBlue   = null;
            BlueRed    = null;
            BlueGreen  = null;
            BlueYellow = null;

            RedBlue   = null;
            RedRed    = null;
            RedGreen  = null;
            RedYellow = null;

            GreenBlue   = null;
            GreenRed    = null;
            GreenGreen  = null;
            GreenYellow = null;

            YellowBlue         = null;
            YellowRed          = null;
            YellowGreen        = null;
            YellowYellow       = null;
            IsListItemSelected = false;
            base.OnPropertyChanged("IsListItemSelected");
        }
Ejemplo n.º 2
0
        public void Test_ComposedScenario()
        {
            var processor = new Processor();

            var allScenarios = new AllScenarios();

            allScenarios.Given(processor.Insert);
            allScenarios.When(processor.Run);
            allScenarios.Then(processor.SelectAll);
        }
Ejemplo n.º 3
0
        /// <summary> Event wird ausgelöst, wenn Item in der Liste ausgewählt wird </summary>
        /// <param name="sender"> Objekt von dem das Event ausgeht</param>
        /// <param name="e"> Ausgelöstes Event </param>
        void OnScenarioPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            string IsSelected = "IsSelected";

            (sender as Scenario).VerifyPropertyName(IsSelected);
            IsListItemSelected = false;
            base.OnPropertyChanged("IsListItemSelected");
            if (e.PropertyName == IsSelected)
            {
                if ((sender as Scenario).IsSelected)
                {
                    _index     = AllScenarios.IndexOf(AllScenarios.Where(p => p.IsSelected == true).FirstOrDefault());
                    BlueBlue   = AllScenarios.ElementAt(_index).BlueBlue;
                    BlueRed    = AllScenarios.ElementAt(_index).BlueRed;
                    BlueGreen  = AllScenarios.ElementAt(_index).BlueGreen;
                    BlueYellow = AllScenarios.ElementAt(_index).BlueYellow;

                    RedBlue   = AllScenarios.ElementAt(_index).RedBlue;
                    RedRed    = AllScenarios.ElementAt(_index).RedRed;
                    RedGreen  = AllScenarios.ElementAt(_index).RedGreen;
                    RedYellow = AllScenarios.ElementAt(_index).RedYellow;

                    GreenBlue   = AllScenarios.ElementAt(_index).GreenBlue;
                    GreenRed    = AllScenarios.ElementAt(_index).GreenRed;
                    GreenGreen  = AllScenarios.ElementAt(_index).GreenGreen;
                    GreenYellow = AllScenarios.ElementAt(_index).GreenYellow;

                    YellowBlue   = AllScenarios.ElementAt(_index).YellowBlue;
                    YellowRed    = AllScenarios.ElementAt(_index).YellowRed;
                    YellowGreen  = AllScenarios.ElementAt(_index).YellowGreen;
                    YellowYellow = AllScenarios.ElementAt(_index).YellowYellow;

                    IsListItemSelected = true;
                    base.OnPropertyChanged("IsListItemSelected");
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary> Eventhandler wenn Szenario gelöscht wird </summary>
 /// <param name="sender"> Objekt von dem das Event ausgeht</param>
 /// <param name="e"> Ausgelöstes Event </param>
 private void OnScenarioDeletedFromRepository(object sender, ScenarioDeletedEventArgs e)
 {
     AllScenarios.Remove(e.ToRemoveScenario);
 }