Exemple #1
0
        private void AddStatement()
        {
            var statementDataList = new List <StatementDataModel>();

            var statementVm   = new StatementVm(statementDataList, _avalibleSignals);
            var statementView = new Views.StatementWindow3();

            statementView.DataContext = statementVm;
            statementView.ShowDialog();

            if (statementVm.IS_SAVED)
            {
                if (statementDataList.Count > 1)
                {
                    var statement = new Statement.StatementCollection();
                    foreach (StatementDataModel statementdata in statementDataList)
                    {
                        switch (statementdata.AlgebraOperator)
                        {
                        case "Or":
                            statement.AddStatement(CreateStatement(statementdata), LogialAnalyzerTrigger.Statement.LogicalOperators.Or);
                            break;

                        case "And":
                            statement.AddStatement(CreateStatement(statementdata), LogialAnalyzerTrigger.Statement.LogicalOperators.And);
                            break;

                        default:
                            statement.AddStatement(CreateStatement(statementdata), LogialAnalyzerTrigger.Statement.LogicalOperators.First);
                            break;
                        }
                    }
                    Statement = statement;
                }
                else
                {
                    Statement = CreateStatement(statementDataList.First());
                }
            }
            else
            {
            }
        }
        private void AddStatement()
        {
            var statementDataList = new List<StatementDataModel>();

            var statementVm = new StatementVm(statementDataList, _avalibleSignals);
            var statementView = new Views.StatementWindow3();
            statementView.DataContext = statementVm;
            statementView.ShowDialog();

            if (statementVm.IS_SAVED)
            {
                if (statementDataList.Count > 1)
                {
                    var statement = new Statement.StatementCollection();
                    foreach (StatementDataModel statementdata in statementDataList)
                    {
                        switch (statementdata.AlgebraOperator)
                        {
                            case "Or":
                                statement.AddStatement(CreateStatement(statementdata), LogialAnalyzerTrigger.Statement.LogicalOperators.Or);
                                break;
                            case "And":
                                statement.AddStatement(CreateStatement(statementdata), LogialAnalyzerTrigger.Statement.LogicalOperators.And);
                                break;
                            default:
                                statement.AddStatement(CreateStatement(statementdata), LogialAnalyzerTrigger.Statement.LogicalOperators.First);
                                break;
                        }

                    }
                    Statement = statement;
                }
                else
                {
                    Statement = CreateStatement(statementDataList.First());
                }
            }
            else
            {

            }
        }