本文整理汇总了C#中OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.TokenParser.GetResourceTokenResourceValues方法的典型用法代码示例。如果您正苦于以下问题:C# TokenParser.GetResourceTokenResourceValues方法的具体用法?C# TokenParser.GetResourceTokenResourceValues怎么用?C# TokenParser.GetResourceTokenResourceValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.TokenParser
的用法示例。
在下文中一共展示了TokenParser.GetResourceTokenResourceValues方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateWebPartOnPages
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;
}
示例2: ValidateResourceEntries
private bool ValidateResourceEntries(TokenParser sParser, TokenParser tParser, string sTokenValue, string tTokenValue)
{
int sCount = 0;
int tCount = 0;
bool isValid = false;
var sResValues = sParser.GetResourceTokenResourceValues(sTokenValue);
var tResValues = tParser.GetResourceTokenResourceValues(tTokenValue);
foreach (var sResVal in sResValues)
{
sCount++;
var tResItem = tResValues.Where(t => t.Item1.ToLower().Equals(sResVal.Item1.ToLower())).FirstOrDefault();
if (tResItem != null && tResItem.Item2.ToLower() == sResVal.Item2.ToLower())
{
tCount++;
break;
}
}
if (sCount == tCount) { isValid = true; }
return isValid;
}
示例3: ValidateListView
public bool ValidateListView(ProvisioningTemplate template, TokenParser parser)
{
var web = cc.Web;
cc.Load(web.Lists);
cc.ExecuteQueryRetry();
var allOk = true;
foreach (var listDef in template.Lists)
{
var list = web.GetListByUrl(listDef.Url);
foreach (var viewDef in listDef.Views)
{
XElement currentXml = XElement.Parse(viewDef.SchemaXml);
var viewUrl = currentXml.Attribute("Url").Value;
var dispName = currentXml.Attribute("DisplayName").Value;
if (dispName.ContainsResourceToken())
{
var resourceValues = parser.GetResourceTokenResourceValues(dispName);
foreach (var resourceValue in resourceValues)
{
list.Context.PendingRequest.RequestExecutor.WebRequest.Headers["Accept-Language"] = resourceValue.Item1;
list.Context.Load(list.Views);
list.Context.ExecuteQueryRetry();
var view = list.Views.Single(v => v.ServerRelativeUrl.EndsWith(viewUrl));
if (!view.Title.Equals(resourceValue.Item2)) {
allOk = false;
}
}
}
}
}
return allOk;
}