コード例 #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
ファイル: SearchUtilTests.cs プロジェクト: tuga1975/Warewolf
        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
ファイル: SearchUtilTests.cs プロジェクト: tuga1975/Warewolf
        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
ファイル: CommonDataUtils.cs プロジェクト: tuga1975/Warewolf
        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
ファイル: ResourceSearcher.cs プロジェクト: kapiya/Warewolf
        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
ファイル: TestSearcher.cs プロジェクト: tuga1975/Warewolf
        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);
        }