FindStringInItem() public method

Find the count of found searches in item: - add item to l_items - update item to l_items if item is already available
public FindStringInItem ( EA object_type, string GUID ) : int
object_type EA
GUID string
return int
        public static void doRecursiveEl(EA.Repository rep, EA.Element el, FindAndReplace fr)
        {
            // perform element
            if (fr.isElementSearch)
            {
                fr.FindStringInItem(EA.ObjectType.otElement, el.ElementGUID);
                if (fr.isTagSearch)
                {
                    FindMatchingElementTaggedValue(rep, el, fr);
                }
            }

            if (fr.isAttributeSearch)
            {
                foreach (EA.Attribute a in el.Attributes)
                {
                    fr.FindStringInItem(EA.ObjectType.otAttribute, a.AttributeGUID);
                    if (fr.isTagSearch)
                    {
                        FindMatchingAttributeTaggedValue(rep, a, fr);
                    }
                }
            }
            if (fr.isOperationSearch)
            {
                foreach (EA.Method m in el.Methods)
                {
                    fr.FindStringInItem(EA.ObjectType.otMethod, m.MethodGUID);
                    if (fr.isTagSearch)
                    {
                        FindMatchingMethodTaggedValue(rep, m, fr);
                    }
                }
            }

            // perform diagrams of package
            if (fr.isDiagramSearch)
            {
                foreach (EA.Diagram dia in el.Diagrams)
                {
                    if (dia != null)
                    {
                        fr.FindStringInItem(EA.ObjectType.otDiagram, dia.DiagramGUID);
                    }
                }
            }
            //run all elements
            foreach (EA.Element elTrgt in el.Elements)
            {
                doRecursiveEl(rep, elTrgt, fr);
            }

            return;
        }
        public static void doRecursiveEl(EA.Repository rep, EA.Element el, FindAndReplace fr)
        {
            // perform element
            if (fr.isElementSearch)
            {
                fr.FindStringInItem(EA.ObjectType.otElement, el.ElementGUID);
                if (fr.isTagSearch)   FindMatchingElementTaggedValue(rep, el, fr);
            }

            if (fr.isAttributeSearch)
            {
                foreach (EA.Attribute a in el.Attributes)
                {
                    fr.FindStringInItem(EA.ObjectType.otAttribute, a.AttributeGUID);
                    if (fr.isTagSearch) FindMatchingAttributeTaggedValue(rep, a, fr);
                }
            }
            if (fr.isOperationSearch)
            {
                foreach (EA.Method m in el.Methods)
                {
                    fr.FindStringInItem(EA.ObjectType.otMethod, m.MethodGUID);
                    if (fr.isTagSearch) FindMatchingMethodTaggedValue(rep, m, fr);
                }
            }
            
            // perform diagrams of package
            if (fr.isDiagramSearch)
            {
                foreach (EA.Diagram dia in el.Diagrams)
                {
                    if (dia != null) fr.FindStringInItem(EA.ObjectType.otDiagram, dia.DiagramGUID);
                }
            }
            //run all elements
            foreach (EA.Element elTrgt in el.Elements)
            {
                doRecursiveEl(rep, elTrgt, fr);
            }
            
            return;
        }
        public static void doRecursivePkg(EA.Repository rep, EA.Package pkg, FindAndReplace fr)
        {
            // perform package
            if (fr.isPackageSearch)
            {
                fr.FindStringInItem(EA.ObjectType.otPackage, pkg.PackageGUID);
                if (fr.isTagSearch)
                {
                    // tagged values are beneath element with the same Id
                    EA.Element el = rep.GetElementByGuid(pkg.PackageGUID);
                    if (el != null)
                    {
                        FindMatchingPackageTaggedValue(rep, pkg, fr);
                    }
                }
            }

            // perform diagrams of package
            if (fr.isDiagramSearch)
            {
                foreach (EA.Diagram dia in pkg.Diagrams)
                {
                    if (dia != null)
                    {
                        fr.FindStringInItem(EA.ObjectType.otDiagram, dia.DiagramGUID);
                    }
                }
            }
            // run elements of package
            foreach (EA.Element el in pkg.Elements)
            {
                doRecursiveEl(rep, el, fr);
            }

            // run packages of package
            foreach (EA.Package pkgTrgt in pkg.Packages)
            {
                doRecursivePkg(rep, pkgTrgt, fr);
            }
            return;
        }
        public static void doRecursivePkg(EA.Repository rep, EA.Package pkg, FindAndReplace fr)
        {
            // perform package
            if (fr.isPackageSearch)
            {
                fr.FindStringInItem(EA.ObjectType.otPackage, pkg.PackageGUID);
                if (fr.isTagSearch)
                {
                    // tagged values are beneath element with the same Id
                    EA.Element el = rep.GetElementByGuid(pkg.PackageGUID);
                    if (el != null)   FindMatchingPackageTaggedValue(rep, pkg, fr);
                }

            }

            // perform diagrams of package
            if (fr.isDiagramSearch)
            {
                foreach (EA.Diagram dia in pkg.Diagrams)
                {
                    if (dia != null) fr.FindStringInItem(EA.ObjectType.otDiagram, dia.DiagramGUID);
                }
            }
            // run elements of package
            foreach (EA.Element el in pkg.Elements)
            {
                doRecursiveEl(rep, el, fr);
            }
            
            // run packages of package
            foreach (EA.Package pkgTrgt in pkg.Packages)
            {
                doRecursivePkg(rep, pkgTrgt, fr);
            }
            return;
        }