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


C# ITypeDefinition.TryFindDescriptorInHierarchy方法代码示例

本文整理汇总了C#中ITypeDefinition.TryFindDescriptorInHierarchy方法的典型用法代码示例。如果您正苦于以下问题:C# ITypeDefinition.TryFindDescriptorInHierarchy方法的具体用法?C# ITypeDefinition.TryFindDescriptorInHierarchy怎么用?C# ITypeDefinition.TryFindDescriptorInHierarchy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITypeDefinition的用法示例。


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

示例1: Evaluate

        /// <summary>
        /// Checks whether the given type is a shared block.
        /// </summary>
        /// <param name="context">The <see cref="IMansionContext"/>.</param>
        /// <param name="type">The <see cref="ITypeDefinition"/>.</param>
        /// <returns>Returns true if the type is a static block, otherwise false.</returns>
        public bool Evaluate(IMansionContext context, ITypeDefinition type)
        {
            // validate arguments
            if (context == null)
                throw new ArgumentNullException("context");
            if (type == null)
                throw new ArgumentNullException("type");

            // check if this type has a shared block
            SharedBlockDescriptor sharedBlockDescriptor;
            return type.TryFindDescriptorInHierarchy(out sharedBlockDescriptor);
        }
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:18,代码来源:IsSharedBlock.cs

示例2: Evaluate

		/// <summary>
		/// Gets the label of a particular <paramref name="parentType"/>.
		/// </summary>
		/// <param name="context">The <see cref="IMansionContext"/>.</param>
		/// <param name="parentType">The <see cref="ITypeDefinition"/> which to check for.</param>
		/// <param name="childType">The <see cref="ITypeDefinition"/> which to check on.</param>
		public bool Evaluate(IMansionContext context, ITypeDefinition parentType, ITypeDefinition childType)
		{
			// validate arguments
			if (context == null)
				throw new ArgumentNullException("context");
			if (parentType == null)
				throw new ArgumentNullException("parentType");
			if (childType == null)
				return false;

			// find the descriptor
			CmsBehaviorDescriptor cmsDescriptor;
			return parentType.TryFindDescriptorInHierarchy(out cmsDescriptor) && cmsDescriptor.GetBehavior(context).GetAllowedChildTypes(context).Any(childType.IsAssignable);
		}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:20,代码来源:CanContainChild.cs

示例3: Evaluate

		/// <summary>
		/// Gets the label of a particular <paramref name="typeDefinition"/>.
		/// </summary>
		/// <param name="context">The <see cref="IMansionContext"/>.</param>
		/// <param name="typeDefinition">The <see cref="ITypeDefinition"/> for which to get the label.</param>
		public bool Evaluate(IMansionContext context, ITypeDefinition typeDefinition)
		{
			// validate arguments
			if (context == null)
				throw new ArgumentNullException("context");
			if (typeDefinition == null)
				throw new ArgumentNullException("typeDefinition");

			// find the descriptor
			CmsBehaviorDescriptor cmsDescriptor;
			if (!typeDefinition.TryFindDescriptorInHierarchy(out cmsDescriptor))
				return false;

			// return the friendly name
			return cmsDescriptor.GetBehavior(context).HasChildren;
		}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:21,代码来源:HasChildTypes.cs

示例4: PopulateFullTextColumn

		/// <summary>
		/// Populates the full text property.
		/// </summary>
		/// <param name="context">The <see cref="IMansionContext"/>.</param>
		/// <param name="type">The <see cref="ITypeDefinition"/>.</param>
		/// <param name="modifiedProperties">The modified <see cref="IPropertyBag"/>.</param>
		/// <param name="originalProperties">The original <see cref="IPropertyBag"/>.</param>
		/// <exception cref="ArgumentNullException">Thrown if one of the parameters is null.</exception>
		public static void PopulateFullTextColumn(IMansionContext context, ITypeDefinition type, IPropertyBag modifiedProperties, IPropertyBag originalProperties)
		{
			// validate arguments
			if (context == null)
				throw new ArgumentNullException("context");
			if (type == null)
				throw new ArgumentNullException("type");
			if (modifiedProperties == null)
				throw new ArgumentNullException("modifiedProperties");
			if (originalProperties == null)
				throw new ArgumentNullException("originalProperties");

			// try to get the full text descriptor
			FullTextDescriptor descriptor;
			if (!type.TryFindDescriptorInHierarchy(out descriptor))
				return;

			// index
			descriptor.Populate(context, modifiedProperties, originalProperties);
		}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:28,代码来源:SqlServerUtilities.cs


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