本文整理汇总了C#中DynamicMetaObject.BindCreateInstance方法的典型用法代码示例。如果您正苦于以下问题:C# DynamicMetaObject.BindCreateInstance方法的具体用法?C# DynamicMetaObject.BindCreateInstance怎么用?C# DynamicMetaObject.BindCreateInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicMetaObject
的用法示例。
在下文中一共展示了DynamicMetaObject.BindCreateInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FallbackInvoke
public override DynamicMetaObject/*!*/ FallbackInvoke(DynamicMetaObject target, DynamicMetaObject/*!*/[]/*!*/ args, DynamicMetaObject onBindingError) {
if (target.Value is IDynamicObject) {
// try creating an instance...
return target.BindCreateInstance(
new CreateFallback(this, Arguments),
args
);
}
#if !SILVERLIGHT
DynamicMetaObject com;
if (System.Dynamic.ComBinder.TryBindInvoke(this, target, args, out com)) {
return com;
}
#endif
return InvokeFallback(target, args, BindingHelpers.ArgumentArrayToSignature(Arguments));
}
示例2: FallbackInvoke
public override DynamicMetaObject/*!*/ FallbackInvoke(DynamicMetaObject target, DynamicMetaObject/*!*/[]/*!*/ args, DynamicMetaObject errorSuggestion) {
if (target.Value is IDynamicMetaObjectProvider) {
// try creating an instance...
return target.BindCreateInstance(
_state.Create(this, CallInfo),
args
);
}
#if !SILVERLIGHT
DynamicMetaObject com;
if (System.Dynamic.ComBinder.TryBindInvoke(this, target, args, out com)) {
return com;
}
#endif
return InvokeFallback(target, args, BindingHelpers.CallInfoToSignature(CallInfo));
}
示例3: FallbackInvoke
public override DynamicMetaObject/*!*/ FallbackInvoke(DynamicMetaObject target, DynamicMetaObject/*!*/[]/*!*/ args, DynamicMetaObject errorSuggestion) {
if (target.Value is IDynamicMetaObjectProvider && errorSuggestion == null) {
// try creating an instance...
return target.BindCreateInstance(
_context.Create(this, CallInfo),
args
);
}
#if !SILVERLIGHT
DynamicMetaObject com;
if (Microsoft.Scripting.ComInterop.ComBinder.TryBindInvoke(this, target, BindingHelpers.GetComArguments(args), out com)) {
return com;
}
#endif
return InvokeFallback(target, args, BindingHelpers.CallInfoToSignature(CallInfo), errorSuggestion);
}
示例4: Bind
/// <summary>
/// Performs the binding of the dynamic create operation.
/// </summary>
/// <param name="target">The target of the dynamic create operation.</param>
/// <param name="args">An array of arguments of the dynamic create operation.</param>
/// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
public sealed override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args) {
ContractUtils.RequiresNotNull(target, "target");
ContractUtils.RequiresNotNullItems(args, "args");
return target.BindCreateInstance(this, args);
}