public override int GetHashCode()
        {
            int hash = 1;

            if (matchPatternCase_ == MatchPatternOneofCase.NullMatch)
            {
                hash ^= NullMatch.GetHashCode();
            }
            if (matchPatternCase_ == MatchPatternOneofCase.DoubleMatch)
            {
                hash ^= DoubleMatch.GetHashCode();
            }
            if (matchPatternCase_ == MatchPatternOneofCase.StringMatch)
            {
                hash ^= StringMatch.GetHashCode();
            }
            if (matchPatternCase_ == MatchPatternOneofCase.BoolMatch)
            {
                hash ^= BoolMatch.GetHashCode();
            }
            if (matchPatternCase_ == MatchPatternOneofCase.PresentMatch)
            {
                hash ^= PresentMatch.GetHashCode();
            }
            if (matchPatternCase_ == MatchPatternOneofCase.ListMatch)
            {
                hash ^= ListMatch.GetHashCode();
            }
            hash ^= (int)matchPatternCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        private void InitializeMatch()
        {
            DataTable resRequete = Connexion("SELECT * FROM dbo.MATCH");

            foreach (DataRow row in resRequete.Rows)
            {
                Object[] rowDetails = row.ItemArray;
                ListMatch.Add(new Match());
            }
        }
        public void MergeFrom(ValueMatcher other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.MatchPatternCase)
            {
            case MatchPatternOneofCase.NullMatch:
                if (NullMatch == null)
                {
                    NullMatch = new global::Envoy.Type.Matcher.ValueMatcher.Types.NullMatch();
                }
                NullMatch.MergeFrom(other.NullMatch);
                break;

            case MatchPatternOneofCase.DoubleMatch:
                if (DoubleMatch == null)
                {
                    DoubleMatch = new global::Envoy.Type.Matcher.DoubleMatcher();
                }
                DoubleMatch.MergeFrom(other.DoubleMatch);
                break;

            case MatchPatternOneofCase.StringMatch:
                if (StringMatch == null)
                {
                    StringMatch = new global::Envoy.Type.Matcher.StringMatcher();
                }
                StringMatch.MergeFrom(other.StringMatch);
                break;

            case MatchPatternOneofCase.BoolMatch:
                BoolMatch = other.BoolMatch;
                break;

            case MatchPatternOneofCase.PresentMatch:
                PresentMatch = other.PresentMatch;
                break;

            case MatchPatternOneofCase.ListMatch:
                if (ListMatch == null)
                {
                    ListMatch = new global::Envoy.Type.Matcher.ListMatcher();
                }
                ListMatch.MergeFrom(other.ListMatch);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Attempts matching this instruction against a list of other instructions (or a part of said list).
 /// </summary>
 /// <param name="listMatch">Stores state about the current list match.</param>
 /// <param name="match">The match object, used to store global state during the match (such as the results of capture groups).</param>
 /// <returns>Returns whether the (partial) match was successful.
 /// If the method returns true, it updates listMatch.SyntaxIndex to point to the next node that was not part of the match,
 /// and adds the capture groups (if any) to the match.
 /// If the method returns false, the listMatch and match objects remain in a partially-updated state and need to be restored
 /// before they can be reused.</returns>
 protected internal virtual bool PerformMatch(ref ListMatch listMatch, ref Match match)
 {
     // Base implementation expects the node to match a single element.
     // Any patterns matching 0 or more than 1 element must override this method.
     if (listMatch.SyntaxIndex < listMatch.SyntaxList.Count)
     {
         if (PerformMatch(listMatch.SyntaxList[listMatch.SyntaxIndex], ref match))
         {
             listMatch.SyntaxIndex++;
             return(true);
         }
     }
     return(false);
 }