本文整理汇总了C#中System.Dynamic.GetIndexBinder.FallbackGetIndex方法的典型用法代码示例。如果您正苦于以下问题:C# GetIndexBinder.FallbackGetIndex方法的具体用法?C# GetIndexBinder.FallbackGetIndex怎么用?C# GetIndexBinder.FallbackGetIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Dynamic.GetIndexBinder
的用法示例。
在下文中一共展示了GetIndexBinder.FallbackGetIndex方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindGetIndex
public override DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMetaObject[] indexes) {
ContractUtils.RequiresNotNull(binder, "binder");
return binder.FallbackGetIndex(UnwrapSelf(), indexes);
}
示例2: BindGetIndex
/// <summary>
/// Performs the binding of the dynamic get index operation.
/// </summary>
/// <param name="binder">An instance of the <see cref="GetIndexBinder"/> that represents the details of the dynamic operation.</param>
/// <param name="indexes">An array of <see cref="DynamicMetaObject"/> instances - indexes for the get index operation.</param>
/// <returns>The new <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
public virtual DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMetaObject[] indexes) {
ContractUtils.RequiresNotNull(binder, "binder");
return binder.FallbackGetIndex(this, indexes);
}
示例3: BindGetIndex
public override DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMetaObject[] indexes) {
if (IsOverridden("TryGetIndex")) {
return CallMethodWithResult("TryGetIndex", binder, DynamicMetaObject.GetExpressions(indexes), (e) => binder.FallbackGetIndex(this, indexes, e));
}
return base.BindGetIndex(binder, indexes);
}
示例4: BindGetIndex
public override DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMetaObject[] indexes)
{
var index = _type.GetIndex(binder.CallInfo.ArgumentCount);
if (index != null && index.Getters != null)
{
return TotemProtocol.ResolveOverload(
binder,
_type,
binder.CallInfo,
_type.Name + ".<get_index>",
index.Getters,
this,
indexes
);
}
var fallback = binder.FallbackGetIndex(this, indexes);
BindingRestrictions restrictions = fallback.Restrictions.Merge(BindingRestrictions.GetTypeRestriction(Expression, LimitType));
foreach (var arg in indexes)
restrictions = restrictions.Merge(BindingRestrictions.GetTypeRestriction(arg.Expression, arg.LimitType));
return new DynamicMetaObject(
AssertImplemented(
Expression.Call(
Expression.Constant(_type, typeof(TotemType)),
TotemType.GetMissingIndexInfo,
Expression,
Expression.NewArrayInit(
typeof(object),
ArrayUtils.ConvertAll(indexes, i => i.Expression)
)
),
fallback.Expression
),
restrictions
);
}
示例5: BindGetIndex
public override DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMetaObject[] indexes)
{
Fallback fallback = null;
if (!this.IsOverridden("TryGetIndex"))
{
return base.BindGetIndex(binder, indexes);
}
if (fallback == null)
{
fallback = e => binder.FallbackGetIndex(this, indexes, e);
}
return this.CallMethodWithResult("TryGetIndex", binder, GetArgArray(indexes), fallback);
}
示例6: BindGetIndex
/// <summary>
/// Performs the binding of the dynamic get index operation.
/// </summary>
/// <param name="binder">
/// An instance of the <see cref="T:System.Dynamic.GetIndexBinder" /> that represents the details of the dynamic operation.
/// </param>
/// <param name="indexes">
/// An array of <see cref="T:System.Dynamic.DynamicMetaObject" /> instances - indexes for the get index operation.
/// </param>
/// <returns>
/// The new <see cref="T:System.Dynamic.DynamicMetaObject" /> representing the result of the binding.
/// </returns>
public override DynamicMetaObject BindGetIndex( GetIndexBinder binder, DynamicMetaObject[] indexes )
{
return ApplyBinding( meta => meta.BindGetIndex( binder, indexes ),
( target, errorSuggestion ) =>
binder.FallbackGetIndex( target, indexes, errorSuggestion ) );
}
示例7: BindGetIndex
public override DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMetaObject[] indexes)
{
return binder.FallbackGetIndex(UnwrapSelf(), indexes);
}
示例8: BindGetIndex
public override DynamicMetaObject BindGetIndex( GetIndexBinder binder, DynamicMetaObject[] indexes )
{
return binder.FallbackGetIndex( _baseMetaObject,
indexes,
AddTypeRestrictions( _metaObject.BindGetIndex( binder, indexes ) ) );
}