public GetResourceTokenResourceValues ( string tokenValue ) : string>>.List |
||
tokenValue | string | |
return | string>>.List |
public List<Tuple<string, string>> GetResourceTokenResourceValues(string tokenValue)
{
List<Tuple<string, string>> resourceValues = new List<Tuple<string, string>>();
var resourceTokens = _tokens.Where(t => t is LocalizationToken && t.GetTokens().Contains(tokenValue));
foreach (LocalizationToken resourceToken in resourceTokens)
{
var entries = resourceToken.ResourceEntries;
foreach (var entry in entries)
{
CultureInfo ci = new CultureInfo((int)entry.LCID);
resourceValues.Add(new Tuple<string, string>(ci.Name, entry.Value));
}
}
return resourceValues;
}
public bool ValidateWebPartOnPages(ProvisioningTemplate template, TokenParser parser) { var web = cc.Web; var file = template.Files.First(); var folderName = parser.ParseString(file.Folder); var url = folderName + "/" + template.Connector.GetFilenamePart(file.Src); var resourceValues = parser.GetResourceTokenResourceValues(file.WebParts.First().Title); var ok = ValidatePartOnPage(parser, resourceValues, web, url); if (!ok) return false; var page = template.Pages.First(); url = parser.ParseString(page.Url); resourceValues = parser.GetResourceTokenResourceValues(file.WebParts.First().Title); ok = ValidatePartOnPage(parser, resourceValues, web, url); return ok; }