本文整理汇总了C#中System.Dynamic.SetMemberBinder.FallbackSetMember方法的典型用法代码示例。如果您正苦于以下问题:C# SetMemberBinder.FallbackSetMember方法的具体用法?C# SetMemberBinder.FallbackSetMember怎么用?C# SetMemberBinder.FallbackSetMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Dynamic.SetMemberBinder
的用法示例。
在下文中一共展示了SetMemberBinder.FallbackSetMember方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindSetMember
public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) {
var binderDefault = binder.FallbackSetMember(this, value);
Expression expression = GetSetValueExpression(binder.Name, value.Value);
var dynamicSuggestion = new DynamicMetaObject(expression, BindingRestrictions.GetTypeRestriction(Expression, LimitType)
.Merge(binderDefault.Restrictions));
return binder.FallbackSetMember(this, value, dynamicSuggestion);
}
示例2: BindSetMember
public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) {
ContractUtils.RequiresNotNull(binder, "binder");
return binder.FallbackSetMember(UnwrapSelf(), value);
}
示例3: BindSetMember
public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) {
if (IsOverridden("TrySetMember")) {
return CallMethodReturnLast("TrySetMember", binder, NoArgs, value.Expression, (e) => binder.FallbackSetMember(this, value, e));
}
return base.BindSetMember(binder, value);
}
示例4: BindSetMember
/// <summary>
/// Performs the binding of the dynamic set member operation.
/// </summary>
/// <param name="binder">An instance of the <see cref="SetMemberBinder"/> that represents the details of the dynamic operation.</param>
/// <param name="value">The <see cref="DynamicMetaObject"/> representing the value for the set member operation.</param>
/// <returns>The new <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
public virtual DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) {
ContractUtils.RequiresNotNull(binder, "binder");
return binder.FallbackSetMember(this, value);
}
示例5: BindSetMember
public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value)
{
Fallback fallback = null;
if (!this.IsOverridden("TrySetMember"))
{
return base.BindSetMember(binder, value);
}
if (fallback == null)
{
fallback = e => binder.FallbackSetMember(this, value, e);
}
return this.CallMethodReturnLast("TrySetMember", binder, GetArgs(new DynamicMetaObject[] { value }), fallback);
}
示例6: BindSetMember
/// <summary>
/// Performs the binding of the dynamic set member operation.
/// </summary>
/// <param name="binder">
/// An instance of the <see cref="T:System.Dynamic.SetMemberBinder" /> that represents the details of the dynamic operation.
/// </param>
/// <param name="value">
/// The <see cref="T:System.Dynamic.DynamicMetaObject" /> representing the value for the set member operation.
/// </param>
/// <returns>
/// The new <see cref="T:System.Dynamic.DynamicMetaObject" /> representing the result of the binding.
/// </returns>
public override DynamicMetaObject BindSetMember( SetMemberBinder binder, DynamicMetaObject value )
{
return ApplyBinding( meta => meta.BindSetMember( binder, value ),
( target, errorSuggestion ) =>
binder.FallbackSetMember( target, value, errorSuggestion ) );
}
示例7: BindSetMember
public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value)
{
return binder.FallbackSetMember(UnwrapSelf(), value);
}
示例8: BindSetMember
public override DynamicMetaObject BindSetMember( SetMemberBinder binder, DynamicMetaObject value )
{
return binder.FallbackSetMember( _baseMetaObject,
AddTypeRestrictions( _metaObject.BindSetMember( binder, value ) ) );
}