本文整理汇总了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;
}
示例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;
}
示例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
);
}
}
}
}
}
示例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);
}
}
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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
);
}
}
}
}
}
示例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();
}