public override ProvisioningTemplate ExtractObjects(Web web, ProvisioningTemplate template, ProvisioningTemplateCreationInformation creationInfo) { using (var scope = new PnPMonitoredScope(this.Name)) { web.Context.Load(web, w => w.SupportedUILanguageIds); web.Context.ExecuteQueryRetry(); SupportedUILanguageCollection supportedUILanguageCollection = new SupportedUILanguageCollection(template); foreach (var id in web.SupportedUILanguageIds) { supportedUILanguageCollection.Add(new SupportedUILanguage() { LCID = id }); } if (creationInfo.BaseTemplate != null) { if (!creationInfo.BaseTemplate.SupportedUILanguages.Equals(supportedUILanguageCollection)) { template.SupportedUILanguages = supportedUILanguageCollection; } } else { template.SupportedUILanguages = supportedUILanguageCollection; } } return(template); }
public bool Validate(SupportedUILanguageCollection sourceLanguageSettings, SupportedUILanguageCollection targetLanguageSettings, TokenParser tokenParser) { ProvisioningTemplate sourcePt = new ProvisioningTemplate(); sourcePt.SupportedUILanguages = sourceLanguageSettings; var sourceXml = ExtractElementXml(sourcePt); ProvisioningTemplate targetPt = new ProvisioningTemplate(); targetPt.SupportedUILanguages = targetLanguageSettings; var targetXml = ExtractElementXml(targetPt); return ValidateObjectXML(sourceXml, targetXml, null); }
public bool Validate(SupportedUILanguageCollection sourceLanguageSettings, SupportedUILanguageCollection targetLanguageSettings, TokenParser tokenParser) { ProvisioningTemplate sourcePt = new ProvisioningTemplate(); sourcePt.SupportedUILanguages = sourceLanguageSettings; var sourceXml = ExtractElementXml(sourcePt); ProvisioningTemplate targetPt = new ProvisioningTemplate(); targetPt.SupportedUILanguages = targetLanguageSettings; var targetXml = ExtractElementXml(targetPt); return(ValidateObjectXML(sourceXml, targetXml, null)); }