• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# BoundParameter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BoundParameter的典型用法代码示例。如果您正苦于以下问题:C# BoundParameter类的具体用法?C# BoundParameter怎么用?C# BoundParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BoundParameter类属于命名空间,在下文中一共展示了BoundParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OAuthContext

        public OAuthContext()
        {
            _consumerKey = new BoundParameter(Parameters.OAuth_Consumer_Key, this);
            _nonce = new BoundParameter(Parameters.OAuth_Nonce, this);
            _signature = new BoundParameter(Parameters.OAuth_Signature, this);
            _signatureMethod = new BoundParameter(Parameters.OAuth_Signature_Method, this);
            _timestamp = new BoundParameter(Parameters.OAuth_Timestamp, this);
            _token = new BoundParameter(Parameters.OAuth_Token, this);
            _tokenSecret = new BoundParameter(Parameters.OAuth_Token_Secret, this);
            _version = new BoundParameter(Parameters.OAuth_Version, this);
            _verifier = new BoundParameter(Parameters.OAuth_Verifier, this);
            _callback = new BoundParameter(Parameters.OAuth_Callback, this);

            FormEncodedParameters = new NameValueCollection();
            Cookies = new NameValueCollection();
            Headers = new NameValueCollection();
            AuthorizationHeaderParameters = new NameValueCollection();
            UseAuthorizationHeader = true;
        }
开发者ID:patrickleet,项目名称:oauth-mvc.net,代码行数:19,代码来源:OAuthContext.cs


示例2: EmitParameterStore

        private void EmitParameterStore(BoundParameter parameter)
        {
            int slot = ParameterSlot(parameter);

            if (parameter.ParameterSymbol.RefKind == RefKind.None)
            {
                _builder.EmitStoreArgumentOpcode(slot);
            }
            else
            {
                //NOTE: we should have the actual parameter already loaded, 
                //now need to do a store to where it points to
                EmitIndirectStore(parameter.ParameterSymbol.Type, parameter.Syntax);
            }
        }
开发者ID:tvsonar,项目名称:roslyn,代码行数:15,代码来源:EmitExpression.cs


示例3: EmitParameterLoad

        private void EmitParameterLoad(BoundParameter parameter)
        {
            int slot = ParameterSlot(parameter);
            _builder.EmitLoadArgumentOpcode(slot);

            if (parameter.ParameterSymbol.RefKind != RefKind.None)
            {
                var parameterType = parameter.ParameterSymbol.Type;
                EmitLoadIndirect(parameterType, parameter.Syntax);
            }
        }
开发者ID:tvsonar,项目名称:roslyn,代码行数:11,代码来源:EmitExpression.cs


示例4: ParameterSlot

 private static int ParameterSlot(BoundParameter parameter)
 {
     var sym = parameter.ParameterSymbol;
     int slot = sym.Ordinal;
     if (!sym.ContainingSymbol.IsStatic)
     {
         slot++;  // skip "this"
     }
     return slot;
 }
开发者ID:tvsonar,项目名称:roslyn,代码行数:10,代码来源:EmitExpression.cs


示例5: VisitUnhoistedParameter

 protected virtual BoundNode VisitUnhoistedParameter(BoundParameter node)
 {
     return base.VisitParameter(node);
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:MethodToClassRewriter.cs


示例6: VisitParameter

        public sealed override BoundNode VisitParameter(BoundParameter node)
        {
            BoundNode replacement;
            if (TryReplaceWithProxy(node.ParameterSymbol, node.Syntax, out replacement))
            {
                return replacement;
            }

            // Non-captured and expression tree lambda parameters don't have a proxy.
            return VisitUnhoistedParameter(node);
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:11,代码来源:MethodToClassRewriter.cs


示例7: EmitParameterAddress

 private void EmitParameterAddress(BoundParameter parameter)
 {
     int slot = ParameterSlot(parameter);
     if (parameter.ParameterSymbol.RefKind == RefKind.None)
     {
         builder.EmitLoadArgumentAddrOpcode(slot);
     }
     else
     {
         builder.EmitLoadArgumentOpcode(slot);
     }
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:12,代码来源:EmitAddress.cs


示例8: GetParameterMethod

 private EEMethodSymbol GetParameterMethod(EENamedTypeSymbol container, string methodName, string parameterName, int parameterIndex)
 {
     var syntax = SyntaxFactory.IdentifierName(parameterName);
     return this.CreateMethod(container, methodName, syntax, (method, diagnostics) =>
     {
         var parameter = method.Parameters[parameterIndex];
         var expression = new BoundParameter(syntax, parameter);
         return new BoundReturnStatement(syntax, expression) { WasCompilerGenerated = true };
     });
 }
开发者ID:rgani,项目名称:roslyn,代码行数:10,代码来源:CompilationContext.cs


示例9: VisitParameter

 public override BoundNode VisitParameter(BoundParameter node)
 {
     return RewriteParameter(node.Syntax, node.ParameterSymbol, node);
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:4,代码来源:CapturedVariableRewriter.cs


示例10: CreateBody

            // private static T <Factory>(object[] submissionArray) 
            // {
            //     var submission = new Submission#N(submissionArray);
            //     return submission.<Initialize>();
            // }
            internal override BoundBlock CreateBody()
            {
                var syntax = this.GetSyntax();

                var ctor = _containingType.GetScriptConstructor();
                Debug.Assert(ctor.ParameterCount == 1);

                var initializer = _containingType.GetScriptInitializer();
                Debug.Assert(initializer.ParameterCount == 0);

                var submissionArrayParameter = new BoundParameter(syntax, _parameters[0]) { WasCompilerGenerated = true };
                var submissionLocal = new BoundLocal(
                    syntax,
                    new SynthesizedLocal(this, _containingType, SynthesizedLocalKind.LoweringTemp),
                    null,
                    _containingType)
                { WasCompilerGenerated = true };

                // var submission = new Submission#N(submissionArray);
                var submissionAssignment = new BoundExpressionStatement(
                    syntax,
                    new BoundAssignmentOperator(
                        syntax,
                        submissionLocal,
                        new BoundObjectCreationExpression(
                            syntax,
                            ctor,
                            ImmutableArray.Create<BoundExpression>(submissionArrayParameter),
                            default(ImmutableArray<string>),
                            default(ImmutableArray<RefKind>),
                            false,
                            default(ImmutableArray<int>),
                            null,
                            null,
                            _containingType)
                        { WasCompilerGenerated = true },
                        _containingType)
                    { WasCompilerGenerated = true })
                { WasCompilerGenerated = true };

                // return submission.<Initialize>();
                var initializeResult = CreateParameterlessCall(
                    syntax,
                    submissionLocal,
                    initializer);
                Debug.Assert(initializeResult.Type == _returnType);
                var returnStatement = new BoundReturnStatement(
                    syntax,
                    RefKind.None,
                    initializeResult)
                { WasCompilerGenerated = true };

                return new BoundBlock(syntax,
                    ImmutableArray.Create<LocalSymbol>(submissionLocal.LocalSymbol),
                    ImmutableArray<LocalFunctionSymbol>.Empty,
                    ImmutableArray.Create<BoundStatement>(submissionAssignment, returnStatement))
                { WasCompilerGenerated = true };
            }
开发者ID:RoryVL,项目名称:roslyn,代码行数:63,代码来源:SynthesizedEntryPointSymbol.cs


示例11: VisitParameter

        public override BoundNode VisitParameter(BoundParameter node)
        {
            CapturedSymbolReplacement proxy;
            if (proxies.TryGetValue(node.ParameterSymbol, out proxy))
            {
                return proxy.Replacement(node.Syntax, frameType => FramePointer(node.Syntax, frameType));
            }

            ParameterSymbol replacementParameter;
            if (this.parameterMap.TryGetValue(node.ParameterSymbol, out replacementParameter))
            {
                return new BoundParameter(node.Syntax, replacementParameter, replacementParameter.Type, node.HasErrors);
            }

            return base.VisitParameter(node);
        }
开发者ID:riversky,项目名称:roslyn,代码行数:16,代码来源:MethodToClassRewriter.cs


示例12: CreateBody

            // private static T <Factory>(object[] submissionArray) 
            // {
            //     var submission = new Submission#N(submissionArray);
            //     return submission.<Initialize>();
            // }
            internal override BoundBlock CreateBody()
            {
                var syntax = this.GetSyntax();

                var ctor = _containingType.GetScriptConstructor();
                Debug.Assert(ctor.ParameterCount == 1);

                var initializer = _containingType.GetScriptInitializer();
                Debug.Assert(initializer.ParameterCount == 0);

                var submissionArrayParameter = new BoundParameter(syntax, _parameters[0]) { WasCompilerGenerated = true };
                var submissionLocal = new BoundLocal(
                    syntax,
                    new SynthesizedLocal(this, _containingType, SynthesizedLocalKind.LoweringTemp),
                    null,
                    _containingType)
                { WasCompilerGenerated = true };

                // var submission = new Submission#N(submissionArray);
                var submissionAssignment = new BoundExpressionStatement(
                    syntax,
                    new BoundAssignmentOperator(
                        syntax,
                        submissionLocal,
                        new BoundObjectCreationExpression(
                            syntax,
                            ctor,
                            ImmutableArray.Create<BoundExpression>(submissionArrayParameter),
                            default(ImmutableArray<string>),
                            default(ImmutableArray<RefKind>),
                            false,
                            default(ImmutableArray<int>),
                            null,
                            null,
                            _containingType)
                        { WasCompilerGenerated = true },
                        _containingType)
                    { WasCompilerGenerated = true })
                { WasCompilerGenerated = true };

                // return submission.<Initialize>();
                BoundExpression initializeResult = new BoundCall(
                    syntax,
                    submissionLocal,
                    initializer,
                    ImmutableArray<BoundExpression>.Empty,
                    default(ImmutableArray<string>),
                    default(ImmutableArray<RefKind>),
                    isDelegateCall: false,
                    expanded: false,
                    invokedAsExtensionMethod: false,
                    argsToParamsOpt: default(ImmutableArray<int>),
                    resultKind: LookupResultKind.Viable,
                    type: initializer.ReturnType)
                { WasCompilerGenerated = true };
                if (initializeResult.Type.IsStructType() && (_returnType.SpecialType == SpecialType.System_Object))
                {
                    initializeResult = new BoundConversion(syntax, initializeResult, Conversion.Boxing, false, true, ConstantValue.NotAvailable, _returnType)
                    { WasCompilerGenerated = true };
                }
                var returnStatement = new BoundReturnStatement(
                    syntax,
                    initializeResult)
                { WasCompilerGenerated = true };

                return new BoundBlock(syntax,
                    ImmutableArray.Create<LocalSymbol>(submissionLocal.LocalSymbol),
                    ImmutableArray.Create<BoundStatement>(submissionAssignment, returnStatement))
                { WasCompilerGenerated = true };
            }
开发者ID:daking2014,项目名称:roslyn,代码行数:75,代码来源:SynthesizedEntryPointSymbol.cs


示例13: CreateSubmissionFactoryBody

        // Generates:
        // 
        // private static T {Factory}(InteractiveSession session) 
        // {
        //    T submissionResult;
        //    new {ThisScriptClass}(session, out submissionResult);
        //    return submissionResult;
        // }
        private BoundBlock CreateSubmissionFactoryBody()
        {
            Debug.Assert(containingType.TypeKind == TypeKind.Submission);

            SyntaxTree syntaxTree = CSharpSyntaxTree.Dummy;
            CSharpSyntaxNode syntax = (CSharpSyntaxNode)syntaxTree.GetRoot();

            var interactiveSessionParam = new BoundParameter(syntax, parameters[0]) { WasCompilerGenerated = true };

            var ctor = containingType.InstanceConstructors.Single();
            Debug.Assert(ctor is SynthesizedInstanceConstructor);
            Debug.Assert(ctor.ParameterCount == 2);

            var submissionResultType = ctor.Parameters[1].Type;
            var submissionResult = new BoundLocal(syntax, new SynthesizedLocal(ctor, submissionResultType), null, submissionResultType) { WasCompilerGenerated = true };

            return new BoundBlock(syntax,
                // T submissionResult;
                ImmutableArray.Create<LocalSymbol>(submissionResult.LocalSymbol),
                ImmutableArray.Create<BoundStatement>(
                    // new Submission(interactiveSession, out submissionResult);
                    new BoundExpressionStatement(syntax,
                        new BoundObjectCreationExpression(
                            syntax,
                            ctor,
                            ImmutableArray.Create<BoundExpression>(interactiveSessionParam, submissionResult),
                            ImmutableArray<string>.Empty,
                            ImmutableArray.Create<RefKind>(RefKind.None, RefKind.Ref),
                            false,
                            default(ImmutableArray<int>),
                            null,
                            null,
                            containingType
                        )
            { WasCompilerGenerated = true })
            { WasCompilerGenerated = true },
                    // return submissionResult;
                    new BoundReturnStatement(syntax, submissionResult) { WasCompilerGenerated = true }))
            { WasCompilerGenerated = true };
        }
开发者ID:riversky,项目名称:roslyn,代码行数:48,代码来源:SynthesizedEntryPointSymbol.cs


示例14: GetParameterMethod

 private EEMethodSymbol GetParameterMethod(EENamedTypeSymbol container, string methodName, string parameterName, int parameterIndex)
 {
     var syntax = SyntaxFactory.IdentifierName(parameterName);
     return this.CreateMethod(container, methodName, syntax, (EEMethodSymbol method, DiagnosticBag diagnostics, out ImmutableArray<LocalSymbol> declaredLocals) =>
     {
         declaredLocals = ImmutableArray<LocalSymbol>.Empty;
         var parameter = method.Parameters[parameterIndex];
         var expression = new BoundParameter(syntax, parameter);
         return new BoundReturnStatement(syntax, RefKind.None, expression) { WasCompilerGenerated = true };
     });
 }
开发者ID:jkotas,项目名称:roslyn,代码行数:11,代码来源:CompilationContext.cs


示例15: CreateSubmissionFactoryBody

        // Generates:
        // 
        // private static T {Factory}(InteractiveSession session) 
        // {
        //    T submissionResult;
        //    new {ThisScriptClass}(session, out submissionResult);
        //    return submissionResult;
        // }
        private BoundBlock CreateSubmissionFactoryBody()
        {
            Debug.Assert(_containingType.TypeKind == TypeKind.Submission);

            SyntaxTree syntaxTree = CSharpSyntaxTree.Dummy;
            CSharpSyntaxNode syntax = (CSharpSyntaxNode)syntaxTree.GetRoot();

            var interactiveSessionParam = new BoundParameter(syntax, _parameters[0]) { WasCompilerGenerated = true };

            var ctor = _containingType.InstanceConstructors.Single();
            Debug.Assert(ctor is SynthesizedInstanceConstructor);
            Debug.Assert(ctor.ParameterCount == 2);

            var submissionResultType = ctor.Parameters[1].Type;

            var resultLocal = new SynthesizedLocal(ctor, submissionResultType, SynthesizedLocalKind.LoweringTemp);
            var localReference = new BoundLocal(syntax, resultLocal, null, submissionResultType) { WasCompilerGenerated = true };

            BoundExpression submissionResult = localReference;
            if (submissionResultType.IsStructType() && _returnType.SpecialType == SpecialType.System_Object)
            {
                submissionResult = new BoundConversion(syntax, submissionResult, Conversion.Boxing, false, true, ConstantValue.NotAvailable, _returnType)
                { WasCompilerGenerated = true };
            }

            return new BoundBlock(syntax,
                // T submissionResult;
                ImmutableArray.Create<LocalSymbol>(resultLocal),
                ImmutableArray.Create<BoundStatement>(
                    // new Submission(interactiveSession, out submissionResult);
                    new BoundExpressionStatement(syntax,
                        new BoundObjectCreationExpression(
                            syntax,
                            ctor,
                            ImmutableArray.Create<BoundExpression>(interactiveSessionParam, localReference),
                            ImmutableArray<string>.Empty,
                            ImmutableArray.Create<RefKind>(RefKind.None, RefKind.Ref),
                            false,
                            default(ImmutableArray<int>),
                            null,
                            null,
                            _containingType
                        )
                        { WasCompilerGenerated = true })
                    { WasCompilerGenerated = true },
                    // return submissionResult;
                    new BoundReturnStatement(syntax, submissionResult) { WasCompilerGenerated = true }))
            { WasCompilerGenerated = true };
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:57,代码来源:SynthesizedEntryPointSymbol.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BoundSequence类代码示例发布时间:2022-05-24
下一篇:
C# BoundObjectCreationExpression类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap