当前位置: 首页>>代码示例>>C#>>正文


C# ConfigManager.GetPropertyBag方法代码示例

本文整理汇总了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);
                }
            }
        }
开发者ID:RunLola,项目名称:Practices.SharePoint,代码行数:41,代码来源:FabricListFieldIterator.cs

示例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);
     }
 }
开发者ID:RunLola,项目名称:Practices.SharePoint,代码行数:18,代码来源:PageLayoutSettings.aspx.cs


注:本文中的ConfigManager.GetPropertyBag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。