6 instantiations of Index
System.Numerics.Tensors (2)
System\Buffers\NIndex.cs (2)
161public static explicit operator Index(NIndex value) => new Index((int)value.Value, value.IsFromEnd); 164public static explicit operator checked Index(NIndex value) => new Index(checked((int)value.Value), value.IsFromEnd);
System.Private.CoreLib (4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Index.cs (4)
54public static Index Start => new Index(0); 57public static Index End => new Index(~0); 69return new Index(value); 82return new Index(~value);
115 references to Index
CodeStyleConfigFileGenerator (1)
src\roslyn\src\Dependencies\Contracts\Index.cs (1)
10[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
GenerateDocumentationAndConfigFiles (3)
src\roslyn\src\Dependencies\Contracts\Index.cs (1)
10[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
54public EmbeddedSyntaxNodeOrToken<TSyntaxKind, TSyntaxNode> this[Index index] => this[index.GetOffset(this.ChildCount)];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
748or nameof(Index)
Microsoft.AspNetCore.HttpLogging (1)
FileLoggerProcessor.cs (1)
313.Max(x => int.TryParse(x.Name.Split('.').ElementAtOrDefault(Index.FromEnd(2)), out var parsed)
Microsoft.AspNetCore.Razor.Utilities.Shared (14)
ArrayExtensions.cs (5)
14/// Creates a new span over the portion of the target array defined by an <see cref="Index"/> value. 23/// This uses Razor's <see cref="Index"/> type, which is type-forwarded on .NET. 34public static Span<T> AsSpan<T>(this T[]? array, Index startIndex) 108/// This uses Razor's <see cref="Index"/> type, which is type-forwarded on .NET. 119public static Memory<T> AsMemory<T>(this T[]? array, Index startIndex)
src\roslyn\src\Dependencies\Contracts\Index.cs (1)
10[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledArrayBuilder`1.cs (3)
197public T this[Index index] 618public void RemoveAt(Index index) 690var index = ^1;
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\ReadOnlyListExtensions.cs (1)
1047public static Enumerable<T> AsEnumerable<T>(this IReadOnlyList<T> list, Index startIndex)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\StringExtensions.cs (4)
60public static ReadOnlySpan<char> AsSpan(this string? text, Index startIndex) 174public static ReadOnlySpan<char> AsSpanOrDefault(this string? text, Index startIndex) 232public static ReadOnlyMemory<char> AsMemory(this string? text, Index startIndex) 346public static ReadOnlyMemory<char> AsMemoryOrDefault(this string? text, Index startIndex)
Microsoft.Bcl.Memory (1)
Microsoft.Bcl.Memory.Forwards.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
Microsoft.Build.Framework (1)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.contracts\5.0.0-1.25277.114\contentFiles\cs\net9.0\Index.cs (1)
10[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
Microsoft.Build.Tasks.CodeAnalysis (1)
src\roslyn\src\Dependencies\Contracts\Index.cs (1)
10[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
Microsoft.CodeAnalysis (1)
src\roslyn\src\Dependencies\Contracts\Index.cs (1)
10[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Invocation.cs (1)
1629var lastIndex = expanded ? ^1 : ^0;
Parser\LanguageParser_InterpolatedString.cs (1)
198var currentContentStart = openQuoteRange.End;
Microsoft.CodeAnalysis.CSharp.Features (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (1)
45var indexType = compilation.GetBestTypeByMetadataName(typeof(Index).FullName!);
Microsoft.CodeAnalysis.Workspaces (3)
src\roslyn\src\Dependencies\Contracts\Index.cs (1)
10[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
54public EmbeddedSyntaxNodeOrToken<TSyntaxKind, TSyntaxNode> this[Index index] => this[index.GetOffset(this.ChildCount)];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
748or nameof(Index)
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (1)
src\roslyn\src\Dependencies\Contracts\Index.cs (1)
10[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
mscorlib (1)
mscorlib.cs (1)
23[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
netstandard (1)
netstandard.cs (1)
873[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
System.Linq (4)
System\Linq\ElementAt.cs (2)
48public static TSource ElementAt<TSource>(this IEnumerable<TSource> source, Index index) 93public static TSource? ElementAtOrDefault<TSource>(this IEnumerable<TSource> source, Index index)
System\Linq\Take.cs (2)
48Index start = range.Start; 49Index end = range.End;
System.Linq.AsyncEnumerable (3)
System\Linq\ElementAtAsync.cs (2)
66Index index, 93Index index,
System\Linq\Take.cs (1)
71Index start = range.Start, end = range.End;
System.Linq.Queryable (4)
System\Linq\Queryable.cs (4)
2247public static TSource ElementAt<TSource>(this IQueryable<TSource> source, Index index) 2257new Func<IQueryable<TSource>, Index, TSource>(ElementAt).Method, 2280public static TSource? ElementAtOrDefault<TSource>(this IQueryable<TSource> source, Index index) 2287new Func<IQueryable<TSource>, Index, TSource?>(ElementAtOrDefault).Method,
System.Numerics.Tensors (22)
System\Buffers\NIndex.cs (14)
41/// <summary>Constructs an <see cref="NIndex"/> from an <see cref="Index"/>.</summary> 42/// <param name="index">The <see cref="Index"/> to create the <see cref="NIndex"/> from.</param> 47public NIndex(Index index) 94/// Converts the <see cref="NIndex"/> to an <see cref="Index"/>. 97public Index ToIndex() => checked((Index)this); 100/// Converts the <see cref="NIndex"/> to an <see cref="Index"/> without doing bounds checks. 103public Index ToIndexUnchecked() => (Index)this; 158public static implicit operator NIndex(Index value) => new NIndex(value); 160/// <summary>Converts an <see cref="NIndex"/> to an <see cref="Index"/>.</summary> 161public static explicit operator Index(NIndex value) => new Index((int)value.Value, value.IsFromEnd); 163/// <summary>Converts an <see cref="NIndex"/> to an <see cref="Index"/>.</summary> 164public static explicit operator checked Index(NIndex value) => new Index(checked((int)value.Value), value.IsFromEnd);
System\Buffers\NRange.cs (8)
133public static explicit operator Range(NRange value) => new Range((Index)value.Start, (Index)value.End); 139public static explicit operator checked Range(NRange value) => new Range(checked((Index)value.Start), checked((Index)value.End)); 145public Range ToRange() => new Range(checked((Index)Start), checked((Index)End)); 151public Range ToRangeUnchecked() => new Range((Index)Start, (Index)End);
System.Private.CoreLib (45)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\StringInfo.cs (1)
88Index end = ^0; // assume reading to end of the string unless the caller told us to stop early
src\runtime\src\libraries\System.Private.CoreLib\src\System\Index.cs (9)
23readonly struct Index : IEquatable<Index> 54public static Index Start => new Index(0); 57public static Index End => new Index(~0); 62public static Index FromStart(int value) 75public static Index FromEnd(int value) 125public override bool Equals([NotNullWhen(true)] object? value) => value is Index && _value == ((Index)value)._value; 129public bool Equals(Index other) => _value == other._value; 135public static implicit operator Index(int value) => FromStart(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (25)
46public static Span<T> AsSpan<T>(this T[]? array, Index startIndex) 50if (!startIndex.Equals(Index.Start)) 74Index startIndex = range.Start; 75Index endIndex = range.End; 77if (!startIndex.Equals(Index.Start) || !endIndex.Equals(Index.Start)) 134public static ReadOnlySpan<char> AsSpan(this string? text, Index startIndex) 138if (!startIndex.Equals(Index.Start)) 166Index startIndex = range.Start; 167Index endIndex = range.End; 169if (!startIndex.Equals(Index.Start) || !endIndex.Equals(Index.Start)) 249public static ReadOnlyMemory<char> AsMemory(this string? text, Index startIndex) 253if (!startIndex.Equals(Index.Start)) 302Index startIndex = range.Start; 303Index endIndex = range.End; 305if (!startIndex.Equals(Index.Start) || !endIndex.Equals(Index.Start)) 3786public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Index startIndex) 3849public static Memory<T> AsMemory<T>(this T[]? array, Index startIndex) 3853if (!startIndex.Equals(Index.Start)) 3885Index startIndex = range.Start; 3886Index endIndex = range.End; 3887if (!startIndex.Equals(Index.Start) || !endIndex.Equals(Index.Start))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Range.cs (10)
31public Index Start { get; } 34public Index End { get; } 39public Range(Index start, Index end) 100public static Range StartAt(Index start) => new Range(start, Index.End); 103public static Range EndAt(Index end) => new Range(Index.Start, end); 106public static Range All => new Range(Index.Start, Index.End);
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
277[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
System.Security.Cryptography (4)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PemKeyHelpers.Factory.cs (2)
50Index offset = fields.Location.End; 124Index offset = fields.Location.End;
System\Security\Cryptography\PemKeyHelpers.cs (2)
126Index offset = fields.Location.End; 203Index offset = fields.Location.End;