Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return(string.Format("In {0} Collection, Return all Records with {1} {2} {3}",
                          collectionId != null ? collectionId : "any",
                          property,
                          operation.ToString(),
                          value));
 }
Beispiel #2
0
        /// <summary>
        /// Method to search for the specified value for the given property.
        /// </summary>
        /// <param name="name">Property to search</param>
        /// <param name="op">Query operation</param>
        /// <param name="value">Value to match</param>
        /// <param name="type">The type of the value.</param>
        /// <param name="shouldMatch">If true the search should return a result.</param>
        private void internalSearch(string name, SearchOp op, string value, Syntax type, bool shouldMatch)
        {
            IResultSet results;
            bool       foundMatch = false;

            //results = provider.Search(new Query(name, op, value, type));
            results = provider.Search(new Query(collectionId, name, op, value, type));
            if (results != null)
            {
                char [] buf = new char[4096];
                int     len;
                while ((len = results.GetNext(ref buf)) != 0)
                {
                    foundMatch = true;
                    //writeXml(new string(buf, 0, len));
                }
                if ((shouldMatch && !foundMatch) || (!shouldMatch && foundMatch))
                {
                    Console.WriteLine(string.Format("Failed searching for \"{0}\" {1} \"{2}\" type = {3}", name, op.ToString(), value, type));
                    //throw (new ApplicationException(string.Format("Searching for \"{0}\" {1} \"{2}\" type = {3}", name, op.ToString(), value, type)));
                }
                results.Dispose();
            }
        }