private string GetHrefCTA(WesofHtmlTag value) { string searchFor = "href=\""; int startindex = value.fullTagString.IndexOf(searchFor) + searchFor.Length; if (startindex > -1) { int endindex = value.fullTagString.IndexOf("\"", startindex); if (endindex > -1) { string result = value.fullTagString.Substring(startindex, endindex - startindex); //href type CTA found if (result.Length > 0) { //Is this tag stil relevant (testable), then add the href to the conversion triggers. if (value.testingEnabled == true) { ConversionTrigger trigger = new ConversionTrigger(); trigger.Href = result; if (value.objectType.ToUpper() == Configuration.MVT_MODULES_LIST[0].ToUpper()) { trigger.TestType = TestTypesEnum.ADDTOCARTBUTTON; } ConversionManager.AddConversionTriggerIfnotExists(trigger); } } } } return(null); }
public static void AddConversionTriggerIfnotExists(ConversionTrigger trigger) { for (int i = 0; i < _Triggers.Count; i++) { if (_Triggers[i].Href == trigger.Href) { return; } } _Triggers.Add(trigger); }