예제 #1
0
 private void PerformSearchOnActivity(ISearch searchParameters, List <ISearchResult> searchResults, KeyValuePair <Guid, IDev2Activity> resourceActivity, IDev2Activity activity)
 {
     if (activity != null)
     {
         var foundMatch = SearchUtils.FilterText(activity.GetDisplayName(), searchParameters);
         if (foundMatch)
         {
             var resource     = _resourceCatalog.GetResource(GlobalConstants.ServerWorkspaceID, resourceActivity.Key);
             var searchResult = new SearchResult(resource.ResourceID, resource.ResourceName, resource.GetResourcePath(GlobalConstants.ServerWorkspaceID), SearchItemType.ToolTitle, activity.GetDisplayName());
             searchResults.Add(searchResult);
         }
     }
 }
예제 #2
0
        public void SearchUtils_FilterText_MatchingWord2_ShouldReturnTrue()
        {
            var searchValue = new Search.Search
            {
                SearchInput   = "Set",
                SearchOptions = new SearchOptions
                {
                    IsAllSelected       = false,
                    IsToolTitleSelected = true
                }
            };
            var result = SearchUtils.FilterText("this Setasdf", searchValue);

            Assert.IsTrue(result);
        }
예제 #3
0
        public void SearchUtils_FilterText_MatchingWholeWord_RegexShouldReturnTrue()
        {
            var searchValue = new Search.Search
            {
                SearchInput   = "Hello World",
                SearchOptions = new SearchOptions
                {
                    IsAllSelected            = false,
                    IsWorkflowNameSelected   = true,
                    IsMatchCaseSelected      = false,
                    IsMatchWholeWordSelected = true
                }
            };
            var result = SearchUtils.FilterText("Hello World", searchValue);

            Assert.IsTrue(result);
        }
예제 #4
0
        static void GenerateDefsFromXmlNodeList(enDev2ColumnArgumentDirection dev2ColumnArgumentDirection, bool includeNoneDirection, ISearch searchParameters, IList <IDev2Definition> result, XmlNodeList nl, int i)
        {
            var tmpNode = nl[i];

            var ioDirection = DataListUtil.GetDev2ColumnArgumentDirection(tmpNode);

            bool ioDirectionMatch = DataListUtil.CheckIODirection(dev2ColumnArgumentDirection, ioDirection, includeNoneDirection);
            var  wordMatch        = true;

            if (searchParameters != null)
            {
                wordMatch = SearchUtils.FilterText(tmpNode.Name, searchParameters);
            }
            if (ioDirectionMatch && wordMatch)
            {
                GenerateDefsFromXmlNodeList(dev2ColumnArgumentDirection, includeNoneDirection, result, tmpNode);
            }
        }
예제 #5
0
            protected override void GenerateDefsFromXmlNodeList(XmlNodeList nl, int i)
            {
                var tmpNode = nl[i];

                var ioDirection = DataListUtil.GetDev2ColumnArgumentDirection(tmpNode);

                bool ioDirectionMatch = DataListUtil.CheckIODirection(_dev2ColumnArgumentDirection, ioDirection, _includeNoneDirection);
                var  wordMatch        = true;

                if (_searchParameters != null)
                {
                    wordMatch = SearchUtils.FilterText(tmpNode.Name, _searchParameters);
                }
                if (ioDirectionMatch && wordMatch)
                {
                    GenerateDefsFromXmlNodeList(_dev2ColumnArgumentDirection, _includeNoneDirection, _result, tmpNode);
                }
            }
예제 #6
0
        public List <ISearchResult> GetSearchResults(ISearch searchParameters)
        {
            var searchResults = new List <ISearchResult>();

            if (searchParameters.SearchOptions.IsWorkflowNameSelected)
            {
                var allResources = _resourceCatalog.GetResources(GlobalConstants.ServerWorkspaceID).Where(res => res.ResourceType != "ReservedService");
                foreach (var resource in allResources)
                {
                    if (SearchUtils.FilterText(resource.ResourceName, searchParameters))
                    {
                        var searchItemType = resource.IsSource ? SearchItemType.SourceName : SearchItemType.WorkflowName;
                        var searchResult   = new SearchResult(resource.ResourceID, resource.ResourceName, resource.GetResourcePath(GlobalConstants.ServerWorkspaceID), searchItemType, resource.ResourceName);
                        searchResults.Add(searchResult);
                    }
                }
            }
            return(searchResults);
        }
예제 #7
0
        public List <ISearchResult> GetSearchResults(ISearch searchParameters)
        {
            var foundItems = new List <ISearchResult>();

            if (searchParameters.SearchOptions.IsTestNameSelected)
            {
                var tests = _testCatalog.FetchAllTests();
                foreach (var test in tests)
                {
                    var found = SearchUtils.FilterText(test.TestName, searchParameters);
                    if (found)
                    {
                        var resource     = _resourceCatalog.GetResource(GlobalConstants.ServerWorkspaceID, test.ResourceId);
                        var searchResult = new SearchResult(resource.ResourceID, resource.ResourceName, resource.GetResourcePath(GlobalConstants.ServerWorkspaceID), SearchItemType.TestName, test.TestName);
                        foundItems.Add(searchResult);
                    }
                }
            }
            return(foundItems);
        }