本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例6: BindLockStatement
private BoundStatement BindLockStatement(LockStatementSyntax node, DiagnosticBag diagnostics)
{
var lockBinder = this.GetBinder(node);
Debug.Assert(lockBinder != null);
return lockBinder.BindLockStatementParts(diagnostics, lockBinder);
}
示例7: VisitLockStatement
public sealed override void VisitLockStatement(LockStatementSyntax node)
{
_builder.Add(node);
base.VisitLockStatement(node);
}
示例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));
}
示例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);
}
示例10: VisitLockStatement
public override void VisitLockStatement(LockStatementSyntax node)
{
Visit(node.Expression);
}
示例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++;
}
示例12: NeedsBraces
public static bool NeedsBraces(LockStatementSyntax lockStatement)
{
if (lockStatement == null)
{
throw new ArgumentNullException("lockStatement");
}
return lockStatement.Statement != null
&& !lockStatement.Statement.IsKind(SyntaxKind.Block);
}
示例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);
}
示例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");
}