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


C# IAbstractComponentType.GetPropertyValues方法代码示例

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


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

示例1: ProcessComponent

		/// <summary>
		/// Visit a component. Dispatch each property to <see cref="ProcessValues"/>
		/// </summary>
		/// <param name="component"></param>
		/// <param name="componentType"></param>
		/// <returns></returns>
		internal virtual object ProcessComponent(object component, IAbstractComponentType componentType)
		{
			if (component != null)
			{
				ProcessValues(componentType.GetPropertyValues(component, session), componentType.Subtypes);
			}
			return null;
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:14,代码来源:AbstractVisitor.cs

示例2: ProcessComponent

        internal override object ProcessComponent(object component, IAbstractComponentType componentType)
        {
            if (component != null)
            {
                object[] values = componentType.GetPropertyValues(component, Session);
                IType[] types = componentType.Subtypes;
                bool substituteComponent = false;
                for (int i = 0; i < types.Length; i++)
                {
                    System.Object result = ProcessValue(values[i], types[i]);
                    if (result != null)
                    {
                        values[i] = result;
                        substituteComponent = true;
                    }
                }
                if (substituteComponent)
                {
                    componentType.SetPropertyValues(component, values, Session.EntityMode);
                }
            }

            return null;
        }
开发者ID:zibler,项目名称:zibler,代码行数:24,代码来源:WrapVisitor.cs

示例3: AppendComponentCondition

		protected void AppendComponentCondition(
			String path,
			object component,
			IAbstractComponentType type,
			ICriteria criteria,
			ICriteriaQuery criteriaQuery,
			IDictionary<string, IFilter> enabledFilters,
			SqlStringBuilder builder)
		{
			if (component != null)
			{
				String[] propertyNames = type.PropertyNames;
				object[] values = type.GetPropertyValues(component, GetEntityMode(criteria, criteriaQuery));
				IType[] subtypes = type.Subtypes;
				for (int i = 0; i < propertyNames.Length; i++)
				{
					String subpath = StringHelper.Qualify(path, propertyNames[i]);
					object value = values[i];
					if (IsPropertyIncluded(value, subpath, subtypes[i]))
					{
						IType subtype = subtypes[i];
						if (subtype.IsComponentType)
						{
							AppendComponentCondition(
								subpath,
								value,
								(IAbstractComponentType) subtype,
								criteria,
								criteriaQuery,
								enabledFilters,
								builder);
						}
						else
						{
							AppendPropertyCondition(
								subpath,
								value,
								criteria,
								criteriaQuery,
								enabledFilters,
								builder
								);
						}
					}
				}
			}
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:47,代码来源:Example.cs

示例4: AddComponentTypedValues

		protected void AddComponentTypedValues(string path, object component, IAbstractComponentType type, IList list, ICriteria criteria, ICriteriaQuery criteriaQuery)
		{
			if (component != null)
			{
				string[] propertyNames = type.PropertyNames;
				IType[] subtypes = type.Subtypes;
				object[] values = type.GetPropertyValues(component, GetEntityMode(criteria, criteriaQuery));

				for (int i = 0; i < propertyNames.Length; i++)
				{
					object value = values[i];
					IType subtype = subtypes[i];
					string subpath = StringHelper.Qualify(path, propertyNames[i]);
					if (IsPropertyIncluded(value, subpath, subtype))
					{
						if (subtype.IsComponentType)
						{
							AddComponentTypedValues(subpath, value, (IAbstractComponentType) subtype, list, criteria, criteriaQuery);
						}
						else
						{
							AddPropertyTypedValue(value, subtype, list);
						}
					}
				}
			}
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:27,代码来源:Example.cs

示例5: ProcessComponent

		protected override object ProcessComponent(object component, IAbstractComponentType componentType)
		{
			if (component == null)
			{
				return null;
			}

			object[] values = componentType.GetPropertyValues(component, Session);
			IType[] types = componentType.Subtypes;
			bool substituteComponent = false;
			for (int i = 0; i < types.Length; i++)
			{
				object result = ProcessValue(values[i], types[i]);
				if (result != null)
				{
					substituteComponent = true;
					values[i] = result;
				}
			}

			if (substituteComponent)
			{
				componentType.SetPropertyValues(component, values);
			}

			return null;
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:27,代码来源:WrapVisitor.cs

示例6: CheckComponentNullability

		/// <summary> 
		/// Check component nullability. Returns property path that break
		/// nullability or null if none 
		/// </summary>
		/// <param name="value">component properties </param>
		/// <param name="compType">component not-nullable type </param>
		/// <returns> property path </returns>
		private string CheckComponentNullability(object value, IAbstractComponentType compType)
		{
			// will check current level if some of them are not null or sublevels if they exist
			bool[] nullability = compType.PropertyNullability;
			if (nullability != null)
			{
				//do the test
				object[] values = compType.GetPropertyValues(value, session.EntityMode);
				IType[] propertyTypes = compType.Subtypes;
				for (int i = 0; i < values.Length; i++)
				{
					object subvalue = values[i];
					if (!nullability[i] && subvalue == null)
					{
						return compType.PropertyNames[i];
					}
					else if (subvalue != null)
					{
						string breakProperties = CheckSubElementsNullability(propertyTypes[i], subvalue);
						if (breakProperties != null)
						{
							return BuildPropertyPath(compType.PropertyNames[i], breakProperties);
						}
					}
				}
			}
			return null;
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:35,代码来源:Nullability.cs

示例7: CascadeComponent

		private void CascadeComponent(object child, IAbstractComponentType componentType, object anything)
		{
			object[] children = componentType.GetPropertyValues(child, eventSource);
			IType[] types = componentType.Subtypes;
			for (int i = 0; i < types.Length; i++)
			{
				CascadeStyle componentPropertyStyle = componentType.GetCascadeStyle(i);
				if (componentPropertyStyle.DoCascade(action))
				{
					CascadeProperty(children[i], types[i], componentPropertyStyle, anything, false);
				}
			}
		}
开发者ID:paulbatum,项目名称:nhibernate,代码行数:13,代码来源:Cascade.cs

示例8: AppendComponentCondition

		protected void AppendComponentCondition(
			String path,
			object component,
			IAbstractComponentType type,
			System.Type persistentClass,
			String alias,
			IDictionary aliasClasses,
			ISessionFactoryImplementor sessionFactory,
			SqlStringBuilder builder)
		{
			if( component != null )
			{
				String[] propertyNames = type.PropertyNames;
				object[] values = type.GetPropertyValues( component, null );
				IType[] subtypes = type.Subtypes;
				for( int i = 0; i < propertyNames.Length; i++ )
				{
					String subpath = StringHelper.Qualify( path, propertyNames[ i ] );
					object value = values[ i ];
					if( IsPropertyIncluded( value, subpath, subtypes[ i ] ) )
					{
						IType subtype = subtypes[ i ];
						if( subtype.IsComponentType )
						{
							AppendComponentCondition(
								subpath,
								value,
								(IAbstractComponentType)subtype,
								persistentClass,
								alias,
								aliasClasses,
								sessionFactory,
								builder );
						}
						else
						{
							AppendPropertyCondition(
								subpath,
								value,
								persistentClass,
								alias,
								aliasClasses,
								sessionFactory,
								builder
								);
						}
					}
				}
			}
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:50,代码来源:Example.cs

示例9: CascadeComponent

		private void CascadeComponent(object parent, object child, IAbstractComponentType componentType, string componentPropertyName, object anything)
		{
			componentPathStack.Push(componentPropertyName);
			object[] children = componentType.GetPropertyValues(child, eventSource);
			IType[] types = componentType.Subtypes;
			for (int i = 0; i < types.Length; i++)
			{
				CascadeStyle componentPropertyStyle = componentType.GetCascadeStyle(i);
				string subPropertyName = componentType.PropertyNames[i];
				if (componentPropertyStyle.DoCascade(action))
				{
					CascadeProperty(parent, children[i], types[i], componentPropertyStyle, subPropertyName, anything, false);
				}
			}
			componentPathStack.Pop();
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:16,代码来源:Cascade.cs


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