示例#1
0
        public IArray Find(IFind ifind_0)
        {
            IArray array    = null;
            bool   contains = this.chkContains.Checked;
            string text     = this.cboSearchString.Text;

            this.m_strSearch = this.cboSearchString.Text;
            string[] fields = new string[1];
            switch (this.radioGroup.SelectedIndex)
            {
            case 0:
                array = ifind_0.Find(text, contains, ifind_0.FindFields, null);
                this.m_strFindField = "所有字段";
                return(array);

            case 1:
                fields[0]           = this.cboFields.Text;
                array               = ifind_0.Find(text, contains, fields, null);
                this.m_strFindField = this.cboFields.Text;
                return(array);
            }
            fields[0]           = ifind_0.FindDisplayField;
            array               = ifind_0.Find(text, contains, fields, null);
            this.m_strFindField = ifind_0.FindDisplayField;
            return(array);
        }
示例#2
0
        public void TestFind()
        {
            var types = _finder.Find <IA>();

            Assert.Single(types);
            Assert.Equal(typeof(A), types[0]);
        }
示例#3
0
 /// <summary>
 /// Finds all matching elements. Does not throw exceptions; an empty enumeration is returned if any errors occur.
 /// </summary>
 /// <param name="this">The finder.</param>
 /// <param name="context">The context of the search. All results should be within this context.</param>
 /// <param name="searchText">The search string used to match the elements.</param>
 public static IReadOnlyCollection <IWebElement> TryFind(this IFind @this, ISearchContext context, string searchText)
 {
     try
     {
         return(@this.Find(context, searchText).Where(x => x.Displayed).ToList());
     }
     catch
     {
         return(new IWebElement[0]);
     }
 }
示例#4
0
        /// <summary>
        /// find the book usinf criterion
        /// </summary>
        /// <param name="obj">search this object in list</param>
        /// <param name="criterion">criterion which is used to define the way of finding</param>
        /// <returns></returns>
        public List <Book> FindBookByTag(IFind criterion)
        {
            log.Debug("Try to find book by tag");
            List <Book> findList = new List <Book>();

            findList = listBooks.FindAll(book => criterion.Find(book));

            if (findList.Count == 0)
            {
                log.Trace("The book was not found");
                throw new ArgumentException();
            }
            else
            {
                log.Debug("The book was found by tag");
                return(findList);
            }
        }
示例#5
0
 /// <summary>
 /// 获取类型集合
 /// </summary>
 private Type[] GetTypes <T>()
 {
     return(_finder.Find <T>(_assemblies).ToArray());
 }
 /// <summary>
 /// 获取类型集合
 /// </summary>
 private Type[] GetTypes(Type type)
 {
     return(_finder.Find(type, _assemblies).ToArray());
 }