Microsoft.Protocols.TestSuites.SharedAdapter.RootNodeObject.RootNodeObjectBuilder.FindByExGuid C# (CSharp) Method

FindByExGuid() private method

This method is used to find the object group data element using the specified extended GUID.
If not found, throw the InvalidOperationException exception.
private FindByExGuid ( List objectGroupList, ExGuid extendedGuid, ObjectGroupObjectDeclare &declare ) : ObjectGroupObjectData
objectGroupList List Specify the object group data element list.
extendedGuid ExGuid Specify the extended GUID.
declare ObjectGroupObjectDeclare Specify the output of ObjectGroupObjectDeclare.
return ObjectGroupObjectData
            private ObjectGroupObjectData FindByExGuid(List<ObjectGroupDataElementData> objectGroupList, ExGuid extendedGuid, out ObjectGroupObjectDeclare declare)
            {
                foreach (ObjectGroupDataElementData objectGroup in objectGroupList)
                {
                    int findIndex = objectGroup.ObjectGroupDeclarations.ObjectDeclarationList.FindIndex(objDeclare => objDeclare.ObjectExtendedGUID.Equals(extendedGuid));

                    if (findIndex == -1)
                    {
                        continue;
                    }

                    declare = objectGroup.ObjectGroupDeclarations.ObjectDeclarationList[findIndex];
                    return objectGroup.ObjectGroupData.ObjectGroupObjectDataList[findIndex];
                }

                throw new InvalidOperationException("Cannot find the " + extendedGuid.GUID.ToString());
            }
        }
RootNodeObject.RootNodeObjectBuilder