Пример #1
0
        public QRequestSearch(HMIStatement statement, UInt64 cnt = 10)
        {
            int size = 0;

            foreach (var clause in statement.segmentation.Values)
            {
                if (clause.verb == Search.FIND)
                {
                    size++;
                }
            }
            this.clauses = new QClauseSearch[size];
            size         = 0;
            var searches = (from key in statement.segmentation.Keys orderby key select statement.segmentation[key]);

            foreach (var clause in searches)
            {
                if (clause.verb == Search.FIND)
                {
                    this.clauses[size++] = new QClauseSearch((Search)clause);
                }
            }
            this.controls = new QSearchControls(true);
            this.count    = cnt;
        }
Пример #2
0
        public HMICommand(String command)
        {
            this.command  = command.Trim();
            this.warnings = new List <string>();
            this.errors   = new List <string>();

            if (command != null)
            {
                this.statement = new HMIStatement(this, command.Trim());
                if (this.errors.Count == 0)
                {
                    HMICommand.history.Add(this.statement);
                    foreach (var segment in this.statement.segmentation.Values)
                    {
                        if (segment.verb.Equals(Actions.Search.FIND, StringComparison.InvariantCultureIgnoreCase))
                        {
                            HMICommand.current = this.statement;
                            break;
                        }
                    }
                }
            }
        }