private void SetRepositoryItemDetails(GingerRepositoryItem repoItem)
        {
            //get the XML reader
            XmlReader xmlReader = GingerATSXmlReader.GetXMLReaderFromFile(repoItem.FilePath);

            if (xmlReader != null)
            {
                //get the details from the xml
                if (GingerATSXmlReader.MoveXmlReaderToSpecificNode(xmlReader, GingerRepositoryItem.GetRepoItemMainXmlNodeName(repoItem.Type)))
                {
                    repoItem.Name       = xmlReader.GetAttribute(GingerRepositoryItem.GetRepoItemNameFieldLabel(repoItem.Type));
                    repoItem.GUID       = xmlReader.GetAttribute(eGeneralGingerRepoAttributes.Guid.ToString());
                    repoItem.ExternalID = xmlReader.GetAttribute(eGeneralGingerRepoAttributes.ExternalID.ToString());
                    if (repoItem.ExternalID == null)
                    {
                        repoItem.ExternalID = "Null";
                    }
                    repoItem.LastUpdated = xmlReader.GetAttribute(eGeneralGingerRepoAttributes.LastUpdate.ToString());

                    repoItem.XmlFileDetails = GingerRepositoryItem.GetRepoItemTypeLabelInIndexer(repoItem.Type) + ";" +
                                              repoItem.Name + ";" +
                                              repoItem.GUID + ";" +
                                              repoItem.ExternalID + ";" +
                                              repoItem.FilePath + ";" +
                                              repoItem.LastUpdated;
                }
            }

            xmlReader.Close();
        }
        public GingerRepositoryItem GetGingerRepositoryItem(eGingerRepoItemType itemType, string itemExternalID, List <string> indexerRecords = null)
        {
            GingerRepositoryItem repoItem = null;

            if (indexerRecords == null)
            {
                indexerRecords = ReadRepositoryIndexerData();
            }
            foreach (string indexerRecord in indexerRecords)
            {
                string[] indexerRecordDetails = indexerRecord.Split(';');
                if (indexerRecordDetails != null && indexerRecordDetails.Length == 6)
                {
                    string aTSExternalID = String.Empty;
                    if ((indexerRecordDetails.Length > 3) && (indexerRecordDetails[3] != null) && (indexerRecordDetails[3].ToString() != string.Empty))
                    {
                        if ((indexerRecordDetails[3].Contains('|')) && (indexerRecordDetails[3].Contains('=')))
                        {
                            aTSExternalID = indexerRecordDetails[3].Split('|').Last().Split('=').Last();
                        }
                        else
                        {
                            aTSExternalID = indexerRecordDetails[3];
                        }
                    }
                    if ((indexerRecordDetails[0] == GingerRepositoryItem.GetRepoItemTypeLabelInIndexer(itemType)) &&
                        (aTSExternalID == itemExternalID))
                    {
                        repoItem             = new GingerRepositoryItem(itemType);
                        repoItem.Name        = indexerRecordDetails[1];
                        repoItem.GUID        = indexerRecordDetails[2];
                        repoItem.ExternalID  = aTSExternalID;
                        repoItem.FilePath    = indexerRecordDetails[4];
                        repoItem.LastUpdated = indexerRecordDetails[5];
                        break;
                    }
                }
            }

            return(repoItem);
        }