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


C# ItemDefinition类代码示例

本文整理汇总了C#中ItemDefinition的典型用法代码示例。如果您正苦于以下问题:C# ItemDefinition类的具体用法?C# ItemDefinition怎么用?C# ItemDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ItemDefinition类属于命名空间,在下文中一共展示了ItemDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddEditableText

 private void AddEditableText(ItemDefinition definition, string title, string name, int sortOrder, int maxLength)
 {
     EditableTextBoxAttribute titleEditor = new EditableTextBoxAttribute(title, sortOrder, maxLength);
     titleEditor.Name = name;
     titleEditor.ContainerName = "seo";
     definition.Add(titleEditor);
 }
开发者ID:joaohortencio,项目名称:n2cms,代码行数:7,代码来源:SEODefinitionAppender.cs

示例2: Refine

        public override void Refine(ItemDefinition currentDefinition)
        {
			if (InstallerVisibility != InstallerHint.Default)
				currentDefinition.Installer = InstallerVisibility;

            base.Refine(currentDefinition);
        }
开发者ID:EzyWebwerkstaden,项目名称:n2cms,代码行数:7,代码来源:PageDefinitionAttribute.cs

示例3: PrefetchData

 // Methods
 public PrefetchData(ItemDefinition itemDefinition, ID parentId)
 {
     Assert.ArgumentNotNull(itemDefinition, "itemDefinition");
     Assert.ArgumentNotNull(parentId, "parentId");
     this._itemDefinition = itemDefinition;
     this._parentId = parentId;
 }
开发者ID:dsolovay,项目名称:SitecoreData,代码行数:8,代码来源:PrefetchData.cs

示例4: Refine

 public void Refine(ItemDefinition currentDefinition, IList<ItemDefinition> allDefinitions)
 {
     if (currentDefinition.ItemType.IsAssignableFrom(typeof (BlogContainer)))
     {
         currentDefinition.AllowedChildFilters.Add(this);
     }
 }
开发者ID:pauldotknopf,项目名称:N2Bootstrap.Blog,代码行数:7,代码来源:BlogContainerIntegrityAttribute.cs

示例5: DraggableToolbar

        public DraggableToolbar(ContentItem item, ItemDefinition definition)
        {
            if (definition == null) throw new ArgumentNullException("definition");

            this.currentItem = item;
            this.definition = definition;
        }
开发者ID:AnonymousRetard,项目名称:n2cms,代码行数:7,代码来源:DragToolbar.cs

示例6: IsUnfiltered

		public bool IsUnfiltered(ItemDefinition d)
		{
			if(RemovedTypes == null)
				return true;

			return !RemovedTypes.Any(rt => rt.IsAssignableFrom(d.ItemType));
		}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:7,代码来源:EditableDefinitionAttribute.cs

示例7: AddDefinedEditors

        public override IDictionary<string, System.Web.UI.Control> AddDefinedEditors(ItemDefinition definition, N2.ContentItem item, System.Web.UI.Control container, System.Security.Principal.IPrincipal user, Type containerTypeFilter, IEnumerable<string> editableNameFilter)
        {
            ItemDefinition cloned = null;

            // add a "wrap in container" checkbox to all parts that are within zones that are not wrapped in a container (BeforeMain, AfterMain).
            if (!definition.IsPage)
            {
                if (!(Defaults.IsContainerWrappable(item.ZoneName) ||
                      Defaults.IsContainerWrappable(System.Web.HttpContext.Current.Request["zoneName"])))
                {
                    cloned = definition.Clone();
                    var isWrappable = cloned.Editables.FirstOrDefault(x => x.Name == "UseContainer");
                    if (isWrappable != null)
                    {
                        cloned.Editables.Remove(isWrappable);
                    }
                }
            }

            if (item is IItemAdapter)
            {
                var result = (item as IItemAdapter).AddDefinedEditors(cloned ?? definition, container, user, containerTypeFilter, editableNameFilter);
                if (result != null)
                    return result;
            }
            return base.AddDefinedEditors(cloned ?? definition, item, container, user, containerTypeFilter, editableNameFilter);
        }
开发者ID:n2cms,项目名称:N2Bootstrap,代码行数:27,代码来源:ModelAdapter.cs

示例8: ChangeTemplateThrowsIfNoDbItemFound

    public void ChangeTemplateThrowsIfNoDbItemFound([Greedy]FakeDataProvider sut, ItemDefinition def, TemplateChangeList changes)
    {
      Action action = () => sut.ChangeTemplate(def, changes, null);

      action.ShouldThrow<InvalidOperationException>()
            .WithMessage("Unable to change item template. The item '{0}' is not found.".FormatWith(def.ID));
    }
开发者ID:dharnitski,项目名称:Sitecore.FakeDb,代码行数:7,代码来源:FakeDataProviderTest.cs

示例9: AddChildIDsForContactFacetItem

        protected virtual void AddChildIDsForContactFacetItem(IDList ids, ItemDefinition itemDefinition, CallContext context)
        {
            var facetName = IDTableHelper.GetFacetName(itemDefinition.ID);
            var contractType = ContactFacetHelper.GetContractTypeForFacet(facetName);
            
            foreach (string memberName in FacetReflectionUtil.NonFacetMemberNames(contractType))
            {
                var id = IDTableHelper.GenerateIdForFacetMember(memberName, itemDefinition.ID,
                            Sitecore.Strategy.Contacts.DataProviders.TemplateIDs.ContactFacetMemberTemplate);

                ids.Add(id);
            }

            foreach (string memberName in FacetReflectionUtil.FacetMemberNames(contractType))
            {
                foreach (
                    string subMemberName in
                        FacetReflectionUtil.NonFacetMemberNames(contractType.GetProperty(memberName).PropertyType))
                {
                    string key = $"{memberName}{NestedFacets.Delimeter}{subMemberName}";

                    var id = IDTableHelper.GenerateIdForFacetMember(key, itemDefinition.ID,
                        Sitecore.Strategy.Contacts.DataProviders.TemplateIDs.ContactFacetMemberTemplate);

                    ids.Add(id);
                }
            }
        }
开发者ID:boro2g,项目名称:sitecore-contact-utilities,代码行数:28,代码来源:DefaultProcessor.cs

示例10: GetTemplates

 public IEnumerable<TemplateDefinition> GetTemplates(ItemDefinition definition)
 {
     return Definitions.GetTemplates(definition.ItemType)
         .AllowedBelow(Definitions.GetDefinition(Selection.SelectedItem), Selection.SelectedItem, Engine.Definitions)
         .Where(t => t.Definition.IsAllowed(ZoneName, User))
         .OrderBy(t => (t.Definition.TemplateKey ?? "Index") == "Index" ? 0 : 1)
         .ThenBy(t => t.Definition.SortOrder);
 }
开发者ID:joshuaanderson,项目名称:n2cms,代码行数:8,代码来源:New.aspx.cs

示例11: AllowedBelow

 public static IEnumerable<TemplateDefinition> AllowedBelow(this IEnumerable<TemplateDefinition> allTemplates, ItemDefinition parentDefinition, ContentItem parentItem, IDefinitionManager definitions)
 {
     foreach (var template in allTemplates)
     {
         if (IsAllowed(template.Definition, parentItem, parentDefinition, definitions))
             yield return template;
     }
 }
开发者ID:timothyyip,项目名称:n2cms,代码行数:8,代码来源:DefinitionExtensions.cs

示例12: Refine

 /// <summary>Changes allowed parents on the item definition.</summary>
 /// <param name="currentDefinition">The definition to alter.</param>
 /// <param name="allDefinitions">All definitions.</param>
 public override void Refine(ItemDefinition currentDefinition, IList<ItemDefinition> allDefinitions)
 {
     foreach (ItemDefinition definition in allDefinitions)
     {
         if (IsAssignable(definition.ItemType))
             definition.AddAllowedChild(currentDefinition);
     }
 }
开发者ID:spmason,项目名称:n2cms,代码行数:11,代码来源:RestrictParentsAttribute.cs

示例13: GetChildIDs

 public override IDList GetChildIDs(ItemDefinition itemDefinition, CallContext context)
 {
     if (itemDefinition != null && itemDefinition.ID == JoinParentId)
     {
         Log.Info(string.Format("GetChildIDs called with itemDefinition id = {0}, name = {1} (BasicDataProvider)", itemDefinition.ID, itemDefinition.Name), this);
     }
     return null;
 }
开发者ID:hermanussen,项目名称:Sitecore-BasicDataProvider,代码行数:8,代码来源:BasicDataProvider2.cs

示例14: Refine

		public override void Refine(ItemDefinition currentDefinition, IList<ItemDefinition> allDefinitions)
		{
			if (AffectedType != null && !AffectedType.IsAssignableFrom(currentDefinition.ItemType))
				return;

			var containable = currentDefinition.GetNamed(Name);
			currentDefinition.RemoveRange(containable);
		}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:8,代码来源:RemoveEditableAttribute.cs

示例15: SetUp

        public void SetUp()
        {
            parentDefinition = new ItemDefinition(typeof(DefinitionControllingParent)) { TemplateKey = "List" };
            childDefinition = new ItemDefinition(typeof(DefinitionOppressedChild)) { TemplateKey = "Wide" };

            definitions = MockRepository.GenerateStub<IDefinitionManager>();
            definitions.Expect(d => d.GetDefinitions()).Return(new[] { parentDefinition, childDefinition }).Repeat.Any();
        }
开发者ID:Jobu,项目名称:n2cms,代码行数:8,代码来源:AllowedDefinitionFilterTests.cs


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