本文整理汇总了C#中Web.AddIndexedPropertyBagKey方法的典型用法代码示例。如果您正苦于以下问题:C# Web.AddIndexedPropertyBagKey方法的具体用法?C# Web.AddIndexedPropertyBagKey怎么用?C# Web.AddIndexedPropertyBagKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Web
的用法示例。
在下文中一共展示了Web.AddIndexedPropertyBagKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProvisionObjects
public override TokenParser ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation)
{
using (var scope = new PnPMonitoredScope(this.Name))
{
// Check if this is not a noscript site as we're not allowed to write to the web property bag is that one
bool isNoScriptSite = web.IsNoScriptSite();
if (isNoScriptSite)
{
return parser;
}
web.SetPropertyBagValue("_PnP_ProvisioningTemplateId", template.Id != null ? template.Id : "");
web.AddIndexedPropertyBagKey("_PnP_ProvisioningTemplateId");
ProvisioningTemplateInfo info = new ProvisioningTemplateInfo();
info.TemplateId = template.Id != null ? template.Id : "";
info.TemplateVersion = template.Version;
info.TemplateSitePolicy = template.SitePolicy;
info.Result = true;
info.ProvisioningTime = DateTime.Now;
string jsonInfo = JsonConvert.SerializeObject(info);
web.SetPropertyBagValue("_PnP_ProvisioningTemplateInfo", jsonInfo);
}
return parser;
}
示例2: ProvisionObjects
public override void ProvisionObjects(Web web, ProvisioningTemplate template)
{
web.SetPropertyBagValue("_PnP_ProvisioningTemplateId", template.Id != null ? template.Id : "");
web.AddIndexedPropertyBagKey("_PnP_ProvisioningTemplateId");
ProvisioningTemplateInfo info = new ProvisioningTemplateInfo();
info.TemplateId = template.Id != null ? template.Id : "";
info.TemplateVersion = template.Version;
info.TemplateSitePolicy = template.SitePolicy;
info.Result = true;
info.ProvisioningTime = DateTime.Now;
string jsonInfo = JsonConvert.SerializeObject(info);
web.SetPropertyBagValue("_PnP_ProvisioningTemplateInfo", jsonInfo);
}
示例3: ApplyRemoteTemplate
/// <summary>
/// Actual implementation of the apply templates
/// </summary>
/// <param name="web"></param>
/// <param name="template"></param>
internal void ApplyRemoteTemplate(Web web, ProvisioningTemplate template)
{
// Site Security
new ObjectSiteSecurity().ProvisionObjects(web, template);
// Features
new ObjectFeatures().ProvisionObjects(web, template);
// Site Fields
new ObjectField().ProvisionObjects(web, template);
// Content Types
new ObjectContentType().ProvisionObjects(web, template);
// Lists
new ObjectListInstance().ProvisionObjects(web, template);
// Files
new ObjectFiles().ProvisionObjects(web, template);
// Custom actions
new ObjectCustomActions().ProvisionObjects(web, template);
// Composite look (commented)
//new ObjectComposedLook().ProvisionObjects(web, template);
// Property Bag Entries
new ObjectPropertyBagEntry().ProvisionObjects(web, template);
// Extensibility Provider CallOut the last thing we do.
new ObjectExtensibilityProviders().ProvisionObjects(web, template);
web.SetPropertyBagValue("_PnP_ProvisioningTemplateId", template.ID != null ? template.ID : "");
web.AddIndexedPropertyBagKey("_PnP_ProvisioningTemplateId");
ProvisioningTemplateInfo info = new ProvisioningTemplateInfo();
info.TemplateID = template.ID != null ? template.ID : "";
info.TemplateVersion = template.Version;
info.TemplateSitePolicy = template.SitePolicy;
info.Result = true;
info.ProvisioningTime = DateTime.Now;
var s = new JavaScriptSerializer();
string jsonInfo = s.Serialize(info);
web.SetPropertyBagValue("_PnP_ProvisioningTemplateInfo", jsonInfo);
}
示例4: ProvisionObjects
public override TokenParser ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation)
{
using (var scope = new PnPMonitoredScope(this.Name))
{
web.SetPropertyBagValue("_PnP_ProvisioningTemplateId", template.Id != null ? template.Id : "");
web.AddIndexedPropertyBagKey("_PnP_ProvisioningTemplateId");
ProvisioningTemplateInfo info = new ProvisioningTemplateInfo();
info.TemplateId = template.Id != null ? template.Id : "";
info.TemplateVersion = template.Version;
info.TemplateSitePolicy = template.SitePolicy;
info.Result = true;
info.ProvisioningTime = DateTime.Now;
string jsonInfo = JsonConvert.SerializeObject(info);
web.SetPropertyBagValue("_PnP_ProvisioningTemplateInfo", jsonInfo);
}
return parser;
}