Beispiel #1
0
        // ---------------------------------------------------------------------------------------------------------------------------------------------------------
        /// <summary>
        /// Finds objects, within certain scope, having the specified text within the specified properties.
        /// Returns hints on the found objects.
        /// </summary>
        public IList <FoundObjectHint> FindTextInObjects(string SearchedText,
                                                         bool IsCaseSensitive, bool IsInspectingWholeWord,
                                                         bool InScopeComposition, bool InScopeDomain,
                                                         bool IncludeConcepts, bool IncludeRelationships,
                                                         bool IncludeMarkers, bool IncludeOthers,
                                                         bool InPropertyName, bool InPropertyTechName,
                                                         bool InPropertySummary, bool InPropertyDescription,
                                                         bool InPropertyDetailDesignation, bool InPropertyDetailContent,
                                                         bool InPropertyTechSpec)
        {
            DocumentEngine.SearchProviderOfTextNameWithoutPropertyAccessor      = VisualComplement.PROP_FIELD_TEXT;
            DocumentEngine.SearchProviderOfTextExtractorWithoutPropertyAccessor = TextExtractorWithoutPropertyAccessor;
            DocumentEngine.SearchProviderOfObjectTypeDetector = ObjectTypeDetector;

            FoundObjectHint.ClearTemporalDocuments();

            var SearchTrace = new List <object>();
            var Results     = new List <FoundObjectHint>();

            if (InScopeComposition)
            {
                this.FindTextInTargetObject(SearchedText, this.TargetComposition, Results, SearchTrace, "",
                                            IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                            IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                            InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                            InPropertyDetailContent, InPropertyTechSpec);
            }

            if (InScopeDomain)
            {
                if (IncludeConcepts)
                {
                    this.TargetComposition.CompositeContentDomain.ConceptDefinitions.ForEach(condef =>
                                                                                             this.FindTextInTargetObject(SearchedText, condef, Results, SearchTrace, "",
                                                                                                                         IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                                                                                         IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                                                                                         InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                                                                                         InPropertyDetailContent, InPropertyTechSpec));
                }

                if (IncludeRelationships)
                {
                    this.TargetComposition.CompositeContentDomain.RelationshipDefinitions.ForEach(reldef =>
                                                                                                  this.FindTextInTargetObject(SearchedText, reldef, Results, SearchTrace, "",
                                                                                                                              IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                                                                                              IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                                                                                              InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                                                                                              InPropertyDetailContent, InPropertyTechSpec));
                }

                if (IncludeMarkers)
                {
                    this.TargetComposition.CompositeContentDomain.MarkerDefinitions.ForEach(mkrdef =>
                                                                                            this.FindTextInTargetObject(SearchedText, mkrdef, Results, SearchTrace, "",
                                                                                                                        IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                                                                                        IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                                                                                        InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                                                                                        InPropertyDetailContent, InPropertyTechSpec));
                }

                if (IncludeOthers)
                {
                    this.FindTextInTargetObject(SearchedText, this.TargetComposition.CompositeContentDomain, Results, SearchTrace, "",
                                                IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                InPropertyDetailContent, InPropertyTechSpec);

                    this.TargetComposition.CompositeContentDomain.TableDefinitions.Where(tdef => tdef.Alterability != EAlterability.System).ForEach(tabdef =>
                                                                                                                                                    this.FindTextInTargetObject(SearchedText, tabdef, Results, SearchTrace, "",
                                                                                                                                                                                IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                                                                                                                                                IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                                                                                                                                                InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                                                                                                                                                InPropertyDetailContent, InPropertyTechSpec));

                    this.TargetComposition.CompositeContentDomain.BaseTables.ForEach(bastab =>
                                                                                     this.FindTextInTargetObject(SearchedText, bastab, Results, SearchTrace, "",
                                                                                                                 IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                                                                                 IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                                                                                 InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                                                                                 InPropertyDetailContent, InPropertyTechSpec));

                    this.TargetComposition.CompositeContentDomain.LinkRoleVariants.ForEach(variant =>
                                                                                           this.FindTextInTargetObject(SearchedText, variant, Results, SearchTrace, "",
                                                                                                                       IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                                                                                       IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                                                                                       InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                                                                                       InPropertyDetailContent, InPropertyTechSpec));

                    this.TargetComposition.CompositeContentDomain.ExternalLanguages.ForEach(lang =>
                                                                                            this.FindTextInTargetObject(SearchedText, lang, Results, SearchTrace, "",
                                                                                                                        IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                                                                                        IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                                                                                        InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                                                                                        InPropertyDetailContent, InPropertyTechSpec));

                    this.TargetComposition.CompositeContentDomain.ConceptDefClusters.ForEach(lang =>
                                                                                             this.FindTextInTargetObject(SearchedText, lang, Results, SearchTrace, "",
                                                                                                                         IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                                                                                         IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                                                                                         InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                                                                                         InPropertyDetailContent, InPropertyTechSpec));

                    this.TargetComposition.CompositeContentDomain.RelationshipDefClusters.ForEach(lang =>
                                                                                                  this.FindTextInTargetObject(SearchedText, lang, Results, SearchTrace, "",
                                                                                                                              IncludeConcepts, IncludeRelationships, IncludeMarkers, IncludeOthers,
                                                                                                                              IsCaseSensitive, IsInspectingWholeWord, InPropertyName, InPropertyTechName,
                                                                                                                              InPropertySummary, InPropertyDescription, InPropertyDetailDesignation,
                                                                                                                              InPropertyDetailContent, InPropertyTechSpec));
                }
            }

            return(Results);
        }
 private void UserControl_Unloaded(object sender, RoutedEventArgs e)
 {
     FoundObjectHint.ClearTemporalDocuments();
 }