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

C# LockStatementSyntax类代码示例

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

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



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

示例1: AddBraces

        public static LockStatementSyntax AddBraces(LockStatementSyntax lockStatement)
        {
            Debug.Assert(lockStatement != null && NeedsBraces(lockStatement));

            return lockStatement
                .WithStatement(SyntaxFactory.Block(lockStatement.Statement))
                .WithAdditionalAnnotations(Formatter.Annotation);
        }
开发者ID:modulexcite,项目名称:StylishCode,代码行数:8,代码来源:StyleHelpers.cs


示例2: Go

 public static void Go(OutputWriter writer, LockStatementSyntax statement)
 {
     //All d objects implement a lock
     writer.WriteLine("synchronized(" + Core.WriteString(statement.Expression)+")");
     writer.OpenBrace();
     Core.WriteStatementAsBlock(writer, statement.Statement, false);
     writer.CloseBrace();
 }
开发者ID:mortezabarzkar,项目名称:SharpNative,代码行数:8,代码来源:WriteLockStatement.cs


示例3: VisitLockStatement

        public override void VisitLockStatement(LockStatementSyntax node)
        {
            string name = "LOCK_Statement";

            if (ConsultingAnalysisResult.libraryUsage.ContainsKey(name))
                ConsultingAnalysisResult.libraryUsage[name]++;
            else
                ConsultingAnalysisResult.libraryUsage[name] = 1;
            base.VisitLockStatement(node);
        }
开发者ID:modulexcite,项目名称:concurrent-code-analyses,代码行数:10,代码来源:AsyncLibraryDetectionWalker.cs


示例4: VisitLockStatement

 /// <summary>
 /// 
 /// </summary>
 /// <param name="node"></param>
 public override sealed void VisitLockStatement(LockStatementSyntax node)
 {
     this.OnNodeVisited(node, this.type.IsInstanceOfType(node));
     base.VisitLockStatement(node);
 }
开发者ID:andry-tino,项目名称:Rosetta,代码行数:9,代码来源:ASTWalkerNodeTypeOperationExecutor.cs


示例5: AreEquivalentActiveStatements

 private static bool AreEquivalentActiveStatements(LockStatementSyntax oldNode, LockStatementSyntax newNode)
 {
     // only check the expression, edits in the body are allowed:
     return AreEquivalentIgnoringLambdaBodies(oldNode.Expression, newNode.Expression);
 }
开发者ID:GeertVL,项目名称:roslyn,代码行数:5,代码来源:CSharpEditAndContinueAnalyzer.cs


示例6: BindLockStatement

 private BoundStatement BindLockStatement(LockStatementSyntax node, DiagnosticBag diagnostics)
 {
     var lockBinder = this.GetBinder(node);
     Debug.Assert(lockBinder != null);
     return lockBinder.BindLockStatementParts(diagnostics, lockBinder);
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:6,代码来源:Binder_Statements.cs


示例7: VisitLockStatement

 public sealed override void VisitLockStatement(LockStatementSyntax node)
 {
     _builder.Add(node);
     base.VisitLockStatement(node);
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:5,代码来源:LocalVariableDeclaratorsCollector.cs


示例8: InferTypeInLockStatement

            private IEnumerable<ITypeSymbol> InferTypeInLockStatement(LockStatementSyntax lockStatement, SyntaxToken? previousToken = null)
            {
                // If we're position based, then we have to be after the "lock("
                if (previousToken.HasValue && previousToken.Value != lockStatement.OpenParenToken)
                {
                    return SpecializedCollections.EmptyEnumerable<ITypeSymbol>();
                }

                return SpecializedCollections.SingletonEnumerable(this.Compilation.GetSpecialType(SpecialType.System_Object));
            }
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:10,代码来源:CSharpTypeInferenceService.TypeInferrer.cs


示例9: VisitLockStatement

        public override void VisitLockStatement(LockStatementSyntax node)
        {
            string name = "LOCK_Statement";
            var libraryUsage = Result.LibraryUsage;
      
            int temp;
            libraryUsage.TryGetValue(name, out temp);
            libraryUsage[name] = ++temp;

            base.VisitLockStatement(node);
        }
开发者ID:modulexcite,项目名称:CSharpAnalyzer,代码行数:11,代码来源:ConcurrencyUsageWalker.cs


示例10: VisitLockStatement

 public override void VisitLockStatement(LockStatementSyntax node)
 {
     Visit(node.Expression);
 }
开发者ID:tvsonar,项目名称:roslyn,代码行数:4,代码来源:ExpressionVariableFinder.cs


示例11: VisitLockStatementDeclarations

            protected override void VisitLockStatementDeclarations(LockStatementSyntax node)
            {
                Debug.Assert(node.Expression != null);
               
                 // Expecting one or two locals depending on which overload of Monitor.Enter is used.
                if (TryGetSlotIndex(SynthesizedLocalKind.Lock) != null)
                {
                    // If the next local is LockTaken, then the lock was emitted with the two argument
                    // overload for Monitor.Enter(). Otherwise, the single argument overload was used.
                    if (IsSlotIndex(SynthesizedLocalKind.LockTaken))
                    {
                        AddSynthesizedLocal(SynthesizedLocalKind.LockTaken);
                    }
                }

                this.offset++;
            }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:17,代码来源:CSharpDefinitionMap.LocalVisitors.cs


示例12: NeedsBraces

        public static bool NeedsBraces(LockStatementSyntax lockStatement)
        {
            if (lockStatement == null)
            {
                throw new ArgumentNullException("lockStatement");
            }

            return lockStatement.Statement != null
                && !lockStatement.Statement.IsKind(SyntaxKind.Block);
        }
开发者ID:modulexcite,项目名称:StylishCode,代码行数:10,代码来源:StyleHelpers.cs


示例13: VisitLockStatement

 public override void VisitLockStatement(LockStatementSyntax node)
 {
     AddExpressionTerms(node.Expression, _expressions);
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:CSharpProximityExpressionsService.RelevantExpressionsCollector.cs


示例14: VisitLockStatement

        public void VisitLockStatement(LockStatementSyntax node)
        {
            if (node == null)
                throw new ArgumentNullException("node");

            node.Validate();

            WriteLeadingTrivia(node);

            _writer.WriteIndent();
            _writer.WriteKeyword(PrinterKeyword.Lock);

            if (_writer.Configuration.Spaces.BeforeParentheses.LockParentheses)
                _writer.WriteSpace();

            _writer.WriteSyntax(Syntax.OpenParen);

            if (_writer.Configuration.Spaces.WithinParentheses.LockParentheses)
                _writer.WriteSpace();

            node.Expression.Accept(this);

            if (_writer.Configuration.Spaces.WithinParentheses.LockParentheses)
                _writer.WriteSpace();

            _writer.WriteSyntax(Syntax.CloseParen);

            VisitBlockStatement(node.Statement);

            WriteTrailingTrivia(node);
        }
开发者ID:modulexcite,项目名称:CSharpSyntax,代码行数:31,代码来源:SyntaxPrinter.cs


示例15: Flatten

 public void Flatten(LockStatementSyntax node, List<FlatStatement> instructions)
 {
     /*
     public SyntaxToken CloseParenToken { get; }
     public ExpressionSyntax Expression { get; }
     public SyntaxToken LockKeyword { get; }
     public SyntaxToken OpenParenToken { get; }
     public StatementSyntax Statement { get; }
      */
     throw new NotImplementedException("lock");
 }
开发者ID:VendanAndrews,项目名称:ls2csc,代码行数:11,代码来源:Function.cs


示例16: VisitLockStatementDeclarations

 protected abstract void VisitLockStatementDeclarations(LockStatementSyntax node);
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:1,代码来源:LocalVariableDeclaratorsVisitor.cs


示例17: VisitLockStatement

 public sealed override void VisitLockStatement(LockStatementSyntax node)
 {
     this.VisitLockStatementDeclarations(node);
     base.VisitLockStatement(node);
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:5,代码来源:LocalVariableDeclaratorsVisitor.cs


示例18: LockBinder

 public LockBinder(Binder enclosing, LockStatementSyntax syntax)
     : base(enclosing)
 {
     this.syntax = syntax;
     this.expressionHandler = new LockOrUsingStatementExpressionHandler(syntax.Expression, this);
 }
开发者ID:riversky,项目名称:roslyn,代码行数:6,代码来源:LockBinder.cs


示例19: VisitLockStatement

 public override void VisitLockStatement(LockStatementSyntax node)
 {
     throw new NotSupportedException();
 }
开发者ID:mortezabarzkar,项目名称:SharpNative,代码行数:4,代码来源:YieldStateGenerator.cs


示例20: VisitLockStatement

        public override void VisitLockStatement(LockStatementSyntax node)
        {
            var patternBinder = new PatternVariableBinder(node, _enclosing);
            var lockBinder = new LockBinder(patternBinder, node);
            AddToMap(node, lockBinder);

            Visit(node.Expression, lockBinder);

            StatementSyntax statement = node.Statement;
            var statementBinder = lockBinder.WithAdditionalFlags(BinderFlags.InLockBody);
            if (statementBinder != lockBinder)
            {
                AddToMap(statement, statementBinder);
            }

            VisitPossibleEmbeddedStatement(statement, statementBinder);
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:17,代码来源:LocalBinderFactory.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# LockType类代码示例发布时间:2022-05-24
下一篇:
C# LockStatement类代码示例发布时间: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