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


C# LockStatementSyntax类代码示例

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


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


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