195 references to Peek
Aspire.Hosting.Docker (3)
src\Shared\Yaml\ForceQuotedStringsEventEmitter.cs (3)
56var item = _state.Peek(); 84_state.Peek().Move(); 121_state.Peek().Move();
Aspire.Hosting.Kubernetes (3)
src\Shared\Yaml\ForceQuotedStringsEventEmitter.cs (3)
56var item = _state.Peek(); 84_state.Peek().Move(); 121_state.Peek().Move();
dotnet-svcutil-lib (2)
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (1)
1121currentFrame = (ParseElementOnlyContent_LocalFrame)localFrames.Peek();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (1)
1622object stackTop = _blockStack.Peek();
GenerateDocumentationAndConfigFiles (5)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
152if (_seenRethrowInCatchClauses.Count > 0 && !_seenRethrowInCatchClauses.Peek())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
89var currentNode = spineNodes.Peek(); 142var parentNode = spineNodes.Peek();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
434Contract.ThrowIfFalse(Equals(contextualSymbol, _contextualSymbolStack.Peek())); 439=> _contextualSymbolStack.Count == 0 ? null : _contextualSymbolStack.Peek();
ILAssembler (9)
GrammarVisitor.cs (5)
1250var thisType = _currentTypeDefinition.Peek(); 1260var baseType = _currentTypeDefinition.Peek().BaseType; 1275var nesterType = _currentTypeDefinition.Peek().ContainingType!; 2010for (int i = 0; i < _currentTypeDefinition.Peek().GenericParameters.Count; i++) 2012EntityRegistry.GenericParameterEntity? genericParameter = _currentTypeDefinition.Peek().GenericParameters[i];
PreprocessedTokenSource.cs (3)
30private ITokenSource CurrentTokenSource => _includeSourceStack.Peek().Source; 31private int ActiveIfDefBlocksInCurrentSource => _includeSourceStack.Peek().ActiveIfDefBlocks; 47var current = _includeSourceStack.Peek();
StackExtensions.cs (1)
12public static T? PeekOrDefault<T>(this Stack<T> stack) => stack.Count == 0 ? default : stack.Peek();
ILCompiler.Compiler (4)
Compiler\Dataflow\MethodBodyScanner.cs (1)
413currentStack.Push(currentStack.Peek());
Compiler\ObjectWriter\Dwarf\DwarfInfoWriter.cs (2)
56if (_dieStack.Count > 0 && !_dieStack.Peek().HasChildren) 58throw new InvalidOperationException($"Trying to write a children into DIE (Tag {_dieStack.Peek().Tag}) with DW_CHILDREN_no");
Compiler\TypePreinit.cs (1)
320stack.Push(stack.Peek());
illink (1)
ILLink.Tasks (2)
CreateRuntimeRootDescriptorFile.cs (2)
596if (activeSections.Count > 0 && activeSections.Peek() != true) 650get => activeSections.Count == 0 || activeSections.Peek() == true;
Microsoft.AspNetCore.Components (5)
Rendering\RenderTreeBuilder.cs (5)
54var indexOfLastElementOrComponent = _openElementIndices.Peek(); 564var indexOfLastElementOrComponent = _openElementIndices.Peek(); 700var indexOfLastElementOrComponent = _openElementIndices.Peek(); 737=> _openElementIndices.Count == 0 ? (int?)null : _openElementIndices.Peek(); 815ref var invalidFrame = ref _entries.Buffer[_openElementIndices.Peek()];
Microsoft.AspNetCore.Components.Analyzers (2)
VirtualizeItemComparerAnalyzer.cs (2)
88if (componentStack.Count > 0 && componentStack.Peek().IsVirtualize) 96var state = componentStack.Peek();
Microsoft.Build (8)
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (1)
351INodePacketHandler packetHandler = handlerStack.Peek();
Evaluation\LazyItemEvaluator.cs (3)
329var globsToIgnoreFromFutureOperations = globsToIgnoreStack?.Peek() ?? globsToIgnore; 362ImmutableHashSet<string> currentGlobsToIgnore = globsToIgnoreStack == null ? globsToIgnore : globsToIgnoreStack.Peek(); 425currentGlobsToIgnore = globsToIgnoreStack.Count == 0 ? globsToIgnore : globsToIgnoreStack.Peek();
Evaluation\Preprocessor.cs (1)
328destination.AppendChild(destinationDocument.CreateComment($"\r\n{Equals140}\r\n </Import>\r\n\r\n{_filePaths.Peek()?.Replace("--", "__")}\r\n{Equals140}\r\n"));
Evaluation\Profiler\EvaluationProfiler.cs (3)
25private EvaluationLocation CurrentLocation => _evaluationStack.Count == 0 ? EvaluationLocation.EmptyLocation : _evaluationStack.Peek().Location; 119_evaluationProfiler._evaluationStack.Peek()._exclusiveTime.Stop(); 140_evaluationProfiler._evaluationStack.Peek()._exclusiveTime.Start();
Microsoft.CodeAnalysis (17)
CodeGen\LocalScopeManager.cs (1)
35private ScopeInfo CurrentScope => _scopes.Peek();
Syntax\SyntaxDiffer.cs (16)
205bool oldIsToken = _oldNodes.Peek().IsToken; 206bool newIsToken = _newNodes.Peek().IsToken; 214FindBestMatch(_newNodes, _oldNodes.Peek(), out indexOfOldInNew, out similarityOfOldInNew); 215FindBestMatch(_oldNodes, _newNodes.Peek(), out indexOfNewInOld, out similarityOfNewInOld); 221if (AreIdentical(_oldNodes.Peek(), _newNodes.Peek())) 254FindBestMatch(_oldNodes, _oldNodes.Peek(), out indexOfOldInOld, out similarityOfOldInOld, 1); 266if (AreSimilar(_oldNodes.Peek(), _newNodes.Peek())) 288if (AreSimilar(_oldNodes.Peek(), _newNodes.Peek())) 310var sim = GetSimilarity(_oldNodes.Peek(), _newNodes.Peek()); 311if (sim >= Math.Max(_oldNodes.Peek().FullSpan.Length, _newNodes.Peek().FullSpan.Length)) 569int start = _oldNodes.Count > 0 ? _oldNodes.Peek().Position : _oldSpan.End;
Microsoft.CodeAnalysis.Analyzers (5)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
152if (_seenRethrowInCatchClauses.Count > 0 && !_seenRethrowInCatchClauses.Peek())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
89var currentNode = spineNodes.Peek(); 142var parentNode = spineNodes.Peek();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
434Contract.ThrowIfFalse(Equals(contextualSymbol, _contextualSymbolStack.Peek())); 439=> _contextualSymbolStack.Count == 0 ? null : _contextualSymbolStack.Peek();
Microsoft.CodeAnalysis.AnalyzerUtilities (5)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
152if (_seenRethrowInCatchClauses.Count > 0 && !_seenRethrowInCatchClauses.Peek())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
89var currentNode = spineNodes.Peek(); 142var parentNode = spineNodes.Peek();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
434Contract.ThrowIfFalse(Equals(contextualSymbol, _contextualSymbolStack.Peek())); 439=> _contextualSymbolStack.Count == 0 ? null : _contextualSymbolStack.Peek();
Microsoft.CodeAnalysis.CodeStyle (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
89var currentNode = spineNodes.Peek(); 142var parentNode = spineNodes.Peek();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
434Contract.ThrowIfFalse(Equals(contextualSymbol, _contextualSymbolStack.Peek())); 439=> _contextualSymbolStack.Count == 0 ? null : _contextualSymbolStack.Peek();
Microsoft.CodeAnalysis.CSharp (3)
Compiler\DocumentationCommentCompiler.cs (3)
1403StringBuilder builder = _temporaryStringBuilders.Peek().Pooled.Builder; 1416StringBuilder builder = _temporaryStringBuilders.Peek().Pooled.Builder; 1431StringBuilder builder = _temporaryStringBuilders.Peek().Pooled.Builder;
Microsoft.CodeAnalysis.CSharp.Features (1)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
659var lastSelectExpression = ((SelectClauseSyntax)queryExpressionProcessingInfo.Stack.Peek()).Expression;
Microsoft.CodeAnalysis.Features (5)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (3)
92internal (string target, string hint) NavigationTarget => _navigationTargetStack.Peek(); 93internal TaggedTextStyle Style => _styleStack.Peek(); 171=> _styleStack.Push(_styleStack.Peek() | style);
ExtractMethod\MethodExtractor.TriviaResult.cs (2)
158var top = stack.Peek(); 162top = stack.Peek();
Microsoft.CodeAnalysis.NetAnalyzers (1)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
152if (_seenRethrowInCatchClauses.Count > 0 && !_seenRethrowInCatchClauses.Peek())
Microsoft.CodeAnalysis.Razor.Compiler (6)
Language\CodeGeneration\CodeRenderingContext.cs (2)
84public IntermediateNodeWriter NodeWriter => _scopeStack.Peek().Writer; 87=> _ancestorStack.Count == 0 ? null : _ancestorStack.Peek();
Language\Legacy\HtmlMarkupParser.cs (1)
34private TagTracker? CurrentTracker => _tagTracker.Count > 0 ? _tagTracker.Peek() : null;
Language\Legacy\ParserContext.cs (1)
57public ErrorSink ErrorSink => _errorSinkStack.Peek();
Language\Legacy\TagHelperParseTreeRewriter.cs (2)
75private TagTracker? CurrentTracker => _trackerStack.Count > 0 ? _trackerStack.Peek() : null; 663var currentTracker = _trackerStack.Count > 0 ? _trackerStack.Peek() : null;
Microsoft.CodeAnalysis.ResxSourceGenerator (5)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
152if (_seenRethrowInCatchClauses.Count > 0 && !_seenRethrowInCatchClauses.Peek())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
89var currentNode = spineNodes.Peek(); 142var parentNode = spineNodes.Peek();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
434Contract.ThrowIfFalse(Equals(contextualSymbol, _contextualSymbolStack.Peek())); 439=> _contextualSymbolStack.Count == 0 ? null : _contextualSymbolStack.Peek();
Microsoft.CodeAnalysis.VisualBasic (4)
Compilation\DocumentationComments\DocWriter.vb (3)
61Dim builder As StringBuilder = Me._temporaryStringBuilders.Peek().Pooled.Builder 75Dim builder As StringBuilder = Me._temporaryStringBuilders.Peek().Pooled.Builder 88Dim builder As StringBuilder = Me._temporaryStringBuilders.Peek().Pooled.Builder
Lowering\Diagnostics\DiagnosticsPass.vb (1)
211Debug.Assert(_expressionsBeingVisited.Peek Is node)
Microsoft.CodeAnalysis.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
89var currentNode = spineNodes.Peek(); 142var parentNode = spineNodes.Peek();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
434Contract.ThrowIfFalse(Equals(contextualSymbol, _contextualSymbolStack.Peek())); 439=> _contextualSymbolStack.Count == 0 ? null : _contextualSymbolStack.Peek();
Microsoft.DotNet.PackageTesting (2)
VerifyClosure.cs (2)
176AssemblyInfo assm = depStack.Peek(); 277AssemblyInfo assm = depStack.Peek();
Microsoft.DotNet.SharedFramework.Sdk (2)
src\arcade\src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (2)
176AssemblyInfo assm = depStack.Peek(); 277AssemblyInfo assm = depStack.Peek();
Microsoft.Extensions.Configuration.Json (4)
JsonConfigurationFileParser.cs (4)
77_data[_paths.Peek()] = null; 85_data[_paths.Peek()] = string.Empty; 108string key = _paths.Peek(); 123_paths.Peek() + ConfigurationPath.KeyDelimiter + context :
Microsoft.Extensions.Configuration.Xml (2)
XmlStreamConfigurationProvider.cs (2)
71var parent = currentPath.Peek(); 153XmlConfigurationElement parent = currentPath.Peek();
Microsoft.Extensions.Identity.Core (1)
TokenProviderDescriptor.cs (1)
30public Type ProviderType => _providerTypes.Peek();
Microsoft.Maui.Graphics (2)
PathBuilder.cs (2)
261 var previousCommand = _commandStack.Peek()?[0]; 515 bool isQuad = char.IsLetter(_commandStack.Peek()[0]);
Microsoft.ML.Data (1)
Prediction\Calibrator.cs (1)
1895top = stack.Peek();
Microsoft.ML.Tokenizers (2)
Utils\DoubleArrayTrie.cs (2)
554while (_nodeStack.Peek() != id) 600_nodes[(int)_nodeStack!.Peek()].Child = matchId;
Microsoft.ML.Tokenizers.Tests (2)
src\Microsoft.ML.Tokenizers\Utils\DoubleArrayTrie.cs (2)
554while (_nodeStack.Peek() != id) 600_nodes[(int)_nodeStack!.Peek()].Child = matchId;
Microsoft.ML.TorchSharp (1)
AutoFormerV2\ObjectDetectionMetrics.cs (1)
272float precisionRecord = prStack.Peek().Item1;
Microsoft.TestPlatform.Filter.Source (3)
FilterExpression.cs (3)
269Operator stackTopOperator = isEmpty ? Operator.None : operatorStack.Peek(); 360if (filterStack.Count > 0 && current._right == filterStack.Peek()) 374return result.Peek();
Microsoft.VisualStudio.TestPlatform.Common (8)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FilterExpression.cs (3)
269Operator stackTopOperator = isEmpty ? Operator.None : operatorStack.Peek(); 360if (filterStack.Count > 0 && current._right == filterStack.Peek()) 374return result.Peek();
Utilities\SimpleJSON.cs (5)
557ctx.Add(tokenName, stack.Peek()); 561ctx = stack.Peek(); 575ctx.Add(tokenName, stack.Peek()); 579ctx = stack.Peek(); 603ctx = stack.Peek();
Mono.Cecil.Mdb (1)
Mono.CompilerServices.SymbolWriter\SourceMethodBuilder.cs (1)
135 return (CodeBlockEntry) _block_stack.Peek ();
NuGet.Packaging (5)
Licenses\NuGetLicenseExpressionParser.cs (5)
71while (operatorStack.Count > 0 && operatorStack.Peek().TokenType != LicenseTokenType.OPENING_BRACKET) 95operatorStack.Peek().TokenType == LicenseTokenType.OPENING_BRACKET || // The last token is an opening bracket (treat it the same as empty 96token.TokenType < operatorStack.Peek().TokenType) // An operator that has higher priority than the operator on the stack 101else if (token.TokenType >= operatorStack.Peek().TokenType) 117if (operatorStack.Peek().TokenType != LicenseTokenType.OPENING_BRACKET)
Roslyn.Diagnostics.Analyzers (5)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
152if (_seenRethrowInCatchClauses.Count > 0 && !_seenRethrowInCatchClauses.Peek())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
89var currentNode = spineNodes.Peek(); 142var parentNode = spineNodes.Peek();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
434Contract.ThrowIfFalse(Equals(contextualSymbol, _contextualSymbolStack.Peek())); 439=> _contextualSymbolStack.Count == 0 ? null : _contextualSymbolStack.Peek();
System.Composition.Hosting (1)
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
117if (dependencies.Count == 0 || dependencies.Peek() == null)
System.Console (1)
System\IO\StdInReader.cs (1)
293ConsoleKeyInfo keyInfo = peek ? _availableKeys.Peek() : _availableKeys.Pop();
System.Formats.Asn1 (3)
System\Formats\Asn1\AsnWriter.cs (3)
621(Asn1Tag stackTag, int lenOffset, UniversalTagNumber stackTagType) = _nestingStack.Peek(); 881_frame = _writer._nestingStack.Peek(); 900if (_writer._nestingStack.Peek() == _frame)
System.Linq.Expressions (4)
System\Dynamic\BindingRestrictions.cs (1)
174while (_tests.Count > 0 && _tests.Peek().Depth == depth)
System\Linq\Expressions\Compiler\VariableBinder.cs (2)
65_constants.Peek().AddReference(node.Value!, node.Type); 161CompilerScope currentScope = _scopes.Peek();
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
1959CompileParameterExpression(_exceptionForRethrowStack.Peek());
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\CodeGenerator.cs (1)
1229object stackTop = _blockStack.Peek();
System.Private.Xml (13)
System\Xml\Schema\DtdParser.cs (1)
1109currentFrame = (ParseElementOnlyContent_LocalFrame)localFrames.Peek();
System\Xml\Schema\DtdParserAsync.cs (1)
740currentFrame = (ParseElementOnlyContent_LocalFrame)localFrames.Peek();
System\Xml\Schema\XsdBuilder.cs (1)
843get { return _containerStack.Peek(); }
System\Xml\Serialization\CodeGenerator.cs (6)
397_ilGen!.Emit(OpCodes.Leave, _leaveLabels.Peek()); 1341IfState ifState = (IfState)_blockStack.Peek(); 1362IfState ifState = (IfState)_blockStack.Peek(); 1434WhileState whileState = _whileStack!.Peek(); 1440WhileState whileState = _whileStack!.Peek(); 1450WhileState whileState = _whileStack!.Peek();
System\Xml\Xsl\XsltOld\Compiler.cs (4)
654Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 656this.stylesheet = _stylesheets.Peek(); 666Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 676Debug.Assert(this.stylesheet == _stylesheets!.Peek());
System.Speech (22)
Synthesis\PromptBuilder.cs (22)
60ValidateElement(_elementStack.Peek(), SsmlElement.Text); 74ValidateElement(_elementStack.Peek(), SsmlElement.Text); 112ValidateElement(_elementStack.Peek(), SsmlElement.Text); 152ValidateElement(_elementStack.Peek(), SsmlElement.Text); 168StackElement stackElement = _elementStack.Peek(); 283StackElement stackElement = _elementStack.Peek(); 359StackElement stackElement = _elementStack.Peek(); 395StackElement stackElement = _elementStack.Peek(); 435ValidateElement(_elementStack.Peek(), SsmlElement.Text); 550ValidateElement(_elementStack.Peek(), SsmlElement.Text); 564ValidateElement(_elementStack.Peek(), SsmlElement.Text); 581ValidateElement(_elementStack.Peek(), SsmlElement.Text); 592ValidateElement(_elementStack.Peek(), SsmlElement.Break); 599ValidateElement(_elementStack.Peek(), SsmlElement.Break); 642ValidateElement(_elementStack.Peek(), SsmlElement.Break); 672ValidateElement(_elementStack.Peek(), SsmlElement.Audio); 681ValidateElement(_elementStack.Peek(), SsmlElement.Audio); 695ValidateElement(_elementStack.Peek(), SsmlElement.Audio); 710ValidateElement(_elementStack.Peek(), SsmlElement.Mark); 776SsmlState state = _elementStack.Peek()._state; 964StackElement stackElement = _elementStack.Peek(); 965ValidateElement(_elementStack.Peek(), SsmlElement.Voice);
System.Text.Json (1)
System\Text\Json\Document\JsonDocument.cs (1)
1056JsonElement curr = new JsonElement(document, traversalPath.Peek());
System.Windows.Forms.Design (4)
System\ComponentModel\Design\DesignerHost.DesignerHostTransaction.cs (4)
37if (transactions.Peek() != this) 39string nestedDescription = transactions.Peek().Description; 70if (transactions.Peek() != this) 72string nestedDescription = transactions.Peek().Description;