本文整理汇总了C#中IBindingContext.BindChild方法的典型用法代码示例。如果您正苦于以下问题:C# IBindingContext.BindChild方法的具体用法?C# IBindingContext.BindChild怎么用?C# IBindingContext.BindChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBindingContext
的用法示例。
在下文中一共展示了IBindingContext.BindChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bind
public void Bind(PropertyInfo property, IBindingContext context)
{
Type entityType = property.PropertyType.GetGenericArguments()[0];
// If there is no Extends<> for the entity type, do nothing
if (!ExtensionProperties.HasExtensionFor(entityType))
{
return;
}
Type extensionType = ExtensionProperties.ExtensionFor(entityType);
// direct the FubuMVC model binding to resolve an object of the
// extensionType using "entityType.Name" as the prefix on the form data,
// and place the newly created object using the specified property
context.BindChild(property, extensionType, entityType.Name);
}
示例2: Bind
public void Bind(PropertyInfo property, IBindingContext context)
{
if (context.Object == null) return;
Type entityType = context.Object.GetTrueType();
// If there is no Extends<> for the entity type, do nothing
if (!ExtensionProperties.HasExtensionFor(entityType))
{
return;
}
Type extensionType = ExtensionProperties.ExtensionFor(entityType);
// direct the FubuMVC model binding to resolve an object of the
// extensionType using "entityType.Name" as the prefix on the form data,
// and place the newly created object using the specified property
context.BindChild(property, extensionType, string.Empty);
}
示例3: Bind
public void Bind(PropertyInfo property, IBindingContext context)
{
context.BindChild(property);
}