176 references to IndexOf
aspire (1)
Mcp\Docs\DocsCache.cs (1)
206result[i] = Array.IndexOf(s_invalidFileNameChars, c) >= 0 ? '_' : c;
Aspire.Cli.Tests (37)
Commands\DoCommandTests.cs (1)
221var outputPathIndex = Array.IndexOf(args, "--output-path");
Commands\RunCommandTests.cs (4)
961var watchIndex = Array.IndexOf(args, "watch"); 962var nonInteractiveIndex = Array.IndexOf(args, "--non-interactive"); 1057var watchIndex = Array.IndexOf(args, "watch"); 1058var verboseIndex = Array.IndexOf(args, "--verbose");
DotNet\DotNetCliRunnerTests.cs (32)
583var packageIndex = Array.IndexOf(args, "package"); 584var addIndex = Array.IndexOf(args, "add"); 585var fileIndex = Array.IndexOf(args, "--file"); 586var filePathIndex = Array.IndexOf(args, appHostFile.FullName); 587var packageNameIndex = Array.IndexOf(args, "Aspire.Hosting.Redis@9.2.0"); 638var packageIndex = Array.IndexOf(args, "package"); 639var addIndex = Array.IndexOf(args, "add"); 640var projectFlagIndex = Array.IndexOf(args, "--project"); 641var projectValueIndex = Array.IndexOf(args, projectFile.FullName); 642var packageNameIndex = Array.IndexOf(args, "Aspire.Hosting.Redis"); 643var versionFlagIndex = Array.IndexOf(args, "--version"); 644var versionValueIndex = Array.IndexOf(args, "9.2.0"); 645var sourceFlagIndex = Array.IndexOf(args, "--source"); 646var sourceValueIndex = Array.IndexOf(args, "https://api.nuget.org/v3/index.json"); 705var packageIndex = Array.IndexOf(args, "package"); 706var addIndex = Array.IndexOf(args, "add"); 707var packageNameIndex = Array.IndexOf(args, "Aspire.Hosting.Redis"); 708var versionFlagIndex = Array.IndexOf(args, "--version"); 709var versionValueIndex = Array.IndexOf(args, "9.2.0"); 710var projectFlagIndex = Array.IndexOf(args, "--project"); 711var projectValueIndex = Array.IndexOf(args, projectFile.FullName); 712var noRestoreIndex = Array.IndexOf(args, "--no-restore"); 773var packageIndex = Array.IndexOf(args, "package"); 774var addIndex = Array.IndexOf(args, "add"); 775var packageNameIndex = Array.IndexOf(args, "Aspire.Hosting.Redis"); 776var versionFlagIndex = Array.IndexOf(args, "--version"); 777var versionValueIndex = Array.IndexOf(args, "9.2.0"); 778var projectFlagIndex = Array.IndexOf(args, "--project"); 779var projectValueIndex = Array.IndexOf(args, projectFile.FullName); 780var sourceFlagIndex = Array.IndexOf(args, "--source"); 781var sourceValueIndex = Array.IndexOf(args, "https://api.nuget.org/v3/index.json"); 782var noRestoreIndex = Array.IndexOf(args, "--no-restore");
Aspire.Hosting.Maui (1)
Utilities\MauiEnvironmentHelper.cs (1)
192if (Array.IndexOf(invalidCharacters, chars[i]) >= 0)
dotnet-format (1)
Commands\FormatCommandCommon.cs (1)
356var netCoreAppIndex = Array.IndexOf(pathParts, "Microsoft.NETCore.App");
dotnet-svcutil-lib (3)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MessageContractImporter.cs (1)
489isReturn = Array.IndexOf<string>(parameterOrder, part.Name) == -1;
Metadata\MetadataFileNameManager.cs (1)
158if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
OutputPathHelper.cs (1)
164if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
dotnet-svcutil.xmlserializer (1)
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (1)
215if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
ILCompiler.Compiler (13)
Compiler\CompilerTypeSystemContext.Aot.cs (1)
191return Array.IndexOf(_arrayEnumeratorOfTInterfaces, interfaceDefinition) >= 0;
Compiler\CompilerTypeSystemContext.GetFieldMethodOverrides.cs (1)
117&& Array.IndexOf(type.RuntimeInterfaces, _iAsyncStateMachineType) >= 0;
Compiler\CompilerTypeSystemContext.InterfaceThunks.cs (1)
91interfaceIndex = Array.IndexOf(implementingClass.GetTypeDefinition().RuntimeInterfaces, interfaceOnDefinition);
Compiler\DependencyAnalysis\DictionaryLayoutNode.cs (3)
213slot = Array.IndexOf(_layout, entry); 240if (slot < 0 && Array.IndexOf(_discardedSlots, entry) >= 0) 309slot = Array.IndexOf(_layout, entry);
Compiler\DependencyAnalysis\InterfaceDispatchMapNode.cs (1)
275int indexOfInterface = Array.IndexOf(declTypeDefinitionRuntimeInterfaces, providingInterfaceDefinitionType);
Compiler\DependencyAnalysis\VTableSliceNode.cs (3)
125Debug.Assert(Array.IndexOf(_slots, slot) >= 0); 178Debug.Assert(Array.IndexOf(_slots, slot) >= 0); 200Debug.Assert(Array.IndexOf(_slots, virtualMethod) >= 0);
Compiler\DescriptorMarker.cs (3)
283if (Array.IndexOf(accessors, "all") >= 0) 290if (property.GetMethod != null && Array.IndexOf(accessors, "get") >= 0) 299if (property.SetMethod != null && Array.IndexOf(accessors, "set") >= 0)
ILCompiler.TypeSystem (3)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\ConstructedTypeRewritingHelpers.cs (2)
23int directDiscoveryIndex = Array.IndexOf(typesToFind, type); 73int directReplacementIndex = Array.IndexOf(typesToReplace, type);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MetadataVirtualMethodAlgorithm.cs (1)
346int index = Array.IndexOf(interfacesOnDefinition, foundMethodImplsOnDefinition[results[i]].Decl.OwningType);
illink (3)
Microsoft.Build.Framework (4)
ChangeWaves.cs (2)
151else if (_cachedWave == EnableAllFeatures || Array.IndexOf(AllWaves, _cachedWave) >= 0) 183Debug.Assert(_runningTests || Array.IndexOf(AllWaves, wave) >= 0, $"Change wave version {wave} is invalid");
Utilities\FileMatcher.cs (2)
2666if (Array.IndexOf(directorySeparatorCharacters, possibleParent[possibleParent.Length - 1]) >= 0) 2672return Array.IndexOf(directorySeparatorCharacters, possibleChild[possibleParent.Length]) >= 0;
Microsoft.Build.Tasks.CodeAnalysis (1)
src\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs (1)
1029return Array.IndexOf(supportedList, langVersion) < 0;
Microsoft.Build.Tasks.Core (3)
SetRidAgnosticValueForProjects.cs (1)
41int targetFrameworkIndex = Array.IndexOf(targetFrameworksArray, nearestTargetFramework);
src\msbuild\src\Shared\LanguageParser\CSharptokenEnumerator.cs (1)
194if (Array.IndexOf(s_keywordList, identifierOrKeyword) >= 0)
src\msbuild\src\Shared\LanguageParser\VisualBasictokenEnumerator.cs (1)
158if (Array.IndexOf(s_keywordList, upper) >= 0)
Microsoft.CodeAnalysis (1)
InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
Microsoft.CodeAnalysis.Analyzers (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
Microsoft.CodeAnalysis.Features (1)
Common\AbstractProjectExtensionProvider.cs (1)
106Array.IndexOf(extensionInfo.DocumentExtensions, PathUtilities.GetExtension(document.FilePath)) < 0)
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
Microsoft.CodeAnalysis.Workspaces (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
Microsoft.DotNet.Build.Tasks.Installers (1)
src\RpmLead.cs (1)
40lead.Name = Encoding.UTF8.GetString(name, 0, Array.IndexOf<byte>(name, 0));
Microsoft.Extensions.FileProviders.Embedded (2)
Manifest\EmbeddedFilesManifest.cs (2)
73var start = Array.IndexOf(_separators, path[0]) == -1 ? 0 : 1; 79var end = Array.IndexOf(_separators, path[path.Length - 1]) == -1 ? path.Length : path.Length - 1;
Microsoft.Extensions.ServiceDiscovery (2)
Configuration\ConfigurationServiceEndpointProvider.cs (2)
149var index = Array.IndexOf(_schemes, scheme); 161var index = Array.IndexOf(_schemes, scheme);
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
576int index = System.Array.IndexOf(s_preferredAttributeArgumentOrder, name);
Microsoft.Interop.SourceGeneration (1)
Marshalling\MarshallerHelpers.cs (1)
222public bool AnyEdges => Array.IndexOf(_edgeMap, true) >= 0;
Microsoft.Maui (1)
Extensions\EnumerableExtensions.cs (1)
77 return Array.IndexOf(array, item);
Microsoft.Maui.Controls (2)
BindableProperty.cs (1)
222 if (SimpleConvertTypes.TryGetValue(valueType, out Type[] convertibleTo) && Array.IndexOf(convertibleTo, returnType) != -1)
Registrar.cs (1)
456 int indexOfExecuting = Array.IndexOf(assemblies, defaultRendererAssembly);
Microsoft.Maui.Controls.SourceGen (1)
CodeBehindGenerator.cs (1)
451 var indexOfCompile = Array.IndexOf(parts, "compile");
Microsoft.ML.FastTree (4)
TreeEnsemble\InternalRegressionTree.cs (4)
1470int parentOfLteChild1 = Array.IndexOf(LteChild, pos1); 1471int parentOfGtChild1 = Array.IndexOf(GtChild, pos1); 1472int parentOfLteChild2 = Array.IndexOf(LteChild, pos2); 1473int parentOfGtChild2 = Array.IndexOf(GtChild, pos2);
Microsoft.ML.Samples.OneDal (3)
Program.cs (3)
29columns.Add(new TextLoader.Column(column, DataKind.Boolean, Array.IndexOf(headerArray, column))); 31columns.Add(new TextLoader.Column(column, DataKind.Single, Array.IndexOf(headerArray, column))); 35columns.Add(new TextLoader.Column(column, DataKind.Single, Array.IndexOf(headerArray, column)));
Microsoft.ML.SearchSpace (1)
Option\ChoiceOption.cs (1)
68var x = Array.IndexOf(Choices, param);
Microsoft.ML.TensorFlow.Tests (4)
TensorflowTests.cs (4)
1572Assert.True(Array.IndexOf(labels, predictionFirst.PredictedLabel) > -1); 1573Assert.True(Array.IndexOf(labels, predictionSecond.PredictedLabel) > -1); 1731Assert.True(Array.IndexOf(labels, predictionFirst.PredictedLabel) > -1); 1732Assert.True(Array.IndexOf(labels, predictionSecond.PredictedLabel) > -1);
Microsoft.NET.Build.Tasks (1)
GenerateDepsFile.cs (1)
316return Array.IndexOf(ValidRuntimeIdentifierPlatformsForAssets, platform.ToLowerInvariant()) == -1;
NuGet.Packaging (1)
PackageCreation\Authoring\ManifestSchemaUtility.cs (1)
67int index = Math.Max(0, Array.IndexOf(VersionToSchemaMappings, @namespace));
PresentationCore (9)
MS\Internal\FontCache\FontCacheUtil.cs (1)
446if (Array.IndexOf<char>(InvalidFileNameChars, unescapedChar) >= 0)
MS\Internal\SynchronizedInputHelper.cs (2)
89if (Array.IndexOf(InputManager.SynchronizedInputEvents, args.RoutedEvent) >= 0) 103Array.IndexOf(InputManager.SynchronizedInputEvents, args.RoutedEvent) >= 0)
System\Windows\GlobalEventManager.cs (2)
118if(Array.IndexOf(routedEvents, routedEvent) < 0) 137if(Array.IndexOf(routedEvents, routedEvent) < 0)
System\Windows\Input\InputManager.cs (2)
747Array.IndexOf(SynchronizedInputEvents, input.RoutedEvent) < 0 && 748Array.IndexOf(PairedSynchronizedInputEvents, input.RoutedEvent) < 0)
System\Windows\Media\Imaging\BitmapSource.cs (2)
994int i = Array.IndexOf(s_supportedDUCEFormats, format); 1583return (Array.IndexOf(s_supportedDUCEFormats, format) != -1);
PresentationFramework (1)
MS\Internal\Data\RBNode.cs (1)
47public int OffsetOf(T x) { return Array.IndexOf(_data, x); }
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
System.ComponentModel.TypeConverter (1)
System\ComponentModel\CultureInfoConverter.cs (1)
179int invariantIndex = Array.IndexOf(installedCultures, CultureInfo.InvariantCulture);
System.Data.OleDb (1)
DbConnectionStringCommon.cs (1)
74return Array.IndexOf(_items, value) >= 0;
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\ActivitySource.cs (2)
589int index = Array.IndexOf(_volatileArray, item); 611int index = Array.IndexOf(_volatileArray, item);
System.Diagnostics.Process (1)
src\runtime\src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (1)
407if (Array.IndexOf(line[lineParts[1]].Split(','), subsystem) < 0)
System.IO.FileSystem.Watcher (2)
System\IO\FileSystemWatcher.cs (2)
741public bool Contains(string item) => Array.IndexOf(Items, item) >= 0; 747public int IndexOf(string item) => Array.IndexOf(Items, item);
System.IO.Packaging (3)
System\IO\Packaging\ContentType.cs (2)
480Array.IndexOf(s_allowedCharacters, character) >= 0; 500ch <= ' ' && Array.IndexOf(s_linearWhiteSpaceChars, ch) >= 0;
System\IO\Packaging\PartBasedPackageProperties.cs (1)
542if (Array.IndexOf(s_validProperties, xmlStringIndex) < 0) // An unexpected element is an error.
System.Management (7)
System\Management\ManagementPath.cs (7)
328pathStr = new string(pathChars, 0, Array.IndexOf(pathChars, '\0')); 519pathStr = new string(pathChars, 0, Array.IndexOf(pathChars, '\0')); 616pathStr = new string(pathChars, 0, Array.IndexOf(pathChars, '\0')); 750string serverNew = new string(newServerChars, 0, Array.IndexOf(newServerChars, '\0')); 763string serverOrg = new string(orgServerChars, 0, Array.IndexOf(orgServerChars, '\0')); 822pathStr = new string(pathChars, 0, Array.IndexOf(pathChars, '\0')); 920pathStr = new string(pathChars, 0, Array.IndexOf(pathChars, '\0'));
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (1)
422Debug.Assert(!disposing || Array.IndexOf(_http11Connections.ToArray(), connection) < 0);
System.Net.Security (1)
System\Net\Security\SslStream.Protocol.cs (1)
417found = Array.IndexOf(issuers, issuer) >= 0;
System.Private.CoreLib (12)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetUnixVersion.cs (1)
40Debug.Assert(Array.IndexOf<byte>(version, 0) >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (1)
429if (Array.IndexOf(requiredType, VarType) < 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncodingProvider.cs (1)
64if (Array.IndexOf(providers, provider) >= 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (1)
531Debug.Assert(Array.IndexOf(newChangeNotifications, local) >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (2)
445if (Array.IndexOf(_registeredWaits, handle) >= 0) 447if (Array.IndexOf(_pendingRemoves, handle) < 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (1)
5527signaledTaskIndex = Array.IndexOf(tasks, firstCompleted.Result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (2)
46Debug.Assert(Array.IndexOf(oldQueues, queue) < 0); 69int pos = Array.IndexOf(oldQueues, queue);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Type.Enum.cs (1)
43if (Array.IndexOf(names, value) >= 0)
System\Reflection\Runtime\General\Helpers.cs (1)
111return Array.IndexOf(s_charsToEscape, c) >= 0;
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.InvokeMember.cs (1)
69if (namedParams != null && Array.IndexOf(namedParams, null) >= 0)
System.Private.Xml (1)
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (1)
335int index = Array.IndexOf(_items, value);
System.Reflection.Metadata (1)
System\Reflection\Internal\Utilities\PathUtilities.cs (1)
20(Array.IndexOf(Path.GetInvalidFileNameChars(), '*') >= 0 ? DirectorySeparatorChar : AltDirectorySeparatorChar).ToString();
System.Security.Cryptography (4)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (4)
51if (Array.IndexOf(validOids, spki.Algorithm.Algorithm) < 0) 81if (Array.IndexOf(validOids, spki.Algorithm.Algorithm) < 0 || 124if (Array.IndexOf(validOids, privateKeyInfo.PrivateKeyAlgorithm.Algorithm) < 0) 151if (Array.IndexOf(validOids, privateKeyInfo.PrivateKeyAlgorithm.Algorithm) < 0 ||
System.Security.Cryptography.Pkcs (4)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (4)
51if (Array.IndexOf(validOids, spki.Algorithm.Algorithm) < 0) 81if (Array.IndexOf(validOids, spki.Algorithm.Algorithm) < 0 || 124if (Array.IndexOf(validOids, privateKeyInfo.PrivateKeyAlgorithm.Algorithm) < 0) 151if (Array.IndexOf(validOids, privateKeyInfo.PrivateKeyAlgorithm.Algorithm) < 0 ||
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Union.cs (1)
459Debug.Assert(Array.IndexOf(types, root) < 0);
System.Threading.Tasks.Dataflow (2)
Internal\ImmutableArray.cs (2)
64int index = Array.IndexOf(_array, item); 83public bool Contains(T item) { return Array.IndexOf(_array, item) >= 0; }
System.Windows.Forms (6)
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (2)
159index = Array.IndexOf(ctrls, owner); 171index = Array.IndexOf(ctrls, owner);
System\Windows\Forms\Controls\ListBoxes\ListBox.IntegerCollection.cs (1)
93index = Array.IndexOf(_innerArray, item);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
3528index = Array.IndexOf(components, component);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
1835int focusIndex = Array.IndexOf(displayedItems, item);
System\Windows\Forms\Input\InputLanguageCollection.cs (1)
20Debug.Assert(Array.IndexOf(value, null!) == -1, "Should not contain null");
System.Windows.Forms.Design (3)
System\Windows\Forms\Design\CommandSet.cs (2)
2061else if (associatedComps.Contains(curComp) && Array.IndexOf(allComponents, parentComp) == -1) 2584primaryIndex = Array.IndexOf(selectedObjects, primary);
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (1)
169return Array.IndexOf(GetFormats(), format) != -1;
UIAutomationClientSideProviders (3)
MS\Internal\AutomationProxies\MSAANativeProvider.cs (1)
836rval = (Array.IndexOf(entry._patterns, pattern)>=0);
MS\Internal\AutomationProxies\WindowsListView.cs (2)
244int location = Array.IndexOf (groupIds, groupID); 285int location = Array.IndexOf (groupIds, groupID);