本文整理汇总了C#中ConfigManager.GetPropertyBag方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigManager.GetPropertyBag方法的具体用法?C# ConfigManager.GetPropertyBag怎么用?C# ConfigManager.GetPropertyBag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigManager
的用法示例。
在下文中一共展示了ConfigManager.GetPropertyBag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateChildControls
protected override void CreateChildControls() {
this.Controls.Clear();
if (ControlTemplate == null)
throw new System.ArgumentException(SPResource.GetString("InvalidControlTemplate", new object[] {
"FabricListFieldIterator"
}));
var pageLayout = new FabricPageLayout();
SPControlMode controlMode = SPControlMode.New;
ConfigManager configManager = new ConfigManager();
IPropertyBag propertyBag = configManager.GetPropertyBag(ConfigScope.Web);
if (!this.List.ContentTypesEnabled) {
pageLayout = configManager.GetPropertyBag<FabricPageLayout>("List" + List.ID.ToString() + controlMode, propertyBag);
} else {
pageLayout = configManager.GetPropertyBag<FabricPageLayout>("ListContentType" + List.ID.ToString() + this.ListItem.ContentTypeId + controlMode, propertyBag);
if (pageLayout != null) {
pageLayout = configManager.GetPropertyBag<FabricPageLayout>("SiteContentType" + this.ListItem.ContentTypeId + controlMode, propertyBag);
}
}
if (pageLayout != null && pageLayout.Rows.Count() > 0) {
foreach (var row in pageLayout.Rows) {
var gridRow = new HtmlGenericControl("div");
gridRow.Attributes.Add("class", "row");
this.Controls.Add(gridRow);
if (row.Count() > 0) {
foreach (var col in row) {
var field = Fields.Cast<SPField>().Where(f => f.Title == col.Title || f.InternalName == col.InternalName).FirstOrDefault();
if (field != null && !IsFieldExcluded(field)) {
AddTemplateContainer(gridRow, field, col.ClassName);
}
}
} else {
var hr = new HtmlGenericControl("hr");
gridRow.Controls.Add(hr);
}
}
} else {
foreach (SPField field in Fields) {
AddTemplateContainer(this, field);
}
}
}
示例2: Set
protected virtual void Set(SPControlMode controlMode, FabricPageLayout pageLayout) {
ConfigManager configManager = new ConfigManager();
if (List != null && ContentType != null) {
ContentType.SetFormTempalteName(controlMode, "FabricListForm");
//IPropertyBag propertyBag = configManager.GetPropertyBag(ConfigScope.List);
IPropertyBag propertyBag = configManager.GetPropertyBag(ConfigScope.Web);
configManager.SetPropertyBag("ListContentType" + List.ID.ToString() + ContentType.Id + controlMode, pageLayout, propertyBag);
} else if (List != null) {
List.SetFormTempalteName(controlMode, "FabricListForm");
IPropertyBag propertyBag = configManager.GetPropertyBag(ConfigScope.Web);
configManager.SetPropertyBag("List" + List.ID.ToString() + controlMode, pageLayout, propertyBag);
} else if (ContentType != null) {
ContentType.SetFormTempalteName(controlMode, "FabricListForm");
//IPropertyBag propertyBag = configManager.GetPropertyBag(ConfigScope.List);
IPropertyBag propertyBag = configManager.GetPropertyBag(ConfigScope.Web);
configManager.SetPropertyBag("SiteContentType" + ContentType.Id + controlMode, pageLayout, propertyBag);
}
}