当前位置: 首页>>代码示例>>C#>>正文


C# DynamicMetaObject.BindCreateInstance方法代码示例

本文整理汇总了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));
        }
开发者ID:octavioh,项目名称:ironruby,代码行数:17,代码来源:CompatibilityInvokeBinder.cs

示例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));
        }
开发者ID:jcteague,项目名称:ironruby,代码行数:17,代码来源:CompatibilityInvokeBinder.cs

示例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);
        }
开发者ID:jschementi,项目名称:iron,代码行数:18,代码来源:CompatibilityInvokeBinder.cs

示例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);
        }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:12,代码来源:CreateInstanceBinder.cs


注:本文中的DynamicMetaObject.BindCreateInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。