public static List <DesktopApplicationTileRegexInfo> GrabRegexInfoFromXml(string startLayout) { var regexMatches = Regex.Matches(startLayout, "<start:DesktopApplicationTile.*.*"); var returnList = new List <DesktopApplicationTileRegexInfo>(); foreach (Match regexMatch in regexMatches) { var regexLine = regexMatch.Groups[0].Value; var desktopApplicationIdStrip = Regex.Match(regexLine, @"DesktopApplicationID=""(.*)"""); var desktopApplicationLinkPathStrip = Regex.Match(regexLine, @"DesktopApplicationLinkPath=""(.*)"""); var returnItem = new DesktopApplicationTileRegexInfo(); if (desktopApplicationIdStrip.Success) { returnItem.DesktopApplicationId = desktopApplicationIdStrip.Groups[1].Value; } if (desktopApplicationLinkPathStrip.Success) { returnItem.DesktopApplicationLinkPath = desktopApplicationLinkPathStrip.Groups[1].Value; } if (returnItem.IsValid) { returnList.Add(returnItem); } } return(returnList); }
public static List<DesktopApplicationTileRegexInfo> GrabRegexInfoFromXml(string startLayout) { var regexMatches = Regex.Matches(startLayout, "<start:DesktopApplicationTile.*.*"); var returnList = new List<DesktopApplicationTileRegexInfo>(); foreach (Match regexMatch in regexMatches) { var regexLine = regexMatch.Groups[0].Value; var desktopApplicationIdStrip = Regex.Match(regexLine, @"DesktopApplicationID=""(.*)"""); var desktopApplicationLinkPathStrip = Regex.Match(regexLine, @"DesktopApplicationLinkPath=""(.*)"""); var returnItem = new DesktopApplicationTileRegexInfo(); if (desktopApplicationIdStrip.Success) returnItem.DesktopApplicationId = desktopApplicationIdStrip.Groups[1].Value; if (desktopApplicationLinkPathStrip.Success) returnItem.DesktopApplicationLinkPath = desktopApplicationLinkPathStrip.Groups[1].Value; if (returnItem.IsValid) returnList.Add(returnItem); } return returnList; }