6228 references to GetType
AnalyzerRunner (9)
CodeRefactoringRunner.cs (2)
182if (!refactoringTypes.Add(refactoring.GetType())) 192else if (options.AnalyzerNames.Contains(refactoring.GetType().Name))
DiagnosticAnalyzerRunner.cs (7)
261if (!analyzerTypes.Add(analyzer.GetType())) 278else if (options.AnalyzerNames.Contains(analyzer.GetType().Name)) 430foreach (var pair in telemetryInfoDictionary.OrderBy(x => x.Key.GetType().Name, StringComparer.OrdinalIgnoreCase)) 432WriteTelemetry(pair.Key.GetType().Name, pair.Value); 436var longestAnalyzerName = telemetryInfoDictionary.Select(x => x.Key.GetType().Name.Length).Max(); 437foreach (var pair in telemetryInfoDictionary.OrderBy(x => x.Key.GetType().Name, StringComparer.OrdinalIgnoreCase)) 439WriteExecutionTimes(pair.Key.GetType().Name, longestAnalyzerName, pair.Value);
ApiExplorerWebSite (3)
ApiExplorerDataFilter.cs (3)
77ConstraintTypes = parameter.RouteInfo.Constraints?.Select(c => c.GetType().Name).ToArray(), 90FormatterType = request.Formatter?.GetType().FullName, 108FormatterType = responseFormat.Formatter?.GetType().FullName,
ApplicationModelWebSite (1)
Conventions\FromHeaderConvention.cs (1)
15if (param.Attributes.Any(p => p.GetType() == typeof(FromHeaderAttribute)))
Aspire.Azure.Messaging.EventHubs.Tests (1)
AspireEventHubsExtensionsTests.cs (1)
663var consumerGroupProperty = settings.GetType().GetProperty("ConsumerGroup");
Aspire.Confluent.Kafka (2)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\Shared\Guard.cs (1)
179throw new InvalidCastException($"Cannot cast '{paramName}' from '{value?.GetType().ToString() ?? "null"}' to '{typeof(T)}'");
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\Shared\PropertyFetcher.AOT.cs (1)
78var fetcher = PropertyFetch.Create(obj.GetType().GetTypeInfo(), propertyName);
Aspire.Dashboard (1)
Components\Controls\Chart\ChartBase.cs (1)
213throw new InvalidOperationException("Unexpected metric type: " + metric.GetType());
Aspire.Dashboard.Tests (3)
AssemblyExtensionsTests.cs (1)
91return _customAttributes.Where(a => a.GetType() == attributeType).ToArray();
Integration\OtlpGrpcServiceTests.cs (1)
160var logger = loggerFactory.CreateLogger(GetType());
OtlpApiKeyAuthenticationHandlerTests.cs (1)
100await handler.InitializeAsync(new AuthenticationScheme("Test", "Test", handler.GetType()), httpContext);
Aspire.Hosting (9)
ApplicationModel\EnvironmentCallbackAnnotation.cs (1)
82var text = $@"Type = {GetType().Name}";
ApplicationModel\Resource.cs (1)
37return $@"Type = {GetType().Name}, Name = ""{Name}"", Annotations = {Annotations.Count}";
ApplicationModel\ResourceNotificationService.cs (1)
685ResourceType = resource.GetType().Name,
Dashboard\DashboardLifecycleHook.cs (1)
174_ => dashboardResource.GetType().Name
Dcp\DcpExecutor.cs (1)
417_ => throw new InvalidOperationException($"Unknown resource type {resource.GetType().Name}")
DistributedApplicationBuilder.cs (2)
529throw new DistributedApplicationException($"Cannot add resource of type '{resource.GetType()}' with name '{resource.Name}' because resource of type '{existingResource.GetType()}' with that name already exists. Resource names are case-insensitive.");
DistributedApplicationBuilderExtensions.cs (1)
72throw new InvalidOperationException($"Resource '{name}' of type '{resource.GetType()}' is not assignable to requested type '{typeof(T).Name}'.");
Publishing\ResourceContainerImageBuilder.cs (1)
70throw new NotSupportedException($"The resource type '{resource.GetType().Name}' is not supported.");
Aspire.Hosting.Azure (11)
AzureBicepResource.cs (4)
115using var resourceStream = GetType().Assembly.GetManifestResourceStream(TemplateResourceName) 116?? throw new InvalidOperationException($"Could not find resource {TemplateResourceName} in assembly {GetType().Assembly}"); 138using var resourceStream = GetType().Assembly.GetManifestResourceStream(TemplateResourceName) 139?? throw new InvalidOperationException($"Could not find resource {TemplateResourceName} in assembly {GetType().Assembly}");
AzurePublishingContext.cs (1)
180_ => throw new NotSupportedException("Unsupported value type " + val.GetType())
AzureResourcePreparer.cs (1)
411throw new NotSupportedException("Unsupported value type " + value.GetType());
Provisioning\Provisioners\AzureProvisioner.cs (2)
262var type = resource.GetType(); 287resourceLogger.LogWarning("No provisioner found for {resourceType} skipping.", resource.GetType().Name);
Provisioning\Provisioners\BicepProvisioner.cs (1)
134ResourceType = resource.GetType().Name,
Provisioning\Provisioners\TokenCredentialHolder.cs (2)
46if (Credential.GetType() == typeof(DefaultAzureCredential)) 54_logger.LogInformation("Using {credentialType} for provisioning.", Credential.GetType().Name);
Aspire.Hosting.Azure.AppContainers (2)
ContainerAppContext.cs (2)
432_ => throw new NotSupportedException("Unsupported value type " + val.GetType()) 600throw new NotSupportedException("Unsupported value type " + value.GetType());
Aspire.Hosting.Azure.AppService (2)
AzureAppServiceWebsiteContext.cs (2)
184throw new NotSupportedException($"Unsupported value type {value.GetType()}"); 195_ => throw new NotSupportedException($"Unsupported value type {val.GetType()}")
Aspire.Hosting.Keycloak.Tests (2)
KeycloakResourceBuilderTests.cs (2)
96Assert.Equal("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", rmq.Resource.AdminPasswordParameter.Default?.GetType().FullName); 106Assert.NotEqual("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", rmq.Resource.AdminPasswordParameter.Default?.GetType().FullName);
Aspire.Hosting.Kubernetes (4)
KubernetesPublishingContext.cs (1)
133var fileName = $"{templatedItem.GetType().Name.ToLowerInvariant()}.yaml";
KubernetesServiceResourceExtensions.cs (2)
87context.Logger.NotSupportedResourceWarning(nameof(value), r.GetType().Name); 92throw new NotSupportedException($"Unsupported value type: {value.GetType().Name}");
Yaml\IntOrStringConverter.cs (1)
60throw new InvalidOperationException($"Expected {nameof(Int32OrStringV1)} but got {value?.GetType()}");
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
23Assert.Equal("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", mysql.Resource.PasswordParameter.Default?.GetType().FullName); 33Assert.NotEqual("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", mysql.Resource.PasswordParameter.Default?.GetType().FullName);
Aspire.Hosting.Nats.Tests (2)
AddNatsTests.cs (2)
21Assert.Equal("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", nats.Resource.PasswordParameter!.Default?.GetType().FullName); 31Assert.NotEqual("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", nats.Resource.PasswordParameter!.Default?.GetType().FullName);
Aspire.Hosting.Oracle.Tests (2)
AddOracleTests.cs (2)
22Assert.Equal("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", orcl.Resource.PasswordParameter.Default?.GetType().FullName); 32Assert.NotEqual("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", orcl.Resource.PasswordParameter.Default?.GetType().FullName);
Aspire.Hosting.Orleans (1)
ProviderConfiguration.cs (1)
22var resourceType = resourceBuilder.Resource.GetType().Name;
Aspire.Hosting.PostgreSQL.Tests (2)
AddPostgresTests.cs (2)
32Assert.Equal("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", pg.Resource.PasswordParameter.Default?.GetType().FullName); 42Assert.NotEqual("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", pg.Resource.PasswordParameter.Default?.GetType().FullName);
Aspire.Hosting.Qdrant.Tests (2)
AddQdrantTests.cs (2)
25Assert.Equal("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", qd.Resource.ApiKeyParameter.Default?.GetType().FullName); 35Assert.NotEqual("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", qd.Resource.ApiKeyParameter.Default?.GetType().FullName);
Aspire.Hosting.RabbitMQ.Tests (2)
AddRabbitMQTests.cs (2)
21Assert.Equal("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", rmq.Resource.PasswordParameter.Default?.GetType().FullName); 31Assert.NotEqual("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", rmq.Resource.PasswordParameter.Default?.GetType().FullName);
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
22Assert.Equal("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", sql.Resource.PasswordParameter.Default?.GetType().FullName); 32Assert.NotEqual("Aspire.Hosting.ApplicationModel.UserSecretsParameterDefault", sql.Resource.PasswordParameter.Default?.GetType().FullName);
Aspire.Hosting.Tests (1)
DistributedApplicationTests.cs (1)
1184var kubernetesLifecycle = (KubernetesTestLifecycleHook)lifecycles.Where(l => l.GetType() == typeof(KubernetesTestLifecycleHook)).First();
Aspire.Microsoft.Data.SqlClient (2)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (1)
74var fetcher = PropertyFetch.Create(obj.GetType().GetTypeInfo(), propertyName);
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\Guard.cs (1)
177throw new InvalidCastException($"Cannot cast '{paramName}' from '{value?.GetType().ToString() ?? "null"}' to '{typeof(T)}'");
Aspire.Microsoft.EntityFrameworkCore.SqlServer (3)
AspireSqlServerEFCoreSqlClientExtensions.cs (1)
142else if (executionStrategy.GetType() != typeof(SqlServerExecutionStrategy))
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (1)
74var fetcher = PropertyFetch.Create(obj.GetType().GetTypeInfo(), propertyName);
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\Guard.cs (1)
177throw new InvalidCastException($"Cannot cast '{paramName}' from '{value?.GetType().ToString() ?? "null"}' to '{typeof(T)}'");
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (1)
AspireEFPostgreSqlExtensions.cs (1)
157else if (executionStrategy.GetType() != typeof(NpgsqlExecutionStrategy))
Aspire.Oracle.EntityFrameworkCore (1)
AspireOracleEFCoreExtensions.cs (1)
144else if (executionStrategy.GetType() != typeof(OracleExecutionStrategy))
Aspire.Pomelo.EntityFrameworkCore.MySql (1)
AspireEFMySqlExtensions.cs (1)
200else if (executionStrategy.GetType() != typeof(MySqlExecutionStrategy))
Aspire.RabbitMQ.Client.v7.Tests (3)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (3)
212s_log.GetType().GetMethod("Info")!.Invoke(s_log, new object[] { message }); 220s_log.GetType().GetMethod("Warn")!.Invoke(s_log, new object[] { message }); 228s_log.GetType().GetMethod("Error", [typeof(string), typeof(Exception)])!.Invoke(s_log, new object[] { message, ex });
Aspire.StackExchange.Redis (3)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (1)
47if (message.GetType() == scriptMessageType)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\Guard.cs (1)
185throw new InvalidCastException($"Cannot cast '{paramName}' from '{value?.GetType().ToString() ?? "null"}' to '{typeof(T)}'");
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\PropertyFetcher.AOT.cs (1)
80var fetcher = PropertyFetch.Create(obj.GetType().GetTypeInfo(), propertyName);
Aspire.StackExchange.Redis.OutputCaching.Tests (1)
AspireRedisOutputCacheExtensionsTests.cs (1)
24Assert.StartsWith("Redis", cacheStore.GetType().Name);
Aspire.StackExchange.Redis.Tests (1)
AspireRedisExtensionsTests.cs (1)
231Assert.StartsWith("Redis", cacheStore.GetType().Name);
BasicTestApp (3)
FormsTest\CustomFieldCssClassProvider.cs (1)
18var propertyInfo = fieldIdentifier.Model.GetType().GetProperty(fieldIdentifier.FieldName);
InteropTest\JavaScriptInterop.cs (2)
463ThisTypeName = GetType().Name, 479ThisTypeName = GetType().Name,
BuildActionTelemetryTable (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
CodeStyleConfigFileGenerator (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Contract.Data.IntegrationTests (3)
DataContractTests.4.1.1.cs (3)
33x => x.GetType() == typeof(DataContractSerializerOperationBehavior)) as DataContractSerializerOperationBehavior; 42Assert.True(manager.GetType() == (typeof(Manager)), string.Format("Expected type: {0}, Actual type: {1}", typeof(Manager), manager.GetType()));
Contract.Fault.IntegrationTests (4)
FaultExceptionTests.4.0.0.cs (4)
253Assert.True(response[0].GetType() == typeof(FaultDetail), String.Format("Expected response item to be FaultDetail but actual was {0}", response[0].GetType())); 255Assert.True(response[1].GetType() == typeof(KnownTypeA), String.Format("Expected response item to be FaultDetail2 but actual was {0}", response[1].GetType()));
DesignSurfaceExt (2)
DesignSurfaceExt.cs (1)
114Type hostType = host.RootComponent.GetType();
NameCreationServiceImp.cs (1)
31if (cc[i] is Component comp && comp.GetType() == type)
dotnet-svcutil-lib (494)
CodeDomFixup\CodeDomVisitors\CodeTypeNameScope.cs (1)
25throw new ObjectDisposedException(GetType().Name);
CodeDomFixup\CodeDomVisitors\PropertyFieldNameScope.cs (1)
30throw new ObjectDisposedException(GetType().Name);
CodeDomFixup\EndpointSelector.cs (10)
45s_bindingValidationErrors.Add(string.Format(SR.BindingTypeNotSupportedFormat, binding.GetType().FullName, 129s_bindingValidationErrors.Add(string.Format(SR.BindingTransportTypeNotSupportedFormat, bindingElement.GetType().FullName, 137s_bindingValidationErrors.Add(string.Format(SR.BindingMessageEncodingElementNotSupportedFormat, bindingElement.GetType().FullName, 218s_bindingValidationErrors.Add(string.Format(SR.BindingElementTypeNotSupportedFormat, bindingElement.GetType().FullName)); 250endorsingTokenParams.BootstrapSecurityBindingElement.GetType().FullName, typeof(TransportSecurityBindingElement).FullName)); 267transportSecurityBindingElement.DefaultAlgorithmSuite.GetType().FullName, SecurityAlgorithmSuite.Default.GetType().FullName)); 297transportSecurityBindingElement.DefaultAlgorithmSuite.GetType().FullName, SecurityAlgorithmSuite.Default.GetType().FullName)); 322transportSecurityBindingElement.EndpointSupportingTokenParameters.SignedEncrypted[0].GetType().FullName, typeof(UserNameSecurityTokenParameters).FullName));
CodeDomFixup\MethodCreationHelper.cs (3)
211throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.ErrBindingTypeNotSupportedFormat, binding.GetType().FullName)); 1084throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.ErrBindingElementNotSupportedFormat, bindingElement.GetType().FullName)); 2142createIdentityExpression = new CodeObjectCreateExpression(identity.GetType(), new CodePrimitiveExpression(identity.IdentityClaim.Resource));
CommandLineParser.cs (1)
71return string.Format(CultureInfo.InvariantCulture, "{0} {{{1}, {2}, Type={3}}}", this.GetType().Name, Name, Abbreviation, SwitchType);
FrameworkFork\Microsoft.CodeDom\Compiler\CodeGenerator.cs (3)
824throw new ArgumentException(string.Format(SRCodeDom.InvalidElementType, e.GetType().FullName), "e"); 1143throw new ArgumentException(string.Format(SRCodeDom.InvalidElementType, e.GetType().FullName), "e"); 1803throw new ArgumentException(string.Format(SRCodeDom.InvalidPrimitiveType, e.Value.GetType().ToString()));
FrameworkFork\Microsoft.CodeDom\Compiler\CodeValidator.cs (7)
62throw new ArgumentException(string.Format(SRCodeDom.InvalidElementType, e.GetType().FullName), "e"); 99throw new ArgumentException(string.Format(SRCodeDom.InvalidElementType, e.GetType().FullName), "e"); 500throw new ArgumentException(string.Format(SRCodeDom.InvalidElementType, e.GetType().FullName), "e"); 709String message = string.Format(SRCodeDom.InvalidTypeName, typeName, propertyName, e.GetType().FullName); 718String message = string.Format(SRCodeDom.InvalidLanguageIdentifier, identifier, propertyName, e.GetType().FullName); 833throw new ArgumentException(string.Format(SRCodeDom.InvalidElementType, e.GetType().FullName), "e"); 1019throw new ArgumentException(string.Format(SRCodeDom.InvalidElementType, e.GetType().FullName), "e");
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (3)
1219throw new ArgumentException(string.Format(SRCodeDom.InvalidElementType, e.GetType().FullName), "e"); 1405throw new ArgumentException(string.Format(SRCodeDom.InvalidPrimitiveType, e.Value.GetType().ToString())); 1969throw new ArgumentException(string.Format(SRCodeDom.InvalidElementType, e.GetType().FullName), "e");
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReaderSettings.cs (1)
552throw new XmlException(ResXml.Xml_ReadOnlyProperty, this.GetType().Name + '.' + propertyName);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWriterSettings.cs (1)
679throw new XmlException(ResXml.Xml_ReadOnlyProperty, this.GetType().Name + '.' + propertyName);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlElement.cs (2)
428if (GetType() == typeof(XmlElement)) 459if (e != null && e.GetType() == typeof(XmlElement))
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlLoader.cs (1)
31if (reader.GetType() == typeof(Microsoft.Xml.XmlTextReader))
FrameworkFork\Microsoft.Xml\Xml\schema\DatatypeImplementation.cs (4)
433Type derivedType = this.GetType(); 434Type baseType = datatype.GetType(); 597if (value.GetType() != this.ValueType) 1162Debug.Assert(array.GetType() == ListValueType);
FrameworkFork\Microsoft.Xml\Xml\schema\Inference\infer.cs (3)
990if (((XmlSchemaSequence)ct.Particle).Items[lastUsedSeqItem].GetType() != typeof(XmlSchemaElement)) 1062if (ct.Particle.GetType() == typeof(XmlSchemaSequence)) 1077if (xss.Items[0].GetType() == typeof(XmlSchemaChoice))
FrameworkFork\Microsoft.Xml\Xml\schema\Preprocessor.cs (1)
370Type returnType = obj.GetType();
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaDatatype.cs (1)
274Type t = value.GetType();
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (51)
332_clrTypeDefault = Array.CreateInstance(converterAtomic.DefaultClrType, 0).GetType(); 600throw CreateInvalidClrMappingException(value.GetType(), destinationType); 1022Type sourceType = value.GetType(); 1068Type sourceType = value.GetType(); 1107Type sourceType = value.GetType(); 1153Type sourceType = value.GetType(); 1235Type sourceType = value.GetType(); 1281Type sourceType = value.GetType(); 1363Type sourceType = value.GetType(); 1411Type sourceType = value.GetType(); 1446Type sourceType = value.GetType(); 1509Type sourceType = value.GetType(); 1589Type sourceType = value.GetType(); 1634Type sourceType = value.GetType(); 1723Type sourceType = value.GetType(); 1786Type sourceType = value.GetType(); 1843Type sourceType = value.GetType(); 1913Type sourceType = value.GetType(); 1959Type sourceType = value.GetType(); 2058Type sourceType = value.GetType(); 2139Type sourceType = value.GetType(); 2255Type sourceType = value.GetType(); 2346Type sourceType = value.GetType(); 2377Type sourceType = value.GetType(); 2430Type sourceType = value.GetType(); 2452Type sourceType = value.GetType(); 2474Type sourceType = value.GetType(); 2495Type sourceType = value.GetType(); 2517Type sourceType = value.GetType(); 2539Type sourceType = value.GetType(); 2561Type sourceType = value.GetType(); 2583Type sourceType = value.GetType(); 2637Type sourceType = value.GetType(); 2784Type sourceType = value.GetType(); 2884Type sourceType = value.GetType(); 2906Type sourceType = value.GetType(); 3024Type sourceType = value.GetType(); 3060Type sourceType = value.GetType(); 3076Type sourceType = value.GetType(); 3091Type sourceType = value.GetType(); 3107Type sourceType = value.GetType(); 3123Type sourceType = value.GetType(); 3139Type sourceType = value.GetType(); 3155Type sourceType = value.GetType(); 3171Type sourceType = value.GetType(); 3286Type sourceType = value.GetType(); 3366Type sourceType = value.GetType(); 3412if (!(value is IEnumerable) || value.GetType() == StringType || value.GetType() == ByteArrayType) 3477Type sourceType = value.GetType(); 3709Type sourceType = value.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\Advanced\SchemaImporterExtension.cs (5)
68return Add(extension.GetType().FullName, extension); 119if (Names[name].GetType() != extension.GetType()) 203string comment = string.Format(ResXml.XmlExtensionComment, _extension.GetType().FullName); 209throw new InvalidOperationException(string.Format(ResXml.XmlExtensionDuplicateDefinition, _extension.GetType().FullName, _clrType));
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (2)
174return var.GetType(); 1123Type valueType = o.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\Compilation.cs (2)
185_methods[mapping.Key].readMethod = GetMethodFromType(reader.GetType(), methodName, _pregeneratedAssmbly ? _assembly : null); 219_methods[mapping.Key].writeMethod = GetMethodFromType(writer.GetType(), methodName, _pregeneratedAssmbly ? _assembly : null);
FrameworkFork\Microsoft.Xml\Xml\Serialization\ImportContext.cs (5)
152string key = item.GetType().Name + ":" + qname.ToString(); 172Warnings.Add(string.Format(ResXml.XmlMismatchSchemaObjects, item.GetType().Name, qname.Name, qname.Namespace)); 185if (o1.GetType() != o2.GetType()) 335Type t = item.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\SchemaObjectWriter.cs (9)
36return String.Compare(f1.GetType().Name + ":" + f1.Value, f2.GetType().Name + ":" + f2.Value, StringComparison.Ordinal); 337System.Type t = o.GetType(); 972System.Type t = o.GetType(); 1034System.Type t = o.GetType(); 1057System.Type t = o.GetType(); 1089System.Type t = o.GetType(); 1115System.Type t = o.GetType(); 1137System.Type t = o.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapReflectionImporter.cs (5)
775if (fieldTypeDesc != _typeScope.GetTypeDesc(a.SoapDefaultValue.GetType())) 776throw new InvalidOperationException(string.Format(ResXml.XmlInvalidDefaultEnumValue, a.SoapDefaultValue.GetType().FullName, fieldTypeDesc.FullName)); 777string strValue = Enum.Format(a.SoapDefaultValue.GetType(), a.SoapDefaultValue, "G").Replace(",", " "); 778string numValue = Enum.Format(a.SoapDefaultValue.GetType(), a.SoapDefaultValue, "D"); 780throw new InvalidOperationException(string.Format(ResXml.XmlInvalidDefaultValue, strValue, a.SoapDefaultValue.GetType().FullName));
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapSchemaExporter.cs (1)
389throw new InvalidOperationException(string.Format(ResXml.XmlInvalidContent, type.ContentModel.Content.GetType().Name));
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapSchemaImporter.cs (1)
638throw new InvalidOperationException(string.Format(ResXml.XmlInvalidEnumContent, dataType.Content.GetType().Name, identifier));
FrameworkFork\Microsoft.Xml\Xml\Serialization\TypeExtensions.cs (1)
29Type sourceType = data.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlAttributes.cs (1)
106if (attrib is XmlIgnoreAttribute || attrib is ObsoleteAttribute || attrib.GetType() == IgnoreAttribute)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCodeExporter.cs (6)
218Type type = value.GetType(); 225if (value.GetType() != typeof(string)) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorDetails, "Invalid enumeration type " + value.GetType().Name)); 462AddWarningComment(comments, string.Format(ResXml.XmlNotKnownDefaultValue, extension.GetType().FullName, attributeName, (string)defaultValue, mapping.TypeName, mapping.Namespace)); 505if (value.GetType() != typeof(object[])) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorDetails, "Default value for list should be object[], not " + value.GetType().Name));
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCustomFormatter.cs (1)
24Type type = value.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (2)
2148throw new InvalidOperationException(string.Format(ResXml.XmlInvalidDefaultValue, strValue, a.XmlDefaultValue.GetType().FullName)); 2187throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorDetails, "Bad accessor type " + accessor.GetType().FullName));
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaExporter.cs (4)
720throw new InvalidOperationException(string.Format(ResXml.XmlInvalidContent, type.ContentModel.Content.GetType().Name)); 919if (value.GetType() != typeof(string)) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorDetails, string.Format(ResXml.XmlInvalidDefaultValue, value.ToString(), value.GetType().FullName))); 1117throw new InvalidOperationException(string.Format(ResXml.XmlInvalidContent, type.ContentModel.Content.GetType().Name));
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaImporter.cs (5)
409if (!(desiredMappingType.IsAssignableFrom(mapping.GetType()))) 410throw new InvalidOperationException(string.Format(ResXml.XmlElementImportedTwice, element.Name, ns, mapping.GetType().Name, desiredMappingType.Name)); 453throw new InvalidOperationException(string.Format(ResXml.XmlImporterExtensionBadLocalTypeName, typeOwner.GetType().FullName, typeName)); 457throw new InvalidOperationException(string.Format(ResXml.XmlImporterExtensionBadTypeName, typeOwner.GetType().FullName, qname.Name, qname.Namespace, typeName)); 533if (mapping != null && desiredMappingType.IsAssignableFrom(mapping.GetType()))
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemas.cs (8)
337if (ret == null || !type.IsAssignableFrom(ret.GetType())) 500throw new InvalidOperationException(string.Format(ResXml.XmlSchemaIncludeLocation, this.GetType().Name, external.SchemaLocation)); 639item = string.Format(ResXml.XmlSchemaNamedItem, ns, o.GetType() == typeof(XmlSchemaSimpleType) ? "simpleType" : "complexType", ((XmlSchemaType)o).Name, null); 667string itemType = o is XmlSchemaImport ? "import" : o is XmlSchemaInclude ? "include" : o is XmlSchemaRedefine ? "redefine" : o.GetType().Name; 676item = string.Format(ResXml.XmlSchemaNamedItem, ns, o.GetType().Name, null, details); 687XmlSerializer s = new XmlSerializer(o.GetType()); 709Type type = o.GetType(); 715if (item.GetType() == type && name == ItemName(item))
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationReader.cs (4)
1416return new InvalidCastException(string.Format(ResXml.XmlInvalidCast, value.GetType().FullName, type.FullName)); 1418return new InvalidCastException(string.Format(ResXml.XmlInvalidCastWithId, value.GetType().FullName, type.FullName, id)); 1649throw new InvalidOperationException(string.Format(ResXml.XmlInvalidArrayRef, id, o.GetType().FullName, i.ToString())); 1827Type currItemType = currItem.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (11)
254Type t = o.GetType(); 468if (_objectsInUse.ContainsKey(o)) throw new InvalidOperationException(string.Format(ResXml.XmlCircularReference, o.GetType().FullName)); 642if (!_objectsInUse.ContainsKey(o)) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorDetails, "missing stack object of type " + o.GetType().FullName)); 778if (typeof(XmlAttribute).IsAssignableFrom(node.GetType())) 810return CreateUnknownTypeException(o.GetType()); 857return CreateInvalidAnyTypeException(o.GetType()); 1371Type t = o.GetType(); 1421Type t = o.GetType(); 1727if (defaultValue.GetType() != typeof(string)) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorDetails, name + " has invalid default type " + defaultValue.GetType().Name)); 3524Type type = value.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (4)
204if (defaultValue.GetType() != typeof(string)) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorDetails, name + " has invalid default type " + defaultValue.GetType().Name)); 2254else if (value.GetType().GetTypeInfo().IsPrimitive) 2262Type valueType = value.GetType();
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\baseaxisquery.cs (2)
121if (qyInput.GetType() != typeof(ContextQuery)) 142w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\BooleanExpr.cs (1)
64w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\BooleanFunctions.cs (1)
93w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CacheChildrenQuery.cs (1)
101if (currentNode.GetType().ToString() == "Microsoft.VisualStudio.Modeling.StoreNavigator")
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CacheOutputQuery.cs (1)
81w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\DescendantBaseQuery.cs (1)
62w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\FilterQuery.cs (1)
187w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\FunctionQuery.cs (1)
128w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\LogicalExpr.cs (1)
439w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\MergeFilterQuery.cs (1)
78w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\NodeFunctions.cs (1)
114w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\NumberFunctions.cs (1)
124w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\NumericExpr.cs (1)
80w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\OperandQuery.cs (1)
32w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\Query.cs (5)
187if (nav.GetType().ToString() == "Microsoft.VisualStudio.Modeling.StoreNavigator") return; 188if (nav.GetType().ToString() == "Microsoft.Xml.DataDocumentXPathNavigator") return; 215if (curr.GetType().ToString() == "Microsoft.VisualStudio.Modeling.StoreNavigator") return; 216if (curr.GetType().ToString() == "Microsoft.Xml.DataDocumentXPathNavigator") return; 261w.WriteElementString(this.GetType().Name, string.Empty);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\SortQuery.cs (1)
118w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\StringFunctions.cs (1)
276w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\UnionExpr.cs (1)
167w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\VariableQuery.cs (1)
75w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathAncestorQuery.cs (1)
70w.WriteStartElement(this.GetType().Name);
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathNavigator.cs (1)
1027if (n1.GetType().ToString() != "Microsoft.VisualStudio.Modeling.StoreNavigator")
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (2)
532throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 541throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (1)
286throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(dataContract.GetType()), DataContract.GetClrTypeFullName(dataContract.UnderlyingType))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (4)
279return var.GetType(); 833throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.CanOnlyStoreIntoArgOrLocGot0, DataContract.GetClrTypeFullName(var.GetType())))); 971Type valueType = o.GetType(); 980EmitSourceComment("Ldc " + o.GetType() + "." + o);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (2)
309throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 314throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSerializer.cs (3)
312Type graphType = (graph == null) ? declaredType : graph.GetType(); 453return (graph == null) ? _rootType : graph.GetType(); 466objType = obj != null ? obj.GetType() : Globals.TypeOfObject;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (2)
362Type type = value.GetType(); 507Type type = obj.GetType();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SerializationExtensionMethods.cs (1)
26if (a.GetType().FullName == attributeType.FullName)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializer.cs (1)
390return (graph == null) ? null : graph.GetType();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (2)
423throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.FactoryObjectContainsSelfReference, DataContract.GetClrTypeFullName(oldObj.GetType()), DataContract.GetClrTypeFullName(newObj.GetType()), id)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (8)
118SerializeWithXsiType(xmlWriter, obj, obj.GetType().TypeHandle, null/*type*/, -1, declaredType.TypeHandle, declaredType); 127RuntimeTypeHandle objTypeHandle = obj.GetType().TypeHandle; 422throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.CannotSerializeObjectWithCycles, DataContract.GetClrTypeFullName(obj.GetType())))); 501return obj.GetType().TypeHandle.Equals(memberType.TypeHandle); 571throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.UnknownXmlType, DataContract.GetClrTypeFullName(obj.GetType())))); 602throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ResolveTypeReturnedFalse, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)))); 612throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)))); 617throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (1)
253RuntimeTypeHandle objTypeHandle = isDeclaredType ? declaredTypeHandle : obj.GetType().TypeHandle;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlSerializableWriter.cs (3)
27throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.IXmlSerializableMissingEndElements, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType()))))); 56throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.IXmlSerializableWritePastSubTree, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType()))))); 64throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.IXmlSerializableWritePastSubTree, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType())))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (1)
294WriteAnyType(value, value.GetType());
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseWriter.cs (1)
1208else if (value.GetType().IsArray)
FrameworkFork\System.ServiceModel\Extensions\ReflectionExtensions.cs (1)
72return o == null ? false : type.GetTypeInfo().IsAssignableFrom(o.GetType().GetTypeInfo());
FrameworkFork\System.ServiceModel\Internals\System\Runtime\AsyncResult.cs (2)
116throw Fx.Exception.AsError(new InvalidOperationException(InternalSR.AsyncResultCompletedTwice(GetType()))); 326throw Fx.Exception.AsError(new InvalidOperationException(InternalSR.InvalidAsyncResultImplementation(result.GetType())));
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Diagnostics\DiagnosticTraceBase.cs (1)
161return String.Format(CultureInfo.CurrentCulture, "{0}/{1}", source.GetType().ToString(), source.GetHashCode());
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (1)
283(SynchronizationContext.Current.GetType() == typeof(SynchronizationContext)));
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\X509CertificateClaimSet.cs (2)
352throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().FullName)); 583throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().FullName));
FrameworkFork\System.ServiceModel\System\IdentityModel\Policy\UnconditionalPolicy.cs (1)
206throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().FullName));
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\SecurityTokenAuthenticator.cs (5)
35throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenValidationException(string.Format(SRServiceModel.CannotValidateSecurityTokenType, this, token.GetType()))); 44tokenType = tokenType ?? token.GetType().ToString(); 51string errorMsg = string.Format(SRServiceModel.CannotValidateSecurityTokenType, this, token.GetType()); 55tokenType = tokenType ?? token.GetType().ToString(); 65tokenType = tokenType ?? token.GetType().ToString();
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\SecurityTokenRequirement.cs (2)
164if (dictionaryValue != null && !typeof(TValue).IsAssignableFrom(dictionaryValue.GetType())) 166throw Fx.Exception.Argument(propertyName, string.Format(SRServiceModel.SecurityTokenRequirementHasInvalidTypeForProperty, propertyName, dictionaryValue.GetType(), typeof(TValue)));
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\SecurityTokenResolver.cs (1)
89throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException(string.Format(SRServiceModel.ID0023, this.GetType().AssemblyQualifiedName)));
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\KeyInfoSerializer.cs (1)
318throw /*System.ServiceModel.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(SRServiceModel.StandardsManagerCannotWriteObject, keyIdentifierClause.GetType())));
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\SecurityToken.cs (3)
25return new LocalIdKeyIdentifierClause(this.Id, this.GetType()) as T; 28string.Format(SRServiceModel.TokenDoesNotSupportKeyIdentifierClauseCreation, GetType().Name, typeof(T).Name))); 35return localKeyIdentifierClause.Matches(this.Id, this.GetType());
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\X509SecurityToken.cs (1)
128throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().FullName));
FrameworkFork\System.ServiceModel\System\ServiceModel\BasicHttpMessageSecurity.cs (2)
142return _algorithmSuite.GetType() != SecurityAlgorithmSuite.Default.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\ChannelFactory.cs (1)
601Type implementationType = implementation.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressHeader.cs (1)
65return (value == null) ? typeof(object) : value.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BinaryMessageEncoder.cs (2)
173WcfEventSource.Instance.WritePoolMiss(messageWriter.GetType().Name); 212WcfEventSource.Instance.ReadPoolMiss(messageData.GetType().Name);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BinaryMessageEncodingBindingElement.cs (2)
89string errorMsg = string.Format(SRServiceModel.UnsupportedEnvelopeVersion, this.GetType().FullName, BinaryEncoderDefaults.EnvelopeVersion, value.Envelope); 176this.GetType().Name,
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Binding.cs (3)
69_name = this.GetType().Name; 245string.Format(SRServiceModel.TransportBindingElementMustBeLast, this.Name, transport.GetType().Name))); 250string.Format(SRServiceModel.InvalidBindingScheme, transport.GetType().Name)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BindingContext.cs (1)
131string typeString = bindingElement.GetType().ToString();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BindingElementCollection.cs (1)
68if (bindingElementType.GetTypeInfo().IsAssignableFrom(this[i].GetType().GetTypeInfo()))
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelBindingMessageProperty.cs (1)
132throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().FullName));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelFactoryBase.cs (1)
154throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(SRServiceModel.ChannelFactoryCannotBeUsedToCreateChannels, this.GetType().ToString())));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelParameterCollection.cs (4)
89channel.GetType().ToString(), state.ToString()); 94channel.GetType().ToString(), state.ToString()); 117channel.GetType().ToString(), state.ToString()); 129channel.GetType().ToString(), state.ToString());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (5)
196WcfEventSource.Instance.WebSocketCreateClientWebSocketWithFactory(EventTraceActivity, _connectionFactory.GetType().FullName); 224throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(SRServiceModel.ClientWebSocketFactory_CreateWebSocketFailed, _connectionFactory.GetType().Name), e)); 230throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(SRServiceModel.ClientWebSocketFactory_InvalidWebSocket, _connectionFactory.GetType().Name))); 236throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(SRServiceModel.ClientWebSocketFactory_InvalidWebSocket, _connectionFactory.GetType().Name))); 244throw FxTrace.Exception.AsError(new InvalidOperationException(string.Format(SRServiceModel.ClientWebSocketFactory_InvalidSubProtocol, _connectionFactory.GetType().Name, obtained, requested)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CommunicationObject.cs (1)
582return this.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CommunicationObjectManager.cs (1)
41throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().ToString()));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FaultConverter.cs (4)
36string text = string.Format(SRServiceModel.FaultConverterDidNotCreateException, this.GetType().Name); 45string text = string.Format(SRServiceModel.FaultConverterCreatedException, this.GetType().Name); 62string text = string.Format(SRServiceModel.FaultConverterDidNotCreateFaultMessage, this.GetType().Name); 71string text = string.Format(SRServiceModel.FaultConverterCreatedFaultMessage, this.GetType().Name);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (1)
183throw FxTrace.Exception.Argument("handlers", string.Format(SRServiceModel.DelegatingHandlerArrayHasNonNullInnerHandler, s_delegatingHandlerType.Name, "InnerHandler", handler.GetType().Name));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageExtensionMethods.cs (1)
42httpHeaders.GetType().Name)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\LifetimeManager.cs (4)
65throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().ToString())); 203throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().ToString())); 232throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().ToString())); 356this.Complete(false, new ObjectDisposedException(this.GetType().ToString()));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Message.cs (1)
110return (value == null) ? typeof(object) : value.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncodingBindingElementImporter.cs (1)
39Type elementType = messageEncodingBindingElement.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageFault.cs (1)
31(detail == null ? typeof(object) : detail.GetType()), int.MaxValue/*maxItems*/), "", "");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageHeader.cs (2)
429(_objectToSerialize == null ? typeof(object) : _objectToSerialize.GetType()), this.Name, this.Namespace, int.MaxValue/*maxItems*/); 444throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(string.Format(SRServiceModel.MessageHeaderVersionNotSupported, this.GetType().FullName, messageVersion.ToString()), "version"));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageHeaders.cs (1)
1212header.GetType().FullName, _version.Envelope.ToString()), "header"));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageProperties.cs (1)
53throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(string.Empty, string.Format(SRServiceModel.ObjectDisposed, this.GetType().ToString())));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ReliableSessionBindingElement.cs (1)
310transportTransferMode, this.GetType().Name)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\RequestContextBase.cs (1)
197throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().FullName));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SecurityBindingElement.cs (1)
1414sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "{0}:", this.GetType().ToString()));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannel.cs (2)
1104string text = string.Format(SRServiceModel.SFxInitializationUINotCalled, example.GetType().ToString()); 1123string text = string.Format(SRServiceModel.SFxInitializationUIDisallowed, example.GetType().ToString());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (2)
70else if (declaringType.IsAssignableFrom(_serviceChannel.GetType())) 328activityName = string.Format(SRServiceModel.ActivityClose, _serviceChannel.GetType().FullName);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (2)
156this.GetType().ToString(), SRServiceModel.SocketConnectionDisposed), TransferOperation.Undefined)); 166this.GetType().ToString(), SRServiceModel.SocketConnectionDisposed), TransferOperation.Undefined));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SslStreamSecurityUpgradeProvider.cs (5)
170throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("upgradeInitiator", string.Format(SRServiceModel.UnsupportedUpgradeInitiator, upgradeInitiator.GetType())); 175throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("kind", string.Format(SRServiceModel.StreamUpgradeUnsupportedChannelBindingKind, this.GetType(), kind)); 192throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("upgradeAcceptor", string.Format(SRServiceModel.UnsupportedUpgradeAcceptor, upgradeAcceptor.GetType())); 197throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("kind", string.Format(SRServiceModel.StreamUpgradeUnsupportedChannelBindingKind, this.GetType(), kind)); 264SRServiceModel.InvalidTokenProvided, _serverTokenProvider.GetType(), typeof(X509SecurityToken))));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TextMessageEncoder.cs (2)
604WcfEventSource.Instance.WritePoolMiss(messageWriter.GetType().Name); 644WcfEventSource.Instance.ReadPoolMiss(messageData.GetType().Name);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportSecurityHelpers.cs (1)
234SRServiceModel.InvalidTokenProvided, tokenProvider.GetType(), typeof(T))));
FrameworkFork\System.ServiceModel\System\ServiceModel\ClientBase.cs (2)
338if (typeof(CompletedAsyncResult).IsAssignableFrom(result.GetType())) 362if (typeof(CompletedAsyncResult).IsAssignableFrom(result.GetType()))
FrameworkFork\System.ServiceModel\System\ServiceModel\Configuration\SecurityElementBase.cs (4)
47if (p1.GetType() != p2.GetType()) 111if (b1.GetType() != b2.GetType())
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ClientCredentials.cs (3)
129if (result == null || result.GetType() != GetType()) 131throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(NotImplemented.ByDesignWithMessage(string.Format(SRServiceModel.CloneNotImplementedCorrectly, GetType(), (result != null) ? result.ToString() : "null")));
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ContractDescription.cs (1)
183Type serviceType = serviceImplementation.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExporter.cs (1)
146string errorMessage = string.Format(SRServiceModel.PolicyExtensionExportError, exporter.GetType(), e.Message);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataImporter.cs (1)
141string errorMessage = string.Format(SRServiceModel.PolicyExtensionImportError, importer.GetType(), e.Message);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataSet.cs (3)
264System.Type t = o.GetType(); 319System.Type t = o.GetType(); 401System.Type t = o.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\OperationGenerator.cs (2)
983Type attributeType = attribute.GetType(); 1023Type type = val.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceContractGenerator.cs (1)
499AssemblyName assemblyName = this.GetType().GetTypeInfo().Assembly.GetName();
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (2)
368return provider.GetType(); 465if (attrType.IsAssignableFrom(customAttribute.GetType()))
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (5)
472opBehaviorAttr.GetType().FullName))); 482opBehaviorAttr.GetType().FullName))); 493opBehaviorAttr.GetType().FullName))); 631Type t = behavior.GetType(); 2014if (!descriptionBehaviors.Contains(behavior.GetType()))
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlExporter.cs (2)
1203string errorMessage = string.Format(SRServiceModel.WsdlExtensionContractExportError, exporter.GetType(), contractIdentifier); 1221string errorMessage = string.Format(SRServiceModel.WsdlExtensionEndpointExportError, exporter.GetType(), endpointIdentifier);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (9)
638string.Format(SRServiceModel.SFxBadMetadataDialect, doc.Identifier, doc.Dialect, typeof(T).FullName, doc.GetType().FullName))); 816var xfeAttributes = ServiceReflector.GetCustomAttributes(extension.GetType(), typeof(WsdlConfigNS.XmlFormatExtensionAttribute), false); 826WsdlImportException wie = WsdlImportException.Create(item, new InvalidOperationException(string.Format(SRServiceModel.UnknownWSDLExtensionIgnored, extension.GetType().AssemblyQualifiedName))); 1752Fx.Assert("GetElementName Method should be updated to support " + item.GetType()); 1774Fx.Assert(rest != null, "GetXPathParameters Method should never set rest to null. this happened for: " + item.GetType()); 1850Fx.Assert("Unsupported WSDL OM: unknown WsdlNS.MessageBinding: " + item.GetType()); 1860Fx.Assert("GetXPathParameters Method should be updated to support " + item.GetType()); 1896string errorMessage = string.Format(SRServiceModel.WsdlExtensionBeforeImportError, importer.GetType().AssemblyQualifiedName, e.Message); 1909string errorMessage = string.Format(SRServiceModel.WsdlExtensionImportError, importer.GetType().FullName, e.Message);
FrameworkFork\System.ServiceModel\System\ServiceModel\Diagnostics\TraceUtility.cs (1)
261return source.GetType().ToString() + "/" + source.GetHashCode().ToString(CultureInfo.CurrentCulture);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DispatchOperationRuntime.cs (3)
180WcfEventSource.Instance.ParameterInspectorBeforeCallInvoked(rpc.EventTraceActivity, this.ParameterInspectors[i].GetType().FullName); 201WcfEventSource.Instance.ParameterInspectorAfterCallInvoked(rpc.EventTraceActivity, this.ParameterInspectors[i].GetType().FullName); 300string message = string.Format(SRServiceModel.SFxNullReplyFromFormatter2, this.Formatter.GetType().ToString(), (_name ?? ""));
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ErrorBehavior.cs (2)
123WcfEventSource.Instance.FaultProviderInvoked(_handlers[i].GetType().FullName, e.Message); 194WcfEventSource.Instance.ErrorHandlerInvoked(_handlers[i].GetType().FullName, handledByThis, error.GetType().FullName);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\FaultFormatter.cs (1)
152isDetailObjectValid = detailType.IsAssignableFrom(detailObj.GetType());
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ImmutableClientRuntime.cs (2)
97WcfEventSource.Instance.ClientMessageInspectorAfterReceiveInvoked(rpc.EventTraceActivity, _messageInspectors[i].GetType().FullName); 126WcfEventSource.Instance.ClientMessageInspectorBeforeSendInvoked(rpc.EventTraceActivity, _messageInspectors[i].GetType().FullName);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ProxyOperationRuntime.cs (2)
180WcfEventSource.Instance.ClientParameterInspectorAfterCallInvoked(rpc.EventTraceActivity, _parameterInspectors[i].GetType().FullName); 218WcfEventSource.Instance.ClientParameterInspectorBeforeCallInvoked(rpc.EventTraceActivity, _parameterInspectors[i].GetType().FullName);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ThreadBehavior.cs (1)
121string text = string.Format(SRServiceModel.SFxMultipleCallbackFromSynchronizationContext, _context.GetType().ToString());
FrameworkFork\System.ServiceModel\System\ServiceModel\DuplexChannelFactory.cs (1)
233Type userObjectType = callbackInstance.UserObject.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointIdentity.cs (1)
182throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(SRServiceModel.UnrecognizedIdentityPropertyType, this.IdentityClaim.GetType().ToString())));
FrameworkFork\System.ServiceModel\System\ServiceModel\KeyedByTypeCollection.cs (3)
95return item.GetType(); 105if (this.Contains(item.GetType())) 107throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("item", string.Format(SRServiceModel.DuplicateBehavior1, item.GetType().FullName));
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\ChannelProtectionRequirements.cs (1)
269if (!(message.Body.ReturnValue.GetType().Equals(typeof(MessagePartDescription))))
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\DataProtectionSecurityStateEncoder.cs (1)
61result.Append(this.GetType().ToString());
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\IdentityVerifier.cs (4)
73SecurityTraceRecordHelper.TraceIdentityVerificationFailure(identity, authorizationContext, this.GetType()); 227SecurityTraceRecordHelper.TraceIdentityVerificationSuccess(eventTraceActivity, identity, identity.IdentityClaim, this.GetType()); 239SecurityTraceRecordHelper.TraceIdentityVerificationSuccess(eventTraceActivity, identity, claim, this.GetType()); 274SecurityTraceRecordHelper.TraceIdentityVerificationFailure(identity, authContext, this.GetType());
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityHeader.cs (1)
161return string.Format(CultureInfo.InvariantCulture, "{0}(Actor = '{1}')", GetType().Name, this.Actor);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityMessageProperty.cs (1)
315throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().FullName));
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityProtocolFactory.cs (4)
740Type authenticatorType = spec.TokenAuthenticator.GetType(); 744Type spec2AuthenticatorType = spec2.TokenAuthenticator.GetType(); 749throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(string.Format(SRServiceModel.MultipleSupportingAuthenticatorsOfSameType, spec.TokenParameters.GetType()))); 756throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(string.Format(SRServiceModel.MultipleSupportingAuthenticatorsOfSameType, spec.TokenParameters.GetType())));
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\Tokens\SecurityContextSecurityToken.cs (1)
324throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().FullName));
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\Tokens\SecurityTokenParameters.cs (2)
84throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(SRServiceModel.SecurityTokenParametersCloneInvalidResult, this.GetType().ToString()))); 95sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "{0}:", this.GetType().ToString()));
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\Tokens\ServiceModelSecurityTokenRequirement.cs (1)
229sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "{0}:", this.GetType().ToString()));
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\Tokens\SupportingTokenParameters.cs (2)
157if (parameters == null || parameters.GetType() != this.GetType())
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WrapperSecurityCommunicationObject.cs (1)
29return _innerCommunicationObject.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityTokenSerializer.cs (1)
252if (tokenEntry.SupportsCore(token.GetType()))
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceChannelManager.cs (3)
121throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().ToString())); 195throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().ToString())); 274throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ObjectDisposedException(this.GetType().ToString()));
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedCollection.cs (1)
311throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(string.Format(SRServiceModel.SynchronizedCollectionWrongType1, value.GetType().FullName)));
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedReadOnlyCollection.cs (1)
267Type type = (value == null) ? typeof(Object) : value.GetType();
FrameworkFork\System.Web.Services\Services\Description\ServiceDescription.cs (7)
1642if (type.IsAssignableFrom(item.GetType())) 1661if (type.IsAssignableFrom(item.GetType())) 2021if (Count > 1 || (Count == 1 && value.GetType() == List[0].GetType())) 2033if (oldValue.GetType() != newValue.GetType()) throw new InvalidOperationException(string.Format(ResWebServices.WebDescriptionTooManyMessages)); 3193throw new ArgumentException(GetDuplicateMessage(value.GetType(), key), e.InnerException);
FrameworkFork\System.Web.Services\Services\Description\ServiceDescriptionSerializer.cs (88)
30System.Type t = o.GetType(); 142System.Type t = o.GetType(); 212System.Type t = o.GetType(); 299System.Type t = o.GetType(); 327System.Type t = o.GetType(); 355System.Type t = o.GetType(); 383System.Type t = o.GetType(); 480System.Type t = o.GetType(); 578System.Type t = o.GetType(); 660System.Type t = o.GetType(); 709System.Type t = o.GetType(); 758System.Type t = o.GetType(); 864System.Type t = o.GetType(); 901System.Type t = o.GetType(); 979System.Type t = o.GetType(); 1016System.Type t = o.GetType(); 1065System.Type t = o.GetType(); 1093System.Type t = o.GetType(); 1122System.Type t = o.GetType(); 1162System.Type t = o.GetType(); 1202System.Type t = o.GetType(); 1244System.Type t = o.GetType(); 1285System.Type t = o.GetType(); 1327System.Type t = o.GetType(); 1368System.Type t = o.GetType(); 1482System.Type t = o.GetType(); 1509System.Type t = o.GetType(); 1536System.Type t = o.GetType(); 1580System.Type t = o.GetType(); 1608System.Type t = o.GetType(); 1656System.Type t = o.GetType(); 1688System.Type t = o.GetType(); 1716System.Type t = o.GetType(); 1748System.Type t = o.GetType(); 1818System.Type t = o.GetType(); 1919System.Type t = o.GetType(); 1980System.Type t = o.GetType(); 2041System.Type t = o.GetType(); 2102System.Type t = o.GetType(); 2172System.Type t = o.GetType(); 2234System.Type t = o.GetType(); 2303System.Type t = o.GetType(); 2439System.Type t = o.GetType(); 2502System.Type t = o.GetType(); 2563System.Type t = o.GetType(); 2623System.Type t = o.GetType(); 2682System.Type t = o.GetType(); 2760System.Type t = o.GetType(); 2817System.Type t = o.GetType(); 2933System.Type t = o.GetType(); 2982System.Type t = o.GetType(); 3023System.Type t = o.GetType(); 3072System.Type t = o.GetType(); 3122System.Type t = o.GetType(); 3185System.Type t = o.GetType(); 3224System.Type t = o.GetType(); 3330System.Type t = o.GetType(); 3372System.Type t = o.GetType(); 3414System.Type t = o.GetType(); 3456System.Type t = o.GetType(); 3498System.Type t = o.GetType(); 3540System.Type t = o.GetType(); 3582System.Type t = o.GetType(); 3624System.Type t = o.GetType(); 3666System.Type t = o.GetType(); 3708System.Type t = o.GetType(); 3750System.Type t = o.GetType(); 3792System.Type t = o.GetType(); 3834System.Type t = o.GetType(); 3928System.Type t = o.GetType(); 4052System.Type t = o.GetType(); 4094System.Type t = o.GetType(); 4170System.Type t = o.GetType(); 4208System.Type t = o.GetType(); 4248System.Type t = o.GetType(); 4297System.Type t = o.GetType(); 4375System.Type t = o.GetType(); 4430System.Type t = o.GetType(); 4521System.Type t = o.GetType(); 4612System.Type t = o.GetType(); 4666System.Type t = o.GetType(); 4800System.Type t = o.GetType(); 4866System.Type t = o.GetType(); 4906System.Type t = o.GetType(); 4972System.Type t = o.GetType(); 5010System.Type t = o.GetType(); 5049System.Type t = o.GetType(); 5125System.Type t = o.GetType();
FrameworkFork\System.Web.Services\Services\Description\WebReferenceOptions.cs (1)
231System.Type t = o.GetType();
ImportModule.cs (1)
368if (wsdlImportExtensions[i].GetType() == extensionType)
MarkupTelemetryHelper.cs (1)
86return binding.GetType() == typeof(T) ? name : $"{name}*";
Metadata\MetadataDocumentSaver.cs (1)
119string typeName = doc.Metadata.GetType().ToString();
Shared\Options\ListValue.cs (1)
56OptionValueParser.ThrowInvalidValueIf(value == null || value.GetType() != typeof(TValue), value, this.Owner);
Shared\Options\OptionBase.cs (1)
173serializer.Serialize(writer, value, value?.GetType());
Shared\Options\OptionValueParser.cs (5)
28if (value.GetType() != typeof(TValue)) 94var valueType = value.GetType(); 178var valueType = value.GetType(); 236if (enumValue == null || enumValue.GetType() != thisType) 259ThrowInvalidValueIf(value.GetType() != typeof(TValue), value, option);
dotnet-svcutil-lib.Tests (3)
UnitTest.cs (3)
268log += $"{Environment.NewLine}{cmdOptions.GetType().Name} as {updateOptions.GetType().Name}:{Environment.NewLine}{updateOptions.Json}"; 355errorMessage = $"{options.GetType().Name} did not pass serialization roundtrip!{Environment.NewLine} windiff {jsonFileSrcPath} {outJsonFile}";
FilesWebSite (3)
Controllers\EmbeddedFilesController.cs (3)
16FileProvider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "FilesWebSite.EmbeddedResources"), 26FileProvider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "FilesWebSite.EmbeddedResources"), 35FileProvider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "FilesWebSite.EmbeddedResources"),
GenerateDocumentationAndConfigFiles (2)
CodeFixerExtensions.cs (1)
74MethodInfo? method = fixer?.GetType().GetTypeInfo().GetMethod("RegisterCodeFixesAsync");
Program.cs (1)
289var analyzerType = analyzer.GetType();
GetDocument.Insider (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.5.25257.101\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
181var buildMethod = builder.GetType().GetMethod("Build"); 191var hostType = host.GetType();
IdeBenchmarks (1)
SQLitePersistentStorageBenchmark.cs (1)
71Console.WriteLine("Storage type: " + _storage.GetType());
Identity.DefaultUI.WebSite (1)
StartupBase.cs (1)
112throw new InvalidOperationException($"Unknown provider '{currentProvider.GetType().Name}'");
IIS.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
148Assert.Contains("gzip", response.Content.GetType().FullName, StringComparison.OrdinalIgnoreCase);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
50var configuration = this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>().Configuration;
IIS.LongTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
50var configuration = this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>().Configuration;
IIS.NewHandler.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
50var configuration = this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>().Configuration;
IIS.NewShim.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
50var configuration = this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>().Configuration;
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
50var configuration = this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>().Configuration;
IISExpress.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
148Assert.Contains("gzip", response.Content.GetType().FullName, StringComparison.OrdinalIgnoreCase);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (1)
50var configuration = this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>().Configuration;
illink (24)
ILLink.RoslynAnalyzer (8)
DataFlow\LocalDataFlowVisitor.cs (3)
104 $"{OwningSymbol.GetType ()}: {branchValueOperation.Syntax.GetLocation ().GetLineSpan ()}"); 112 $"{OwningSymbol.GetType ()}: {branchValueOperation.Syntax.GetLocation ().GetLineSpan ()}"); 205 $"{local.ContainingSymbol.GetType ()}: {localReference.Syntax.GetLocation ().GetLineSpan ()}");
DataFlow\UnexpectedOperationHandler.cs (1)
47 throw new NotImplementedException ($"Unexpected operation type {operation.GetType ()}: {operation.Syntax.GetLocation ().GetLineSpan ()}");
DataFlowAnalyzerContext.cs (1)
20 throw new System.ArgumentException ($"Analyzer {analyzer.GetType ().Name} is not in the cache");
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (1)
26 /// <see cref="object.GetType()"/>
src\tools\illink\src\ILLink.Shared\TrimAnalysis\ValueExtensions.cs (1)
22 sb.Append (value.GetType ().Name);
TrimAnalysis\ArrayValue.cs (1)
43 return HashUtils.Combine (GetType ().GetHashCode (), Size);
InMemory.FunctionalTests (5)
Http2\Http2ConnectionTests.cs (2)
257var contentTypeValue1 = (StringValues)headerReferences1.GetType().GetField("_ContentType").GetValue(headerReferences1); 275var contentTypeValue2 = (StringValues)headerReferences2.GetType().GetField("_ContentType").GetValue(headerReferences2);
Http3\Http3ConnectionTests.cs (2)
505var contentTypeValue1 = (StringValues)headerReferences1.GetType().GetField("_ContentType").GetValue(headerReferences1); 512var contentTypeValue2 = (StringValues)headerReferences1.GetType().GetField("_ContentType").GetValue(headerReferences2);
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
40return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\shared\WebSockets\TestStartup.cs (1)
19var type = startup.GetType();
LocalizationSample (1)
Startup.cs (1)
89await context.Response.WriteAsync($"<tr><th>Winning provider:</th><td>{requestCultureFeature.Provider.GetType().Name}</td></tr>");
Metrics (7)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
40throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (1)
68throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IUtf8StringOperationWrapper.cs (1)
39throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (1)
55var type = analyzerConfigOptions.GetType();
Metrics.Legacy (7)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
40throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (1)
68throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IUtf8StringOperationWrapper.cs (1)
39throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (1)
55var type = analyzerConfigOptions.GetType();
Microsoft.Analyzers.Extra (1)
Utilities\SyntaxNodeExtensions.cs (1)
120while (currentNode != null && !typesToStopTraversing.Contains(currentNode.GetType()));
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
445codeActionEquivalenceKey: fixer.GetType().FullName!,
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
446codeActionEquivalenceKey: fixer.GetType().FullName!,
Microsoft.Arcade.Common (2)
MSBuildTaskBase.cs (2)
70return GetType().GetMethod(ExecuteMethodName).GetParameters().Select(p => p.ParameterType).ToArray(); 90return GetType().GetMethod(ExecuteMethodName);
Microsoft.Arcade.Test.Common (2)
AssertEx.cs (2)
64if (x.GetType() != y.GetType())
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
37var project = DiagnosticProject.Create(GetType().Assembly, sources);
DiagnosticVerifier.cs (1)
165foreach (var defaultCompileLibrary in DependencyContext.Load(GetType().Assembly).CompileLibraries)
Microsoft.AspNetCore.Antiforgery (1)
Internal\DefaultAntiforgeryTokenGenerator.cs (1)
84authenticatedIdentity?.GetType() ?? typeof(ClaimsIdentity),
Microsoft.AspNetCore.App.Analyzers.Test (7)
Infrastructure\WellKnownTypesTests.cs (1)
63var project = TestDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, source.Source);
RouteEmbeddedLanguage\Infrastructure\ExportProviderExtensions.cs (2)
39var methodInfo = (from method in _exportProvider.GetType().GetTypeInfo().GetMethods() 49var methodInfo = (from method in _exportProvider.GetType().GetTypeInfo().GetMethods()
TestDiagnosticAnalyzer.cs (4)
31var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, sources); 48var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, sources); 70var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, sources); 109var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, sources);
Microsoft.AspNetCore.App.CodeFixes (1)
RouteParameterUnusedParameterFixer.cs (1)
94_ => throw new InvalidOperationException($"Unexpected method syntax: {methodSyntax.GetType().FullName}")
Microsoft.AspNetCore.Authentication (2)
AuthenticationHandler.cs (2)
119Logger = logger.CreateLogger(this.GetType().FullName!); 136Logger = logger.CreateLogger(this.GetType().FullName!);
Microsoft.AspNetCore.Authentication.Core (2)
AuthenticationService.cs (2)
262var mismatchError = $"The authentication handler registered for scheme '{scheme}' is '{handler.GetType().Name}' which cannot be used for SignInAsync. "; 301var mismatchError = $"The authentication handler registered for scheme '{scheme}' is '{handler.GetType().Name}' which cannot be used for {nameof(SignOutAsync)}. ";
Microsoft.AspNetCore.Authentication.OpenIdConnect (7)
OpenIdConnectHandler.cs (7)
219Logger.EnteringOpenIdAuthenticationHandlerHandleSignOutAsync(GetType().FullName!); 382Logger.EnteringOpenIdAuthenticationHandlerHandleUnauthorizedAsync(GetType().FullName!); 631Logger.EnteringOpenIdAuthenticationHandlerHandleRemoteAuthenticateAsync(GetType().FullName!); 1408Logger.InvalidSecurityTokenType(validatedToken?.GetType().ToString()); 1409throw new SecurityTokenException(string.Format(CultureInfo.InvariantCulture, Resources.ValidatedSecurityTokenNotJwt, validatedToken?.GetType())); 1469Logger.InvalidSecurityTokenTypeFromHandler(validatedToken?.GetType()); 1470throw new SecurityTokenException(string.Format(CultureInfo.InvariantCulture, Resources.ValidatedSecurityTokenNotJsonWebToken, validatedToken?.GetType()));
Microsoft.AspNetCore.Authorization (1)
DefaultAuthorizationPolicyProvider.cs (1)
77public virtual bool AllowsCachingPolicies => GetType() == typeof(DefaultAuthorizationPolicyProvider);
Microsoft.AspNetCore.Components (34)
CascadingParameterState.cs (1)
29var componentType = componentState.Component.GetType();
CascadingValue.cs (1)
105throw new ArgumentException($"Missing required parameter '{nameof(Value)}' for component '{GetType().Name}'.");
CascadingValueSource.cs (1)
89throw new InvalidOperationException($"Cannot notify about changes because the {GetType()} is configured as fixed.");
ChangeDetection.cs (2)
31var oldValueType = oldValue!.GetType(); 32var newValueType = newValue!.GetType();
ComponentFactory.cs (2)
76if (component.GetType() == componentType) 94var componentTypeInfo = GetComponentTypeInfo(instance.GetType());
NavigationManager.cs (5)
188throw new NotImplementedException($"The type {GetType().FullName} does not support supplying {nameof(NavigationOptions)}. To add support, that type should override {nameof(NavigateToCore)}(string uri, {nameof(NavigationOptions)} options)."); 231throw new InvalidOperationException($"'{GetType().Name}' already initialized."); 503=> throw new InvalidOperationException($"To support navigation locks, {GetType().Name} must override {nameof(HandleLocationChangingHandlerException)}"); 512=> throw new NotSupportedException($"To support navigation locks, {GetType().Name} must override {nameof(SetNavigationLockState)}"); 554throw new InvalidOperationException($"'{GetType().Name}' has not been initialized.");
NavigationManagerExtensions.cs (1)
222var valueType = value.GetType();
PersistentState\PersistentServicesRegistry.cs (2)
83var accessors = _cachedAccessorsByType.GetOrAdd(instance.GetType(), static (runtimeType, declaredType) => new PropertiesAccessor(runtimeType, declaredType), type); 131var accessors = _cachedAccessorsByType.GetOrAdd(instance.GetType(), static (runtimeType, declaredType) => new PropertiesAccessor(runtimeType, declaredType), type);
Reflection\ComponentProperties.cs (2)
28var targetType = target.GetType(); 173$"type '{target.GetType().FullName}'. The error was: {ex.Message}", ex);
Rendering\ComponentState.cs (1)
325return $"ComponentId = {ComponentId}, Type = {Component.GetType().Name}, Disposed = {_componentWasDisposed}";
Rendering\RenderQueueEntry.cs (1)
22return $"ComponentId = {ComponentState.ComponentId}, Type = {ComponentState.Component.GetType().Name}";
Rendering\RenderTreeBuilder.cs (1)
783throw new InvalidOperationException($"Render output is invalid for component of type '{component.GetType().FullName}'. A frame of type '{invalidFrame.FrameType}' was left unclosed. Do not use try/catch inside rendering logic, because partial output cannot be undone.");
RenderTree\Renderer.cs (3)
327=> GetRequiredRootComponentState(componentId).Component.GetType(); 951_renderingMetrics?.RenderStart(componentState.Component.GetType().FullName); 958_renderingMetrics?.RenderEnd(componentState.Component.GetType().FullName, renderFragmentException, startTime, Stopwatch.GetTimestamp());
RenderTree\Renderer.Log.cs (7)
25InitializingRootComponent(logger, componentState.ComponentId, componentState.Component.GetType()); 29InitializingChildComponent(logger, componentState.ComponentId, componentState.Component.GetType(), parentComponentState.ComponentId, parentComponentState.Component.GetType()); 41RenderingComponent(logger, componentState.ComponentId, componentState.Component.GetType()); 52DisposingComponent(logger, componentState.ComponentId, componentState.Component.GetType()); 63HandlingEvent(logger, eventHandlerId, eventArgs?.GetType().Name ?? "null"); 74SkippingEventOnDisposedComponent(logger, componentId, eventHandlerId, eventArgs?.GetType().Name ?? "null");
src\Http\Routing\src\RouteConstraintBuilder.cs (1)
145_inlineConstraintResolver.GetType().Name));
SupplyParameterFromPersistentComponentStateValueProvider.cs (3)
56var propertyGetter = ResolvePropertyGetter(subscriber.Component.GetType(), propertyName); 248private static string GetComponentType(ComponentState componentState) => componentState.Component.GetType().FullName!; 262var keyType = key.GetType();
Microsoft.AspNetCore.Components.Analyzers.Tests (3)
AnalyzerTestBase.cs (2)
21var filePath = Path.Combine(ProjectDirectory, "TestFiles", GetType().Name, source); 39return DiagnosticProject.Create(GetType().Assembly, new[] { read.Source, });
Verifiers\DiagnosticVerifier.cs (1)
244var analyzerType = analyzer.GetType();
Microsoft.AspNetCore.Components.Endpoints (12)
Builder\RazorComponentEndpointDataSource.cs (1)
157throw new InvalidOperationException($"Unable to find a provider for the render mode: {renderMode.GetType().FullName}. This generally " +
DependencyInjection\HttpNavigationManager.cs (1)
41throw new InvalidOperationException($"'{GetType().Name}' method for endpoint-based navigation has not been initialized.");
Rendering\EndpointComponentState.cs (1)
22var streamRenderingAttribute = _streamRenderingAttributeByComponentType.GetOrAdd(component.GetType(),
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
244static string GetName(ComponentState current) => current.Component.GetType().Name;
Rendering\SSRRenderModeBoundary.cs (6)
89throw new InvalidOperationException($"A component of type '{componentType}' has render mode '{specifiedMode.GetType().Name}', " + 125var valueType = value.GetType(); 128throw new InvalidOperationException($"Cannot pass RenderFragment<T> parameter '{name}' to component '{_componentType.Name}' with rendermode '{RenderMode.GetType().Name}'. Templated content can't be passed across a rendermode boundary, because it is arbitrary code and cannot be serialized."); 137throw new InvalidOperationException($"Cannot pass the parameter '{name}' to component '{_componentType.Name}' with rendermode '{RenderMode.GetType().Name}'. This is because the parameter is of the delegate type '{value.GetType()}', which is arbitrary code and cannot be serialized."); 170_ => throw new UnreachableException($"Unknown render mode {RenderMode.GetType().FullName}"),
src\Shared\Components\ComponentParameter.cs (1)
20var valueType = kvp.Value?.GetType();
src\Shared\PropertyHelper\PropertyHelper.cs (1)
333foreach (var helper in GetProperties(value.GetType(), PropertiesCache))
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
RazorComponentsServiceCollectionExtensionsTest.cs (2)
124{ ImplementationInstance: { } instance } => instance.GetType(), 125{ ImplementationFactory: { } factory } => factory(serviceProvider).GetType(),
TypeNameHashTest.cs (2)
42var type = new { Foo = "bar" }.GetType(); 58var type = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12).GetType();
Microsoft.AspNetCore.Components.Forms (8)
DataAnnotationsValidator.cs (1)
39throw new InvalidOperationException($"{GetType()} does not support changing the " +
EditContextDataAnnotationsExtensions.cs (1)
159var cacheKey = (ModelType: fieldIdentifier.Model.GetType(), fieldIdentifier.FieldName);
FieldIdentifier.cs (4)
48if (model.GetType().IsValueType) 137throw new ArgumentException($"The provided expression contains a {accessorBody.GetType().Name} which is not supported. {nameof(FieldIdentifier)} only supports simple member accessors (fields, properties) of an object."); 149throw new ArgumentException($"The provided expression contains a {accessorBody.GetType().Name} which is not supported. {nameof(FieldIdentifier)} only supports simple member accessors (fields, properties) of an object."); 164accessor = cache.GetOrAdd((value.GetType(), member.Member), CreateAccessor);
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (2)
214throw new InvalidOperationException($"Unable to evaluate index expressions of type '{indexExpression.GetType().Name}'."); 303throw new InvalidOperationException($"Unable to format constant values of type '{x.GetType()}'.");
Microsoft.AspNetCore.Components.QuickGrid (1)
Infrastructure\AsyncQueryExecutorSupplier.cs (1)
38var providerType = queryable.Provider?.GetType();
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (3)
AnalyzerTestBase.cs (2)
21var filePath = Path.Combine(ProjectDirectory, "TestFiles", GetType().Name, source); 39return DiagnosticProject.Create(GetType().Assembly, new[] { read.Source, });
Verifiers\DiagnosticVerifier.cs (1)
244var analyzerType = analyzer.GetType();
Microsoft.AspNetCore.Components.Server (10)
Circuits\CircuitHost.cs (1)
917handler.GetType(),
Circuits\RemoteNavigationManager.cs (2)
114throw new InvalidOperationException($"'{GetType().Name}' method for endpoint-based navigation has not been initialized."); 164throw new InvalidOperationException($"'{GetType().Name}' method for endpoint-based navigation has not been initialized.");
Circuits\RemoteRenderer.cs (1)
84GetComponentState(componentId).Component.GetType();
ProtectedBrowserStorage\ProtectedBrowserStorage.cs (2)
33throw new PlatformNotSupportedException($"{GetType()} cannot be used when running in a browser."); 155=> $"{GetType().FullName}:{_storeName}:{key}";
src\Shared\Components\ComponentParameter.cs (1)
20var valueType = kvp.Value?.GetType();
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (2)
419throw new InvalidDataException($"Unexpected message type: {message.GetType().Name}"); 503Serialize(ref writer, argument.GetType(), argument);
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\Utilities.cs (1)
41throw new InvalidOperationException("The underlying IBufferWriter<byte>.GetMemory(int) method returned an empty memory block, which is not allowed. This is a bug in " + bufferWriter.GetType().FullName);
Microsoft.AspNetCore.Components.Server.Tests (9)
Circuits\RenderBatchWriterTest.cs (2)
320var expectedEntry = expectedEntryIterationVar.GetType().IsEnum 349throw new InvalidOperationException($"Unsupported type: {expectedEntry.GetType().FullName}");
src\SignalR\common\SignalR.Common\test\Internal\Protocol\TestBinder.cs (4)
21_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray(); 24_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray(); 27_returnType = s.Item?.GetType() ?? typeof(object); 30_returnType = c.Result?.GetType() ?? typeof(object);
src\SignalR\common\SignalR.Common\test\Internal\Protocol\TestHubMessageEqualityComparer.cs (3)
20if (!Equals(x.GetType(), y.GetType())) 47throw new InvalidOperationException($"Unknown message type: {x.GetType().FullName}");
Microsoft.AspNetCore.Components.Tests (20)
ParameterViewTest.Assignment.cs (1)
769cascadingParameters.Add(new CascadingParameterState(new(null, name, value.GetType()), new TestCascadingValueProvider(value)));
ParameterViewTest.cs (3)
98new CascadingParameterState(new(null, "attribute 2", attribute2Value.GetType()), new TestCascadingValue(attribute2Value)), 99new CascadingParameterState(new(null, "attribute 3", attribute3Value.GetType()), new TestCascadingValue(attribute3Value)), 309new CascadingParameterState(new(null, "my entry", myEntryValue.GetType()), new TestCascadingValue(myEntryValue)),
Routing\RouteKeyTest.cs (7)
60var key1 = new RouteKey(typeof(string).Assembly, new[] { typeof(ComponentBase).Assembly, GetType().Assembly }); 61var key2 = new RouteKey(typeof(string).Assembly, new[] { typeof(ComponentBase).Assembly, GetType().Assembly }); 72var key1 = new RouteKey(typeof(string).Assembly, new[] { typeof(ComponentBase).Assembly, GetType().Assembly }); 73var key2 = new RouteKey(typeof(string).Assembly, new[] { GetType().Assembly, typeof(ComponentBase).Assembly }); 84var key1 = new RouteKey(typeof(string).Assembly, new[] { GetType().Assembly }); 85var key2 = new RouteKey(typeof(ComponentBase).Assembly, new[] { GetType().Assembly, }); 97var key2 = new RouteKey(typeof(ComponentBase).Assembly, new[] { GetType().Assembly, });
Routing\RouteTableFactoryTests.cs (9)
28var routes1 = routeTableFactory.Create(new RouteKey(GetType().Assembly, null), _serviceProvider); 31var routes2 = routeTableFactory.Create(new RouteKey(GetType().Assembly, null), _serviceProvider); 42var routes1 = routeTableFactory.Create(new RouteKey(typeof(object).Assembly, new[] { typeof(ComponentBase).Assembly, GetType().Assembly, }), _serviceProvider); 45var routes2 = routeTableFactory.Create(new RouteKey(typeof(object).Assembly, new[] { GetType().Assembly, typeof(ComponentBase).Assembly, }), _serviceProvider); 56var routes1 = routeTableFactory.Create(new RouteKey(GetType().Assembly, null), _serviceProvider); 59var routes2 = routeTableFactory.Create(new RouteKey(GetType().Assembly, new[] { typeof(object).Assembly }), _serviceProvider); 70var routeTable = routeTableFactory.Create(new RouteKey(GetType().Assembly, new[] { GetType().Assembly }), _serviceProvider); 83var routeTable = routeTableFactory.Create(new RouteKey(GetType().Assembly, Array.Empty<Assembly>()), _serviceProvider);
Microsoft.AspNetCore.Components.Web (17)
Forms\Editor.cs (1)
49throw new InvalidOperationException($"{GetType()} requires a value for the 'ValueExpression' " +
Forms\InputBase.cs (2)
235throw new InvalidOperationException($"{GetType()} requires a value for the 'ValueExpression' " + 263throw new InvalidOperationException($"{GetType()} does not support changing the " +
Forms\InputDate.cs (1)
62throw new InvalidOperationException($"Unsupported {GetType()} type param '{type}'.");
Forms\InputExtensions.cs (1)
48throw new InvalidOperationException($"{input.GetType()} does not support the type '{typeof(TValue)}'.", ex);
Forms\InputNumber.cs (1)
114throw new InvalidOperationException($"Unsupported type {value.GetType()}");
Forms\InputRadio.cs (1)
55throw new InvalidOperationException($"{GetType()} must have an ancestor {typeof(InputRadioGroup<TValue>)} " +
Forms\Mapping\FormMappingValidator.cs (1)
48throw new InvalidOperationException($"{GetType()} does not support changing the " +
Forms\Mapping\SupplyParameterFromFormValueProvider.cs (1)
63throw new InvalidOperationException($"Received an unexpected attribute type {parameterInfo.Attribute.GetType()}");
Forms\ValidationMessage.cs (3)
44throw new InvalidOperationException($"{GetType()} requires a cascading parameter " + 45$"of type {nameof(EditContext)}. For example, you can use {GetType()} inside " + 51throw new InvalidOperationException($"{GetType()} requires a value for the " +
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (2)
214throw new InvalidOperationException($"Unable to evaluate index expressions of type '{indexExpression.GetType().Name}'."); 303throw new InvalidOperationException($"Unable to format constant values of type '{x.GetType()}'.");
Virtualization\Virtualize.cs (3)
160$"{GetType()} requires a positive value for parameter '{nameof(ItemSize)}'."); 173$"{GetType()} can only accept one item source from its parameters. " + 194$"{GetType()} requires either the '{nameof(Items)}' or '{nameof(ItemsProvider)}' parameters to be specified " +
Microsoft.AspNetCore.Components.WebAssembly (1)
src\Shared\Components\ComponentParameter.cs (1)
20var valueType = kvp.Value?.GetType();
Microsoft.AspNetCore.Components.WebView.Photino (1)
PhotinoSynchronizationContext.cs (1)
50_uiThreadId = (int)_window.GetType()
Microsoft.AspNetCore.Components.WebView.Wpf (1)
BlazorWebView.cs (1)
376 throw new ObjectDisposedException(GetType().Name);
Microsoft.AspNetCore.Connections.Abstractions (1)
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (1)
116var givenType = givenParameters[givenIndex]?.GetType();
Microsoft.AspNetCore.DataProtection (1)
src\Shared\TrimmingAttributes.cs (1)
300/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.AspNetCore.DataProtection.Abstractions (1)
src\Shared\TrimmingAttributes.cs (1)
300/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.AspNetCore.DataProtection.Extensions (1)
src\Shared\TrimmingAttributes.cs (1)
300/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.AspNetCore.DataProtection.Tests (3)
ServiceCollectionTests.cs (2)
45services1.GetRequiredService<ILoggerFactory>().GetType(), 46services2.GetRequiredService<ILoggerFactory>().GetType());
XmlAssert.cs (1)
124throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, "Node of type '{0}' is not supported.", node.GetType().Name));
Microsoft.AspNetCore.Diagnostics (5)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (2)
1345WriteAttributeValue("", 17075, metadata.GetType().FullName ?? string.Empty, 17075, 46, false); 1354Write(metadata.GetType().Name);
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (2)
178handler = exceptionHandler.GetType().FullName; 200handler = _problemDetailsService.GetType().FullName;
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
40return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
DatabaseErrorPageMiddleware.cs (1)
170_localDiagnostic.Value?.Hold(contextErrorEventData.Exception, contextErrorEventData.Context!.GetType());
MigrationsEndPointMiddleware.cs (1)
71var dbName = db.GetType().FullName!;
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Logging\HttpLoggingRedactionInterceptor.cs (1)
170_logger.EnricherFailed(ex, enricher.GetType().Name);
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionDetailsProviderTest.cs (1)
109GetType().Assembly,
Microsoft.AspNetCore.Grpc.JsonTranscoding (9)
Internal\Json\AnyConverter.cs (3)
89JsonSerializer.Serialize(writer, wrappedValue, wrappedValue.GetType(), options); 93JsonSerializer.Serialize(writer, valueMessage, valueMessage.GetType(), options); 118JsonSerializer.Serialize(writer, value, value.GetType(), options);
Internal\Json\ListValueConverter.cs (1)
30JsonSerializer.Serialize(writer, list, list.GetType(), options);
Internal\Json\StructConverter.cs (1)
41JsonSerializer.Serialize(writer, v, v.GetType(), options);
Internal\Json\ValueConverter.cs (1)
80JsonSerializer.Serialize(writer, v, v.GetType(), options);
Internal\Json\WrapperConverter.cs (1)
31JsonSerializer.Serialize(writer, innerValue, innerValue.GetType(), options);
Internal\JsonRequestHelpers.cs (1)
392responseType = message.GetType();
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
379var enumType = value.GetType();
Microsoft.AspNetCore.Grpc.Swagger (1)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
379var enumType = value.GetType();
Microsoft.AspNetCore.Hosting (3)
GenericHost\GenericWebHostBuilder.cs (1)
208UseStartup(instance.GetType(), context, services, instance);
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
40return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
WebHostBuilderExtensions.cs (1)
122return new ConventionBasedStartup(StartupLoader.LoadMethods(serviceProvider, instance.GetType(), hostingEnvironment.EnvironmentName, instance));
Microsoft.AspNetCore.Hosting.Tests (3)
ConfigureBuilderTests.cs (1)
15var methodInfo = GetType().GetMethod(nameof(InjectedMethod), BindingFlags.NonPublic | BindingFlags.Static);
Fakes\StartupThrowTypeLoadException.cs (1)
14classes: new Type[] { GetType() },
HostingApplicationDiagnosticsTests.cs (1)
1086var property = o.GetType().GetTypeInfo().GetProperty(name, BindingFlags.Instance | BindingFlags.Public);
Microsoft.AspNetCore.Http (1)
Builder\ApplicationBuilder.cs (1)
141return middleware.Target.GetType().FullName + "." + middleware.Method.Name;
Microsoft.AspNetCore.Http.Abstractions (8)
Extensions\UseMiddlewareExtensions.cs (1)
183throw new InvalidOperationException(Resources.FormatException_UseMiddlewareUnableToCreateMiddleware(middlewareFactory.GetType(), _middlewareType));
Routing\RouteValueDictionary.cs (1)
889var type = Value.GetType();
src\Shared\PropertyHelper\PropertyHelper.cs (1)
333foreach (var helper in GetProperties(value.GetType(), PropertiesCache))
Validation\ValidatableParameterInfo.cs (2)
120if (context.ValidationOptions.TryGetValidatableTypeInfo(item.GetType(), out var validatableType)) 133var valueType = value.GetType();
Validation\ValidatablePropertyInfo.cs (2)
125var itemType = item.GetType(); 141var valueType = propertyValue.GetType();
Validation\ValidatableTypeInfo.cs (1)
66var actualType = value.GetType();
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
RouteValueDictionaryTests.cs (1)
347$"The type '{obj.GetType().FullName}' defines properties 'controller' and 'Controller' which differ " +
Microsoft.AspNetCore.Http.Extensions (15)
DefaultProblemDetailsWriter.cs (1)
64var problemDetailsType = context.ProblemDetails.GetType();
RequestDelegateFactory.cs (1)
182object => Expression.Convert(TargetExpr, handler.Target.GetType()),
src\Shared\Json\JsonSerializerExtensions.cs (1)
26=> context.GetTypeInfo(type) ?? throw new InvalidOperationException($"Unable to obtain the JsonTypeInfo for type '{type.FullName}' from the context '{context.GetType().FullName}'.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
41var runtimeType = value?.GetType();
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
40return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.AspNetCore.Http.Extensions.Tests (28)
ProblemDetailsServiceCollectionExtensionsTest.cs (1)
236Assert.Equal("Microsoft.AspNetCore.Http.ProblemDetailsJsonContext", jsonOptions.Value.SerializerOptions.TypeInfoResolverChain[1].GetType().FullName);
PropertyAsParameterInfoTests.cs (2)
120a => typeof(TestAttribute).IsAssignableFrom(a.GetType())); 123a => typeof(SampleAttribute).IsAssignableFrom(a.GetType()));
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (1)
522m => m.GetType().Name != "NullableContextAttribute" &&
ValidationsGenerator\ValidationsGenerator.ValidatableType.cs (21)
155subType.GetType().GetProperty("RequiredProperty")?.SetValue(subType, ""); 156subType.GetType().GetProperty("StringWithLength")?.SetValue(subType, "way-too-long"); 183inheritanceType.GetType().GetProperty("RequiredProperty")?.SetValue(inheritanceType, ""); 184inheritanceType.GetType().GetProperty("StringWithLength")?.SetValue(inheritanceType, "way-too-long"); 185inheritanceType.GetType().GetProperty("EmailString")?.SetValue(inheritanceType, "not-an-email"); 220subType1.GetType().GetProperty("RequiredProperty")?.SetValue(subType1, ""); 221subType1.GetType().GetProperty("StringWithLength")?.SetValue(subType1, "way-too-long"); 225subType2.GetType().GetProperty("RequiredProperty")?.SetValue(subType2, "valid"); 226subType2.GetType().GetProperty("StringWithLength")?.SetValue(subType2, "way-too-long"); 230subType3.GetType().GetProperty("RequiredProperty")?.SetValue(subType3, "valid"); 231subType3.GetType().GetProperty("StringWithLength")?.SetValue(subType3, "valid"); 234subTypeList.GetType().GetMethod("Add")?.Invoke(subTypeList, [subType1]); 235subTypeList.GetType().GetMethod("Add")?.Invoke(subTypeList, [subType2]); 236subTypeList.GetType().GetMethod("Add")?.Invoke(subTypeList, [subType3]); 340subType1.GetType().GetProperty("RequiredProperty")?.SetValue(subType1, "valid"); 341subType1.GetType().GetProperty("StringWithLength")?.SetValue(subType1, "valid"); 346subType2.GetType().GetProperty("RequiredProperty")?.SetValue(subType2, "valid"); 347subType2.GetType().GetProperty("StringWithLength")?.SetValue(subType2, "valid"); 352inheritanceType.GetType().GetProperty("RequiredProperty")?.SetValue(inheritanceType, "valid"); 353inheritanceType.GetType().GetProperty("StringWithLength")?.SetValue(inheritanceType, "valid"); 354inheritanceType.GetType().GetProperty("EmailString")?.SetValue(inheritanceType, "test@example.com");
ValidationsGenerator\ValidationsGeneratorTestBase.cs (3)
104var endpoints = (IReadOnlyList<Endpoint>)service.GetType().GetProperty("Endpoints", BindingFlags.Instance | BindingFlags.Public).GetValue(service); 364var buildMethod = builder.GetType().GetMethod("Build"); 374var hostType = host.GetType();
Microsoft.AspNetCore.Http.Results (3)
HttpResultsHelper.cs (1)
40Type? runtimeType = value.GetType();
ServerSentEventsResult.cs (1)
82var runtimeType = item.Data.GetType();
src\Shared\Json\JsonSerializerExtensions.cs (1)
26=> context.GetTypeInfo(type) ?? throw new InvalidOperationException($"Unable to obtain the JsonTypeInfo for type '{type.FullName}' from the context '{context.GetType().FullName}'.");
Microsoft.AspNetCore.Http.Tests (2)
DefaultHttpContextTests.cs (2)
335var type = value.GetType(); 363var type = value.GetType();
Microsoft.AspNetCore.Identity (3)
SecurityStampValidator.cs (2)
35Logger = logger.CreateLogger(GetType()); 54Logger = logger.CreateLogger(GetType());
SignInManager.cs (1)
965if (GetType() == typeof(SignInManager<TUser>))
Microsoft.AspNetCore.Identity.FunctionalTests (2)
Infrastructure\ServerFactory.cs (2)
145if (!manager.ApplicationParts.Any(p => p.GetType() == part.GetType() &&
Microsoft.AspNetCore.Identity.Test (3)
SignInManagerTest.cs (3)
1101new AuthenticationScheme("blah", "Blah blah", handler.Object.GetType()) 1132new AuthenticationScheme("blah", "Blah blah", handler.Object.GetType()) 1164new AuthenticationScheme("blah", "Blah blah", handler.Object.GetType())
Microsoft.AspNetCore.InternalTesting (6)
LoggedTest\LoggedTestBase.cs (3)
55return AssemblyTestLog.ForAssembly(GetType().GetTypeInfo().Assembly).StartTestLog(TestOutputHelper, GetType().FullName, out loggerFactory, minLogLevel, testName); 64var classType = GetType();
xunit\AspNetTestMethodRunner.cs (2)
36if (testCase.GetType() == typeof(XunitTestCase)) 53if (testCase.GetType() == typeof(XunitTheoryTestCase))
xunit\ConditionalTheoryDiscoverer.cs (1)
54var type = obj.GetType();
Microsoft.AspNetCore.InternalTesting.Tests (3)
TestContextTest.cs (3)
18Assert.Equal(GetType().FullName, Context.FileOutput.TestClassName); 43Assert.Equal(GetType().Name, Context.FileOutput.TestClassName); 69Assert.Equal(GetType().Name, Context.FileOutput.TestClassName);
Microsoft.AspNetCore.JsonPatch (23)
Adapters\AdapterFactory.cs (1)
28var jsonContract = contractResolver.ResolveContract(target.GetType());
Adapters\ObjectAdapter.cs (1)
187var copyResult = ConversionResultProvider.CopyTo(propertyValue, propertyValue?.GetType());
Internal\ConversionResultProvider.cs (3)
27else if (typeToConvertTo.IsAssignableFrom(value.GetType())) 65else if (typeToConvertTo.IsAssignableFrom(value.GetType())) 68targetType = value.GetType();
Internal\DictionaryAdapterOfTU.cs (6)
24var contract = (JsonDictionaryContract)contractResolver.ResolveContract(target.GetType()); 51var contract = (JsonDictionaryContract)contractResolver.ResolveContract(target.GetType()); 79var contract = (JsonDictionaryContract)contractResolver.ResolveContract(target.GetType()); 106var contract = (JsonDictionaryContract)contractResolver.ResolveContract(target.GetType()); 140var contract = (JsonDictionaryContract)contractResolver.ResolveContract(target.GetType()); 187var contract = (JsonDictionaryContract)contractResolver.ResolveContract(target.GetType());
Internal\DynamicObjectAdapter.cs (9)
68if (property.GetType().IsValueType 69&& Nullable.GetUnderlyingType(property.GetType()) == null) 71value = Activator.CreateInstance(property.GetType()); 95if (!TryConvertValue(value, property.GetType(), contractResolver, out var convertedValue)) 127if (!TryConvertValue(value, property.GetType(), contractResolver, out var convertedValue)) 172var jsonDynamicContract = (JsonDynamicContract)contractResolver.ResolveContract(target.GetType()); 179target.GetType(), 208var jsonDynamicContract = (JsonDynamicContract)contractResolver.ResolveContract(target.GetType()); 215target.GetType(),
Internal\ListAdapter.cs (1)
270var listType = list.GetType();
Internal\PocoAdapter.cs (1)
209if (contractResolver.ResolveContract(target.GetType()) is JsonObjectContract jsonObjectContract)
src\Shared\TrimmingAttributes.cs (1)
300/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.AspNetCore.JsonPatch.SystemTextJson (14)
Adapters\AdapterFactory.cs (1)
25var typeToConvert = target.GetType();
Adapters\ObjectAdapter.cs (1)
186var copyResult = ConversionResultProvider.CopyTo(propertyValue, propertyValue?.GetType(), SerializerOptions);
Helpers\GenericListOrJsonArrayUtilities.cs (6)
24throw new InvalidOperationException($"Unsupported list type: {list.GetType()}"); 39throw new InvalidOperationException($"Unsupported list type: {list.GetType()}"); 55throw new InvalidOperationException($"Unsupported list type: {list.GetType()}"); 70throw new InvalidOperationException($"Unsupported list type: {list.GetType()}"); 86throw new InvalidOperationException($"Unsupported list type: {list.GetType()}"); 102throw new InvalidOperationException($"Unsupported list type: {list.GetType()}");
Internal\ConversionResultProvider.cs (4)
18if (typeToConvertTo.IsAssignableFrom(value.GetType())) 35if (typeToConvertTo != value.GetType() && typeToConvertTo.IsAssignableFrom(value.GetType())) 38targetType = value.GetType();
Internal\ListAdapter.cs (1)
199var listType = list.GetType();
Internal\PocoAdapter.cs (1)
204var typeInfo = serializerOptions.GetTypeInfo(target.GetType());
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (7)
Adapters\AdapterFactoryTests.cs (3)
24Assert.Equal(typeof(ListAdapter), adapter.GetType()); 37Assert.Equal(typeof(DictionaryAdapter<string, string>), adapter.GetType()); 53Assert.Equal(typeof(PocoAdapter), adapter.GetType());
IntegrationTests\NestedObjectIntegrationTest.cs (1)
238Assert.Equal(typeof(InheritedObject), targetObject.SimpleObject.GetType());
Internal\ListAdapterTest.cs (2)
27Assert.Equal($"The type '{targetObject.GetType().FullName}' which is an array is not supported for json patch operations as it has a fixed size.", message); 45Assert.Equal($"The type '{targetObject.GetType().FullName}' which is a non generic list is not supported for json patch operations. Only generic list types are supported.", message);
Internal\ObjectVisitorTest.cs (1)
91Assert.Equal(typeof(DictionaryAdapter<string, string>), adapter.GetType());
Microsoft.AspNetCore.JsonPatch.Tests (9)
Adapters\AdapterFactoryTests.cs (4)
28Assert.Equal(typeof(ListAdapter), adapter.GetType()); 41Assert.Equal(typeof(DictionaryAdapter<string, string>), adapter.GetType()); 57Assert.Equal(typeof(PocoAdapter), adapter.GetType()); 70Assert.Equal(typeof(DynamicObjectAdapter), adapter.GetType());
IntegrationTests\NestedObjectIntegrationTest.cs (1)
253Assert.Equal(typeof(InheritedObject), targetObject.SimpleObject.GetType());
Internal\ListAdapterTest.cs (2)
27Assert.Equal($"The type '{targetObject.GetType().FullName}' which is an array is not supported for json patch operations as it has a fixed size.", message); 45Assert.Equal($"The type '{targetObject.GetType().FullName}' which is a non generic list is not supported for json patch operations. Only generic list types are supported.", message);
Internal\ObjectVisitorTest.cs (2)
90Assert.Equal(typeof(DictionaryAdapter<string, string>), adapter.GetType()); 120Assert.Same(typeof(DictionaryAdapter<string, object>), adapter.GetType());
Microsoft.AspNetCore.Localization (2)
RequestLocalizationMiddleware.cs (2)
78_logger.UnsupportedCultures(provider.GetType().Name, cultures); 91_logger.UnsupportedUICultures(provider.GetType().Name, uiCultures);
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisMiddleware.cs (1)
35middlewareName = next.Target!.GetType().FullName!;
Microsoft.AspNetCore.Mvc (1)
HotReloadService.cs (1)
38if (modelMetadataProvider.GetType() == typeof(DefaultModelMetadataProvider))
Microsoft.AspNetCore.Mvc.Abstractions (2)
Formatters\FormatterCollection.cs (1)
49if (formatter.GetType() == formatterType)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
40return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
ApiDescriptionGroupCollectionProvider.cs (3)
67Log.ApiDescriptionProviderExecuting(_logger, provider.GetType().Name, provider.GetType().Assembly.GetName().Name, provider.GetType().Assembly.GetName().Version?.ToString());
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (4)
DefaultApiDescriptionProviderTest.cs (4)
2174var methodInfo = GetType().GetMethod(nameof(ParameterDefaultValue), BindingFlags.Instance | BindingFlags.NonPublic); 2200var methodInfo = GetType().GetMethod(nameof(ParameterDefaultValue), BindingFlags.Instance | BindingFlags.NonPublic); 2223var methodInfo = GetType().GetMethod(nameof(AcceptsId_Query), BindingFlags.Instance | BindingFlags.NonPublic); 2355action.MethodInfo = GetType().GetMethod(
Microsoft.AspNetCore.Mvc.Core (75)
ApiConventionTypeAttribute.cs (1)
87attribute.GetType().FullName == "System.Runtime.CompilerServices.NullableContextAttribute";
ApplicationModels\AuthorizationApplicationModelProvider.cs (1)
74if (policyProvider.GetType() == typeof(DefaultAuthorizationPolicyProvider))
ControllerContext.cs (1)
91private string DebuggerToString() => ActionDescriptor?.DisplayName ?? $"{{{GetType().FullName}}}";
Controllers\ControllerActivatorProvider.cs (1)
31if (controllerActivator.GetType() != typeof(DefaultControllerActivator))
Controllers\ControllerFactoryProvider.cs (1)
28if (controllerFactory.GetType() != typeof(DefaultControllerFactory))
Controllers\DefaultControllerPropertyActivator.cs (1)
19var controllerType = controller.GetType();
DependencyInjection\ApplicationModelConventionExtensions.cs (1)
40if (applicationModelConvention.GetType() == type)
Filters\DisableRequestSizeLimitFilter.cs (2)
39Log.NotMostEffectiveFilter(_logger, GetType(), effectivePolicy.GetType(), typeof(IRequestSizePolicy));
Filters\OutputCacheFilter.cs (3)
23_logger = loggerFactory.CreateLogger(GetType()); 35Log.NotMostEffectiveFilter(_logger, GetType(), effectivePolicy.GetType(), typeof(IOutputCacheFilter));
Filters\RequestFormLimitsFilter.cs (2)
30Log.NotMostEffectiveFilter(_logger, GetType(), effectivePolicy.GetType(), typeof(IRequestFormLimitsPolicy));
Filters\RequestSizeLimitFilter.cs (2)
41Log.NotMostEffectiveFilter(_logger, GetType(), effectivePolicy.GetType(), typeof(IRequestSizePolicy));
Filters\ResponseCacheFilter.cs (3)
25_logger = loggerFactory.CreateLogger(GetType()); 91Log.NotMostEffectiveFilter(_logger, GetType(), effectivePolicy.GetType(), typeof(IResponseCacheFilter));
Formatters\FormatFilter.cs (1)
33_logger = loggerFactory.CreateLogger(GetType());
Formatters\InputFormatter.cs (2)
44GetType().FullName, 126GetType().FullName,
Formatters\OutputFormatter.cs (2)
39GetType().FullName, 100GetType().FullName,
Formatters\SystemTextJsonOutputFormatter.cs (1)
79var runtimeType = context.Object?.GetType();
Formatters\TextOutputFormatter.cs (1)
117throw new InvalidOperationException(Resources.FormatOutputFormatterNoMediaType(GetType().FullName));
Infrastructure\ActionSelectionTable.cs (1)
88return e.GetType() == typeof(Endpoint);
Infrastructure\AsyncEnumerableReader.cs (1)
91value.GetType()));
Infrastructure\ClientErrorResultFilter.cs (2)
54Log.TransformingClientError(_logger, context.Result.GetType(), result.GetType(), clientError.StatusCode);
Infrastructure\FileContentResultExecutor.cs (1)
81var fileResultType = fileResult.GetType().Name;
Infrastructure\FileStreamResultExecutor.cs (1)
93var fileResultType = fileResult.GetType().Name;
Infrastructure\ObjectResultExecutor.cs (3)
76objectType = result.Value?.GetType(); 151var objectResultType = result.GetType().Name; 152var valueType = value == null ? "null" : value.GetType().FullName;
Infrastructure\PhysicalFileResultExecutor.cs (1)
169var fileResultType = fileResult.GetType().Name;
Infrastructure\ResourceInvoker.Log.cs (2)
87BeforeExecutingActionResult(logger, actionResult.GetType()); 95AfterExecutingActionResult(logger, actionResult.GetType());
Infrastructure\SystemTextJsonResultExecutor.cs (2)
61var objectType = value?.GetType() ?? typeof(object); 139var type = value == null ? "null" : value.GetType().FullName;
Infrastructure\VirtualFileResultExecutor.cs (1)
151var fileResultType = fileResult.GetType().Name;
ModelBinding\Binders\CollectionModelBinder.cs (1)
61Logger = loggerFactory.CreateLogger(GetType());
ModelBinding\Metadata\DefaultModelMetadata.cs (1)
466if (metadata?.GetType() != typeof(DefaultModelMetadata))
ModelBinding\Metadata\MetadataDetailsProviderExtensions.cs (1)
38if (metadataDetailsProvider.GetType() == type)
ModelBinding\ModelBinderProviderExtensions.cs (1)
38if (modelBinderProvider.GetType() == type)
ModelBinding\ModelBindingHelper.cs (7)
224if (!modelType.IsAssignableFrom(model.GetType())) 227model.GetType().FullName, 621if (type.IsAssignableFrom(value.GetType())) 678if (value == null || destinationType.IsAssignableFrom(value.GetType())) 693var canConvertFrom = converter.CanConvertFrom(value.GetType()); 696converter = TypeDescriptor.GetConverter(value.GetType()); 715Resources.FormatValueProviderResult_NoConverterExists(value.GetType(), destinationType));
ModelBinding\ObjectModelValidator.cs (1)
51var metadata = model == null ? null : _modelMetadataProvider.GetMetadataForType(model.GetType());
ModelBinding\ParameterBinder.cs (2)
46Logger = loggerFactory.CreateLogger(GetType()); 248var modelType = modelBindingResult.Model.GetType();
ModelBinding\Validation\ModelValidatorProviderExtensions.cs (1)
38if (modelValidatorProvider.GetType() == type)
ModelBinding\ValueProviderFactoryExtensions.cs (1)
38if (valueProviderFactory.GetType() == type)
MvcCoreLoggerExtensions.cs (2)
270filterList.Add($"{filter.GetType()} (Order: {orderedFilter.Order})"); 274filterList.Add(filter.GetType().ToString());
Routing\ActionConstraintMatcherPolicy.cs (2)
58if (actionConstraint.GetType() == typeof(HttpMethodActionConstraint)) 62else if (actionConstraint.GetType() == typeof(ConsumesAttribute))
Routing\KnownRouteValueConstraint.cs (1)
84actionDescriptorsProvider.GetType()));
src\Shared\Json\JsonSerializerExtensions.cs (1)
26=> context.GetTypeInfo(type) ?? throw new InvalidOperationException($"Unable to obtain the JsonTypeInfo for type '{type.FullName}' from the context '{context.GetType().FullName}'.");
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
src\Shared\PropertyHelper\PropertyHelper.cs (1)
333foreach (var helper in GetProperties(value.GetType(), PropertiesCache))
TypeFilterAttribute.cs (1)
66var argumentTypes = Arguments?.Select(a => a.GetType())?.ToArray();
Microsoft.AspNetCore.Mvc.Core.Test (120)
ApiConventionMethodAttributeTest.cs (1)
69var attributeType = a.GetType();
ControllerBaseTest.cs (3)
2925await controller.TryUpdateModelAsync(model, model.GetType(), modelName, valueProvider, propertyFilter); 2953var result = await controller.TryUpdateModelAsync(model, model.GetType(), modelName); 2981var result = await controller.TryUpdateModelAsync(model, model.GetType(), modelName);
Formatters\SystemTextJsonOutputFormatterTest.cs (2)
103asyncEnumerable.GetType(), 132asyncEnumerable.GetType(),
Infrastructure\ActionMethodExecutorTest.cs (15)
33Assert.Equal("VoidResultExecutor", actionMethodExecutor.GetType().Name); 59Assert.Equal("SyncActionResultExecutor", actionMethodExecutor.GetType().Name); 85Assert.Equal("SyncActionResultExecutor", actionMethodExecutor.GetType().Name); 112Assert.Equal("SyncObjectResultExecutor", actionMethodExecutor.GetType().Name); 141Assert.Equal("SyncObjectResultExecutor", actionMethodExecutor.GetType().Name); 170Assert.Equal("SyncObjectResultExecutor", actionMethodExecutor.GetType().Name); 197Assert.Equal("SyncActionResultExecutor", actionMethodExecutor.GetType().Name); 222Assert.Equal("TaskResultExecutor", actionMethodExecutor.GetType().Name); 248Assert.Equal("AwaitableResultExecutor", actionMethodExecutor.GetType().Name); 274Assert.Equal("TaskOfIActionResultExecutor", actionMethodExecutor.GetType().Name); 300Assert.Equal("TaskOfActionResultExecutor", actionMethodExecutor.GetType().Name); 327Assert.Equal("AwaitableObjectResultExecutor", actionMethodExecutor.GetType().Name); 356Assert.Equal("AwaitableObjectResultExecutor", actionMethodExecutor.GetType().Name); 383Assert.Equal("AwaitableObjectResultExecutor", actionMethodExecutor.GetType().Name); 410Assert.Equal("AwaitableObjectResultExecutor", actionMethodExecutor.GetType().Name);
Infrastructure\ActionResultTypeMapperTest.cs (2)
36var result = mapper.Convert(returnValue, returnValue.GetType()); 52var result = mapper.Convert(returnValue, returnValue.GetType());
Infrastructure\AsyncEnumerableReaderTest.cs (16)
38var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 56var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 75Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader1)); 76Assert.True(readerFactory.TryGetReader(asyncEnumerable2.GetType(), out var reader2)); 92Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader1)); 93Assert.True(readerFactory.TryGetReader(asyncEnumerable2.GetType(), out var reader2)); 110Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader)); 127Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader)); 144Assert.True(readerFactory.TryGetReader(enumerable1.GetType(), out var reader1)); 145Assert.True(readerFactory.TryGetReader(enumerable2.GetType(), out var reader2)); 161var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 175var expected = $"'AsyncEnumerableReader' reached the configured maximum size of the buffer when enumerating a value of type '{enumerable.GetType()}'. " + 177$"consider ways to reduce the collection size, or consider manually converting '{enumerable.GetType()}' into a list rather than increasing the limit."; 182Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader)); 198Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader)); 213Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader));
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (25)
601var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithBindRequired.Age)); 603var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 666var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 668var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithDataMemberIsRequired.Age)); 703var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 707var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithBindRequired.Age)); 737var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 739var property = GetMetadataForProperty(model.GetType(), nameof(BindingOptionalProperty.ValueTypeRequired)); 760var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 762var property = GetMetadataForProperty(model.GetType(), nameof(NullableValueTypeProperty.NullableValueType)); 783var containerMetadata = GetMetadataForType(model.GetType()); 787var property = GetMetadataForProperty(model.GetType(), nameof(Person.ValueTypeRequired)); 808var containerMetadata = GetMetadataForType(model.GetType()); 812var property = GetMetadataForProperty(model.GetType(), nameof(Person.ValueTypeRequired)); 838var containerMetadata = GetMetadataForType(model.GetType()); 866var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 888var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 912var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 936var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 978var type = model.GetType(); 1002var modelMetadata = GetMetadataForType(model.GetType()); 1003var propertyMetadata = GetMetadataForProperty(model.GetType(), nameof(CollectionContainer.ReadOnlyList)); 1023var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 1047var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 1067var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (26)
782var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithBindRequired.Age)); 784var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 816var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 820var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithDataMemberIsRequired.Age)); 850var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 856var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithBindRequired.Age)); 881var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 885var property = GetMetadataForProperty(model.GetType(), nameof(BindingOptionalProperty.ValueTypeRequired)); 901var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 905var property = GetMetadataForProperty(model.GetType(), nameof(NullableValueTypeProperty.NullableValueType)); 921var containerMetadata = GetMetadataForType(model.GetType()); 927var property = GetMetadataForProperty(model.GetType(), nameof(Person.ValueTypeRequired)); 943var containerMetadata = GetMetadataForType(model.GetType()); 949var property = GetMetadataForProperty(model.GetType(), nameof(Person.ValueTypeRequired)); 970var containerMetadata = GetMetadataForType(model.GetType()); 1003var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithPropertyInitializedInConstructor.NameContainer)); 1028var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 1050var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 1074var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 1098var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 1140var type = model.GetType(); 1164var modelMetadata = GetMetadataForType(model.GetType()); 1165var propertyMetadata = GetMetadataForProperty(model.GetType(), nameof(CollectionContainer.ReadOnlyList)); 1185var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 1209var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model); 1229var bindingContext = CreateContext(GetMetadataForType(model.GetType()), model);
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (3)
268var parameter = GetType() 319var parameter = GetType() 336var parameter = GetType()
ModelBinding\Metadata\DefaultModelMetadataTest.cs (3)
990var parameter = GetType() 1009var property = GetType() 1011var modelIdentity = ModelMetadataIdentity.ForProperty(property, property.PropertyType, GetType());
ModelBinding\ModelBindingHelperTest.cs (6)
468model.GetType(), 523model.GetType(), 551modelType: model.GetType(), 591model.GetType(), 614var modelName = model.GetType().FullName; 1261var expectedMessage = $"The parameter conversion from type '{value.GetType()}' to type " +
ModelBinding\ParameterBinderTest.cs (2)
307var method = GetType().GetMethod(nameof(TestMethodWithoutAttributes), BindingFlags.NonPublic | BindingFlags.Instance); 362var method = GetType().GetMethod(nameof(TestMethodWithAttributes), BindingFlags.NonPublic | BindingFlags.Instance);
MvcCoreLoggerExtensionsTest.cs (15)
208$"{authFilter.GetType()}, {asyncAuthFilter.GetType()}, {orderedAuthFilter.GetType()} (Order: -100)", 254$"{resourceFilter.GetType()}, {asyncResourceFilter.GetType()}, {orderedResourceFilter.GetType()} (Order: -100)", 300$"{actionFilter.GetType()}, {asyncActionFilter.GetType()}, {orderedActionFilter.GetType()} (Order: -100)", 346$"{exceptionFilter.GetType()}, {asyncExceptionFilter.GetType()}, {orderedExceptionFilter.GetType()} (Order: -100)", 392$"{resultFilter.GetType()}, {asyncResultFilter.GetType()}, {orderedResultFilter.GetType()} (Order: -100)",
Routing\KnownRouteValueConstraintTests.cs (1)
198var providerName = actionDescriptorCollectionProvider.GetType().FullName;
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
SimpleValueProvider.cs (1)
40if (rawValue != null && rawValue.GetType().IsArray)
Microsoft.AspNetCore.Mvc.Cors (1)
CorsAuthorizationFilter.cs (1)
49_logger = loggerFactory.CreateLogger(GetType());
Microsoft.AspNetCore.Mvc.DataAnnotations (3)
DataAnnotationsMetadataProvider.cs (1)
220else if (dataTypeAttribute.GetType() != typeof(DataTypeAttribute))
ValidatableObjectAdapter.cs (1)
24model.GetType());
ValidationAttributeAdapterProvider.cs (1)
24var type = attribute.GetType();
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (4)
DataAnnotationsModelValidatorProviderTest.cs (3)
25var metadata = _metadataProvider.GetMetadataForType(mockValidatable.GetType()); 99var metadata = _metadataProvider.GetMetadataForType(mockValidatable.Object.GetType()); 118var result = provider.HasValidators(mockValidatable.GetType(), Array.Empty<object>());
DataAnnotationsModelValidatorTest.cs (1)
535var json = Newtonsoft.Json.JsonConvert.SerializeObject(values) + " " + attribute.GetType().Name;
Microsoft.AspNetCore.Mvc.Formatters.Xml (11)
SerializableErrorWrapperProvider.cs (1)
25original.GetType().Name),
XmlDataContractSerializerInputFormatter.cs (1)
90if (GetType() == typeof(XmlDataContractSerializerInputFormatter))
XmlDataContractSerializerOutputFormatter.cs (4)
85_logger = loggerFactory.CreateLogger(GetType()); 230if (value is not null && _asyncEnumerableReaderFactory.TryGetReader(value.GetType(), out var reader)) 235valueType = value.GetType(); 316BufferingAsyncEnumerable(logger, asyncEnumerable.GetType().FullName!);
XmlSerializerInputFormatter.cs (1)
72if (GetType() == typeof(XmlSerializerInputFormatter))
XmlSerializerOutputFormatter.cs (4)
82_logger = loggerFactory.CreateLogger(GetType()); 208if (value is not null && _asyncEnumerableReaderFactory.TryGetReader(value.GetType(), out var reader)) 213valueType = value.GetType(); 305BufferingAsyncEnumerable(logger, asyncEnumerable.GetType().FullName!);
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (34)
ProblemDetailsWrapperProviderFactoryTest.cs (3)
28var context = new WrapperProviderContext(instance.GetType(), isSerialization: true); 45var context = new WrapperProviderContext(instance.GetType(), isSerialization: true); 62var context = new WrapperProviderContext(instance.GetType(), isSerialization: true);
ProblemDetailsWrapperTest.cs (1)
86var dataContractSerializer = new DataContractSerializer(wrapper.GetType());
ValidationProblemDetailsWrapperTest.cs (2)
175var dataContractSerializer = new DataContractSerializer(wrapper.GetType()); 213var dataContractSerializer = new DataContractSerializer(wrapper.GetType());
XmlDataContractSerializerOutputFormatterTest.cs (15)
102var outputFormatterContext = GetOutputFormatterContext(input, input.GetType()); 160var formatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 191var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 226var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 251var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 282var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType(), 313var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 334var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 352var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 487var outputFormatterContext = GetOutputFormatterContext(parent, parent.GetType()); 524var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 618var outputFormatterContext = GetOutputFormatterContext(parent, parent.GetType()); 707var outputFormatterContext = GetOutputFormatterContext(input, input.GetType()); 733asyncEnumerable.GetType()); 771asyncEnumerable.GetType());
XmlSerializerOutputFormatterTest.cs (13)
56var outputFormatterContext = GetOutputFormatterContext(input, input.GetType()); 91var outputFormatterContext = GetOutputFormatterContext(input, input.GetType()); 111var outputFormatterContext = GetOutputFormatterContext(input, input.GetType()); 164var formatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 191var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 224var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 247var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 277GetOutputFormatterContext(sampleInput, sampleInput.GetType(), "application/xml; charset=utf-16"); 304var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 323var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 406var outputFormatterContext = GetOutputFormatterContext(sampleInput, sampleInput.GetType()); 515asyncEnumerable.GetType()); 553asyncEnumerable.GetType());
Microsoft.AspNetCore.Mvc.IntegrationTests (14)
ComplexTypeIntegrationTestBase.cs (1)
45Assert.Equal(ExpectedModelBinderType, modelBinder.GetType());
NullableReferenceTypeIntegrationTest.cs (1)
166var method = GetType().GetMethod(nameof(NonNullableParameter), BindingFlags.NonPublic | BindingFlags.Instance);
ProductValidatorAttribute.cs (1)
38+ value.GetType() + " instance");
TryUpdateModelIntegrationTest.cs (2)
1160Assert.Equal($"TryUpdateModelAsync cannot update a record type model. If a '{model.GetType()}' must be updated, include it in an object type.", ex.Message); 1362model.GetType(),
ValidationIntegrationTests.cs (5)
2020var parameterInfo = GetType().GetMethod(nameof(Validation_ListOfType_NoValidatorOnParameterTestMethod), BindingFlags.NonPublic | BindingFlags.Static) 2072var parameterInfo = GetType().GetMethod(nameof(Validation_ListOfType_ValidatorOnParameterTestMethod), BindingFlags.NonPublic | BindingFlags.Static) 2142var parameterInfo = GetType().GetMethod(nameof(Validation_CollectionOfType_ValidatorOnElementTestMethod), BindingFlags.NonPublic | BindingFlags.Static) 2466var parameterInfo = GetType().GetMethod(nameof(Validation_InifnitelyRecursiveModel_ValidationOnTopLevelParameterMethod), BindingFlags.NonPublic | BindingFlags.Static) 2511var parameterInfo = GetType().GetMethod(nameof(Validation_ModelWithNonNullableReferenceTypes_DoesNotValidateNonNullablePropertiesOnFrameworkTypesAction), BindingFlags.NonPublic | BindingFlags.Static)
ValidationWithRecordIntegrationTests.cs (4)
1811var parameterInfo = GetType().GetMethod(nameof(Validation_ListOfType_NoValidatorOnParameterTestMethod), BindingFlags.NonPublic | BindingFlags.Static) 1863var parameterInfo = GetType().GetMethod(nameof(Validation_ListOfType_ValidatorOnParameterTestMethod), BindingFlags.NonPublic | BindingFlags.Static) 1933var parameterInfo = GetType().GetMethod(nameof(Validation_CollectionOfType_ValidatorOnElementTestMethod), BindingFlags.NonPublic | BindingFlags.Static) 2252var parameterInfo = GetType().GetMethod(nameof(Validation_InifnitelyRecursiveModel_ValidationOnTopLevelParameterMethod), BindingFlags.NonPublic | BindingFlags.Static)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (12)
BsonTempDataSerializer.cs (1)
156var itemType = item.GetType();
DependencyInjection\MvcNewtonsoftJsonOptionsExtensions.cs (2)
44var contractResolverName = options.SerializerSettings.ContractResolver.GetType().Name; 76var contractResolverName = options.SerializerSettings.ContractResolver.GetType().Name;
JsonPatchExtensions.cs (1)
51var affectedObjectName = jsonPatchError.AffectedObject.GetType().Name;
NewtonsoftJsonInputFormatter.cs (1)
76if (GetType() == typeof(NewtonsoftJsonInputFormatter))
NewtonsoftJsonOutputFormatter.cs (2)
153if (value is not null && _asyncEnumerableReaderFactory.TryGetReader(value.GetType(), out var reader)) 240BufferingAsyncEnumerable(logger, asyncEnumerable.GetType().FullName);
NewtonsoftJsonPatchInputFormatter.cs (1)
52if (GetType() == typeof(NewtonsoftJsonPatchInputFormatter))
NewtonsoftJsonResultExecutor.cs (3)
105if (value != null && _asyncEnumerableReaderFactory.TryGetReader(value.GetType(), out var reader)) 175BufferingAsyncEnumerable(logger, asyncEnumerable.GetType().FullName); 186var type = value == null ? "null" : value.GetType().FullName;
src\Mvc\Mvc.Core\src\Infrastructure\AsyncEnumerableReader.cs (1)
91value.GetType()));
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (19)
NewtonsoftJsonOutputFormatterTest.cs (3)
451asyncEnumerable.GetType(), 496asyncEnumerable.GetType(), 530asyncEnumerable.GetType(),
src\Mvc\Mvc.Core\test\Infrastructure\AsyncEnumerableReaderTest.cs (16)
38var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 56var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 75Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader1)); 76Assert.True(readerFactory.TryGetReader(asyncEnumerable2.GetType(), out var reader2)); 92Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader1)); 93Assert.True(readerFactory.TryGetReader(asyncEnumerable2.GetType(), out var reader2)); 110Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader)); 127Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader)); 144Assert.True(readerFactory.TryGetReader(enumerable1.GetType(), out var reader1)); 145Assert.True(readerFactory.TryGetReader(enumerable2.GetType(), out var reader2)); 161var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 175var expected = $"'AsyncEnumerableReader' reached the configured maximum size of the buffer when enumerating a value of type '{enumerable.GetType()}'. " + 177$"consider ways to reduce the collection size, or consider manually converting '{enumerable.GetType()}' into a list rather than increasing the limit."; 182Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader)); 198Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader)); 213Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader));
Microsoft.AspNetCore.Mvc.Razor (9)
DefaultTagHelperFactory.cs (1)
57tagHelper.GetType(),
RazorHotReload.cs (2)
36if (razorViewEngine.GetType() == typeof(RazorViewEngine)) 41if (razorPageActivator.GetType() == typeof(RazorPageActivator))
RazorPageActivator.cs (1)
69var pageType = page.GetType();
RazorPagePropertyActivator.cs (1)
66else if (context.ViewData.GetType() != _viewDataDictionaryType)
TagHelpers\TagHelperComponentPropertyActivator.cs (1)
33tagHelperComponent.GetType(),
TagHelpers\TagHelperComponentTagHelper.cs (3)
40_logger = loggerFactory.CreateLogger(GetType()); 72Log.TagHelperComponentInitialized(_logger, component.GetType().FullName!); 86Log.TagHelperComponentProcessed(_logger, component.GetType().FullName!);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
AssemblyPartExtensionTest.cs (1)
15var assembly = GetType().Assembly;
Microsoft.AspNetCore.Mvc.Razor.Test (1)
ApplicationParts\RazorCompiledItemFeatureProviderTest.cs (1)
148Assert.Contains(typeof(RouteAttribute), item.Item.Metadata.Select(m => m.GetType())); // Verify we pick up new attributes
Microsoft.AspNetCore.Mvc.RazorPages (4)
ApplicationModels\PageConventionCollection.cs (1)
242if (pageConvention.GetType() == pageConventionType)
Filters\PageResponseCacheFilter.cs (1)
26_logger = loggerFactory.CreateLogger(GetType());
Infrastructure\DefaultPageFactoryProvider.cs (1)
47_pageActivator.GetType().FullName,
PageContext.cs (1)
123private string DebuggerToString() => ActionDescriptor?.DisplayName ?? $"{{{GetType().FullName}}}";
Microsoft.AspNetCore.Mvc.RazorPages.Test (23)
Infrastructure\CompiledPageActionDescriptorFactoryTest.cs (11)
79var methodInfo = GetType().GetMethod(nameof(OnGet), BindingFlags.Instance | BindingFlags.NonPublic); 107var methodInfo = GetType().GetMethod(nameof(OnGet), BindingFlags.Instance | BindingFlags.NonPublic); 134var methodInfo = GetType().GetMethod(nameof(OnGet), BindingFlags.Instance | BindingFlags.NonPublic); 165var methodInfo = GetType().GetMethod(nameof(OnGet), BindingFlags.Instance | BindingFlags.NonPublic); 196var methodInfo = GetType().GetMethod(nameof(OnGet), BindingFlags.Instance | BindingFlags.NonPublic); 227var methodInfo = GetType().GetMethod(nameof(OnGet), BindingFlags.Instance | BindingFlags.NonPublic); 262var methodInfo = GetType().GetMethod(nameof(OnGet), BindingFlags.Instance | BindingFlags.NonPublic); 263var propertyInfo = GetType().GetProperty(nameof(TestProperty), BindingFlags.Instance | BindingFlags.NonPublic); 296var methodInfo = GetType().GetMethod(nameof(OnGet), BindingFlags.Instance | BindingFlags.NonPublic); 297var propertyInfo = GetType().GetProperty(nameof(TestProperty), BindingFlags.Instance | BindingFlags.NonPublic); 327var propertyInfo = GetType().GetProperty(nameof(TestProperty), BindingFlags.Instance | BindingFlags.NonPublic);
Infrastructure\DefaultPageActivatorProviderTest.cs (4)
118PageTypeInfo = page.GetType().GetTypeInfo() 139PageTypeInfo = page.GetType().GetTypeInfo() 160PageTypeInfo = page.GetType().GetTypeInfo() 181PageTypeInfo = page.GetType().GetTypeInfo()
Infrastructure\DefaultPageFactoryProviderTest.cs (1)
37$"Page created by '{pageActivator.GetType()}' must be an instance of '{typeof(PageBase)}'.",
Infrastructure\DefaultPageHandlerMethodSelectorTest.cs (4)
623MethodInfo = GetType().GetMethod(nameof(Post)), 629MethodInfo = GetType().GetMethod(nameof(PostAsync)), 675MethodInfo = GetType().GetMethod(nameof(Post)), 682MethodInfo = GetType().GetMethod(nameof(PostAsync)),
Infrastructure\DefaultPageModelActivatorProviderTest.cs (3)
164ModelTypeInfo = model.GetType().GetTypeInfo() 185ModelTypeInfo = model.GetType().GetTypeInfo() 206ModelTypeInfo = model.GetType().GetTypeInfo()
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
InputTagHelperTest.cs (1)
167possibleBool.GetType().FullName,
Microsoft.AspNetCore.Mvc.Test (4)
MvcServiceCollectionExtensionsTest.cs (4)
276{ ImplementationInstance: { } instance } => instance.GetType(), 277{ ImplementationFactory: { } factory } => factory(serviceProvider).GetType(), 656implementations.Add(service.ImplementationInstance.GetType()); 661implementations.Add(instance.GetType());
Microsoft.AspNetCore.Mvc.Testing (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.5.25257.101\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
181var buildMethod = builder.GetType().GetMethod("Build"); 191var hostType = host.GetType();
Microsoft.AspNetCore.Mvc.ViewFeatures (30)
DefaultDisplayTemplates.cs (2)
85"Collection", model.GetType().FullName, typeof(IEnumerable).FullName)); 117itemMetadata = metadataProvider.GetMetadataForType(item.GetType());
DefaultEditorTemplates.cs (2)
67"Collection", model.GetType().FullName, typeof(IEnumerable).FullName)); 99itemMetadata = metadataProvider.GetMetadataForType(item.GetType());
DefaultHtmlGenerator.cs (2)
989var valueType = value.GetType(); 1509value.GetType().FullName,
ExpressionMetadataProvider.cs (3)
169viewDataInfo.Container.GetType(), 176var containerMetadata = metadataProvider.GetMetadataForType(viewDataInfo.Container.GetType()); 185var valueMetadata = metadataProvider.GetMetadataForType(viewDataInfo.Value.GetType());
Filters\SaveTempDataPropertyFilterBase.cs (1)
136tempDataSerializer.GetType().FullName,
Filters\ValidateAntiforgeryTokenAuthorizationFilter.cs (1)
20_logger = loggerFactory.CreateLogger(GetType());
HtmlHelper.cs (1)
168foreach (var helper in HtmlAttributePropertyHelper.GetProperties(htmlAttributes.GetType()))
HtmlHelperOfT.cs (1)
82viewContext.ViewData.GetType().FullName,
Infrastructure\DefaultTempDataSerializer.cs (2)
148if (!CanSerializeType(value.GetType())) 153value.GetType()));
ModelExplorer.cs (1)
162return Model.GetType();
ModelExplorerExtensions.cs (1)
70if (!stringResult.Equals(modelExplorer.Model.GetType().FullName, StringComparison.Ordinal))
Rendering\ViewContext.cs (1)
218private string DebuggerToString() => View?.Path ?? $"{{{GetType().FullName}}}";
ViewComponents\DefaultViewComponentFactory.cs (1)
54viewComponent.GetType(),
ViewComponents\DefaultViewComponentHelper.cs (1)
117if (descriptor.Parameters.Count == 1 && descriptor.Parameters[0].ParameterType.IsAssignableFrom(arguments.GetType()))
ViewDataDictionary.cs (4)
195var modelType = model?.GetType(); 442var modelType = value?.GetType(); 498message = Resources.FormatViewData_WrongTModelType(value.GetType(), _declaredModelType); 516return _declaredModelType.IsAssignableFrom(value.GetType());
ViewDataDictionaryControllerPropertyActivator.cs (1)
40var controllerType = controller.GetType();
ViewDataEvaluator.cs (2)
167var tryDelegate = TryGetValueProvider.CreateInstance(indexableObject.GetType()); 200var propertyInfo = container.GetType().GetRuntimeProperty(propertyName);
ViewExecutor.cs (3)
134throw new InvalidOperationException(Resources.FormatPropertyOfTypeCannotBeNull(nameof(ViewOptions), GetType().Name)); 139throw new InvalidOperationException(Resources.FormatPropertyOfTypeCannotBeNull(nameof(TempDataFactory), GetType().Name)); 144throw new InvalidOperationException(Resources.FormatPropertyOfTypeCannotBeNull(nameof(ModelMetadataProvider), GetType().Name));
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (16)
Filters\ControllerSaveTempDataPropertyFilterTest.cs (4)
28var controllerType = controller.GetType(); 73var controllerType = controller.GetType(); 117var controllerType = controller.GetType(); 156var controllerType = controller.GetType();
HtmlAttributePropertyHelperTest.cs (8)
16var property = anonymous.GetType().GetTypeInfo().DeclaredProperties.First(); 31var property = anonymous.GetType().GetTypeInfo().DeclaredProperties.First(); 46var property = anonymous.GetType().GetTypeInfo().DeclaredProperties.First(); 61var property = anonymous.GetType().GetTypeInfo().DeclaredProperties.First(); 78var helpers1 = HtmlAttributePropertyHelper.GetProperties(anonymous.GetType()); 79var helpers2 = HtmlAttributePropertyHelper.GetProperties(anonymous.GetType()); 94var helpers1 = HtmlAttributePropertyHelper.GetProperties(anonymous.GetType()); 95var helpers2 = PropertyHelper.GetProperties(anonymous.GetType());
Infrastructure\DefaultTempDataSerializerTest.cs (2)
52Assert.Equal($"The '{testProvider.GetType()}' cannot serialize an object of type '{value.GetType()}'.", ex.Message);
Rendering\DefaultTemplatesUtilities.cs (1)
330var modelExplorer = helper.MetadataProvider.GetModelExplorerForType(model.GetType(), model);
ViewDataDictionaryTest.cs (1)
143$"The model item passed into the ViewDataDictionary is of type '{ model.GetType() }', but this " +
Microsoft.AspNetCore.OpenApi (11)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
40return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (2)
SnapshotTestHelper.cs (2)
372var buildMethod = builder.GetType().GetMethod("Build"); 382var hostType = host.GetType();
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
225action.MethodInfo = GetType().GetMethod(
Microsoft.AspNetCore.Owin (1)
OwinFeatureCollection.cs (1)
346if (key.IsAssignableFrom(GetType()))
Microsoft.AspNetCore.Routing (7)
EndpointDataSource.cs (1)
49throw new NotSupportedException(Resources.FormatMapGroup_CustomEndpointUnsupported(endpoint.GetType()));
Matching\JumpTable.cs (1)
15return GetType().Name;
Matching\PolicyJumpTable.cs (1)
21return GetType().Name;
RouteConstraintBuilder.cs (1)
145_inlineConstraintResolver.GetType().Name));
src\Shared\Json\JsonSerializerExtensions.cs (1)
26=> context.GetTypeInfo(type) ?? throw new InvalidOperationException($"Unable to obtain the JsonTypeInfo for type '{type.FullName}' from the context '{context.GetType().FullName}'.");
src\Shared\PropertyHelper\PropertyHelper.cs (1)
333foreach (var helper in GetProperties(value.GetType(), PropertiesCache))
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
41var runtimeType = value?.GetType();
Microsoft.AspNetCore.Routing.Abstractions (1)
src\Shared\PropertyHelper\PropertyHelper.cs (1)
333foreach (var helper in GetProperties(value.GetType(), PropertiesCache))
Microsoft.AspNetCore.Routing.Tests (6)
Patterns\RoutePatternParserTest.cs (2)
699if (x.GetType() != y.GetType())
Tree\TreeRouterTest.cs (4)
1813Assert.Equal(next.Object.GetType(), nestedRouters[0].GetType()); 1855Assert.Equal(next.Object.GetType(), nestedRouters[0].GetType());
Microsoft.AspNetCore.Server.IIS (2)
Core\IISServerSetupFilter.cs (1)
18if (server?.GetType() != typeof(IISHttpServer))
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
40return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Deployers\ApplicationDeployer.cs (1)
25Logger = LoggerFactory.CreateLogger(GetType().FullName);
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (1)
79throw new ObjectDisposedException(GetType().Name, "This instance of deployer has already been disposed.");
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (1)
IISExpressDeployer.cs (1)
279using (var stream = GetType().Assembly.GetManifestResourceStream("Microsoft.AspNetCore.Server.IntegrationTesting.IIS.Http.config"))
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Infrastructure\TransportManager.cs (2)
61throw new InvalidOperationException($"No registered {nameof(IConnectionListenerFactory)} supports endpoint {endPoint.GetType().Name}: {endPoint}"); 87throw new InvalidOperationException($"No registered {nameof(IMultiplexedConnectionListenerFactory)} supports endpoint {endPoint.GetType().Name}: {endPoint}");
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
HttpRequestHeadersTests.cs (1)
144var methodValue = (StringValues)headerReferences.GetType().GetField("_Method").GetValue(headerReferences);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Internal\NamedPipeTransportFactory.cs (1)
41throw new NotSupportedException($"{endpoint.GetType()} is not supported.");
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
Internal\QuicConnectionListener.cs (1)
45throw new InvalidOperationException($"QUIC doesn't support listening on the configured endpoint type. Expected {nameof(IPEndPoint)} but got {endpoint.GetType().Name}.");
Microsoft.AspNetCore.Shared.Tests (40)
PropertyActivatorTest.cs (6)
17var typeInfo = instance.GetType().GetTypeInfo(); 40var typeInfo = instance.GetType().GetTypeInfo(); 56var typeInfo = instance.GetType().GetTypeInfo(); 80var typeInfo = instance.GetType().GetTypeInfo(); 104var typeInfo = instance.GetType().GetTypeInfo(); 123var typeInfo = instance.GetType().GetTypeInfo();
PropertyHelperTest.cs (21)
19var property = PropertyHelper.GetProperties(anonymous.GetType()).First().Property; 34var property = PropertyHelper.GetProperties(anonymous.GetType()).First().Property; 49var property = PropertyHelper.GetProperties(anonymous.GetType()).First().Property; 66instance.GetType()).First(prop => prop.Name == "PropA"); 82instance.GetType()).First(prop => prop.Name == "PropA"); 97var property = PropertyHelper.GetProperties(anonymous.GetType()).First().Property; 114var helpers1 = PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo()); 115var helpers2 = PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo()); 130var helper = Assert.Single(PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo())); 141var helper = Assert.Single(PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo())); 152var helper = Assert.Single(PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo())); 164var helper = Assert.Single(PropertyHelper.GetProperties(obj.GetType().GetTypeInfo())); 179var helper = Assert.Single(PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo())); 219var helper1 = Assert.Single(PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo()).Where(prop => prop.Name == "IntProp")); 220var helper2 = Assert.Single(PropertyHelper.GetProperties(anonymous.GetType().GetTypeInfo()).Where(prop => prop.Name == "StringProp")); 232var helpers = PropertyHelper.GetProperties(derived.GetType().GetTypeInfo()).ToArray(); 252var helpers = PropertyHelper.GetProperties(derived.GetType().GetTypeInfo()).ToArray(); 272var helpers = PropertyHelper.GetProperties(derived.GetType().GetTypeInfo()).ToArray(); 438var typeInfo = instance.GetType().GetTypeInfo(); 458var typeInfo = instance.GetType().GetTypeInfo(); 474var typeInfo = instance.GetType().GetTypeInfo();
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (1)
116var givenType = givenParameters[givenIndex]?.GetType();
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
src\Shared\PropertyHelper\PropertyHelper.cs (1)
333foreach (var helper in GetProperties(value.GetType(), PropertiesCache))
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
40return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.AspNetCore.SignalR.Client.Core (18)
HubConnection.cs (6)
779if (arg is not null && ReflectionHelper.IsStreamingType(arg.GetType())) 843if (ReflectionHelper.GetIAsyncEnumerableInterface(reader.GetType()) is { } asyncEnumerableType) 855if (ReflectionHelper.TryGetStreamType(reader.GetType(), out var channelGenericType)) 868throw new InvalidOperationException($"{reader.GetType()} is not a {typeof(ChannelReader<>).Name}."); 1368throw new InvalidOperationException($"Unexpected message type: {message.GetType().FullName}"); 2313Log.DroppingMessage(_logger, ((HubInvocationMessage)message).GetType().Name, ((HubInvocationMessage)message).InvocationId);
HubConnection.Log.cs (6)
31var argsList = args == null ? string.Empty : string.Join(", ", args.Select(a => a?.GetType().FullName ?? "(null)")); 42SendingMessage(logger, message.GetType().Name, invocationMessage.InvocationId); 46SendingMessageGeneric(logger, message.GetType().Name); 63MessageSent(logger, message.GetType().Name, invocationMessage.InvocationId); 67MessageSentGeneric(logger, message.GetType().Name); 88var argsList = args == null ? string.Empty : string.Join(", ", args.Select(a => a?.GetType().FullName ?? "(null)"));
HubConnectionBuilder.cs (1)
89return base.GetType();
src\SignalR\common\Shared\AsyncEnumerableAdapters.cs (3)
158var constructedIAsyncEnumerableInterface = ReflectionHelper.GetIAsyncEnumerableInterface(asyncEnumerable.GetType())!; 187var type = ReflectionHelper.GetIAsyncEnumeratorInterface(enumerator.GetType()); 215var type = channelReader.GetType();
src\SignalR\common\Shared\MessageBuffer.cs (2)
125return WriteAsyncCore(hubMessage.Message?.GetType() ?? typeof(HubInvocationMessage), hubMessage.GetSerializedMessage(_protocol), cancellationToken); 130return WriteAsyncCore(hubMessage.GetType(), _protocol.GetMessageBytes(hubMessage), cancellationToken);
Microsoft.AspNetCore.SignalR.Common.Tests (9)
Internal\Protocol\JsonHubProtocolTests.cs (2)
254Assert.Equal(expected.GetType(), actual.GetType());
Internal\Protocol\TestBinder.cs (4)
21_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray(); 24_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray(); 27_returnType = s.Item?.GetType() ?? typeof(object); 30_returnType = c.Result?.GetType() ?? typeof(object);
Internal\Protocol\TestHubMessageEqualityComparer.cs (3)
20if (!Equals(x.GetType(), y.GetType())) 47throw new InvalidOperationException($"Unknown message type: {x.GetType().FullName}");
Microsoft.AspNetCore.SignalR.Core (23)
HubLifetimeManager.cs (2)
149throw new NotImplementedException($"{GetType().Name} does not support client return values."); 160throw new NotImplementedException($"{GetType().Name} does not support client return values.");
HubOptionsSetup.cs (1)
35if (hubProtocol.GetType().CustomAttributes.Where(a => a.AttributeType.FullName == "Microsoft.AspNetCore.SignalR.Internal.NonDefaultHubProtocolAttribute").Any())
Internal\DefaultHubDispatcher.cs (3)
163Log.DroppingMessage(_logger, hubMessage.GetType().Name, (hubMessage as HubInvocationMessage)?.InvocationId ?? "(null)"); 238Log.UnsupportedMessageReceived(_logger, hubMessage.GetType().FullName!); 750descriptor.OriginalParameterTypes[parameterPointer].IsAssignableFrom(hubMethodInvocationMessage.Arguments[hubInvocationArgumentPointer]?.GetType())))
Internal\DefaultHubProtocolResolver.cs (1)
26Log.RegisteredSignalRProtocol(_logger, protocol.Name, protocol.GetType());
SerializedHubMessage.cs (1)
45Debug.Assert(message.GetType().IsAssignableTo(typeof(HubInvocationMessage)));
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]); 523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
src\SignalR\common\Shared\AsyncEnumerableAdapters.cs (3)
158var constructedIAsyncEnumerableInterface = ReflectionHelper.GetIAsyncEnumerableInterface(asyncEnumerable.GetType())!; 187var type = ReflectionHelper.GetIAsyncEnumeratorInterface(enumerator.GetType()); 215var type = channelReader.GetType();
src\SignalR\common\Shared\MessageBuffer.cs (2)
125return WriteAsyncCore(hubMessage.Message?.GetType() ?? typeof(HubInvocationMessage), hubMessage.GetSerializedMessage(_protocol), cancellationToken); 130return WriteAsyncCore(hubMessage.GetType(), _protocol.GetMessageBytes(hubMessage), cancellationToken);
Microsoft.AspNetCore.SignalR.Microbenchmarks (5)
HubConnectionReceiveBenchmark.cs (1)
88_hubConnection.On(MethodName, arguments.Select(v => v.GetType()).ToArray(), OnInvoke);
TestBinder.cs (4)
18_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray(); 21_paramTypes = i.Arguments?.Select(a => a?.GetType() ?? typeof(object))?.ToArray(); 24_returnType = s.Item?.GetType() ?? typeof(object); 27_returnType = c.Result?.GetType() ?? typeof(object);
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
567throw new InvalidOperationException($"Unsupported message type: {message.GetType().FullName}");
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (2)
Protocol\MessagePackHubProtocolWorker.cs (2)
419throw new InvalidDataException($"Unexpected message type: {message.GetType().Name}"); 503Serialize(ref writer, argument.GetType(), argument);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Protocol\NewtonsoftJsonHubProtocol.cs (1)
564throw new InvalidOperationException($"Unsupported message type: {message.GetType().FullName}");
Microsoft.AspNetCore.SignalR.Tests (8)
HubConnectionHandlerTests.cs (3)
2309Assert.Equal(typeof(MethodHub), resource.Hub.GetType()); 2787Assert.Fail("Unexpected message type: " + message.GetType().Name); 3931Assert.Equal(typeof(CompletionMessage), response.GetType());
HubConnectionHandlerTestUtils\Utils.cs (1)
52throw new InvalidOperationException($"Unsupported Hub Message type {expected.GetType()}");
Internal\DefaultHubProtocolResolverTests.cs (3)
25protocol.GetType(), 38protocol.GetType(), 51protocol.GetType(),
Internal\ReflectionHelperTests.cs (1)
45streamAsObject.GetType(),
Microsoft.AspNetCore.TestHost (3)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.5.25257.101\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
181var buildMethod = builder.GetType().GetMethod("Build"); 191var hostType = host.GetType();
WebHostBuilderExtensions.cs (1)
80if (webHostBuilder.GetType().Name.Equals("GenericWebHostBuilder", StringComparison.Ordinal))
Microsoft.Bcl.AsyncInterfaces (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
Microsoft.Bcl.Numerics (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
Microsoft.Build (68)
BackEnd\Client\MSBuildClient.cs (1)
583throw new InvalidOperationException($"Unexpected packet type {packet.GetType().Name}");
BackEnd\Components\BuildRequestEngine\FullyQualifiedBuildRequest.cs (2)
118return GetType() == obj.GetType() && InternalEquals((FullyQualifiedBuildRequest)obj);
BackEnd\Components\Logging\LoggingContext.cs (1)
331this.GetType());
BackEnd\Components\Logging\LoggingService.cs (6)
787loggerTypes.Add(logger.GetType().FullName); 1455InternalLoggerException.Throw(e, null, "FatalErrorDuringLoggerShutdown", false, logger.GetType().Name); 1537ErrorUtilities.ThrowInternalError("Unknown logging item in queue:" + loggingEvent.GetType().FullName); 1781using var assemblyLoadTracker = AssemblyLoadsTracker.StartTracking(this, AssemblyLoadingContext.LoggerInitialization, UnwrapLoggerType(logger).GetType()); 1795InternalLoggerException.Throw(e, null, "FatalErrorWhileInitializingLogger", true, logger.GetType().Name); 1840_ => innerLogger.GetType().FullName == "Microsoft.Build.Logging.TerminalLogger.TerminalLogger"
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
214pluginTypeName = projectCacheDescriptor.PluginInstance.GetType().Name;
BackEnd\Components\RequestBuilder\IntrinsicTask.cs (1)
80ErrorUtilities.ThrowInternalError("Unhandled intrinsic task type {0}", taskInstance.GetType().GetTypeInfo().BaseType);
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupLoggingHelper.cs (1)
246else if (parameterValue.GetType().IsValueType)
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
664using var assemblyLoadsTracker = AssemblyLoadsTracker.StartTracking(taskLoggingContext, AssemblyLoadingContext.TaskRun, _taskExecutionHost?.TaskInstance?.GetType());
BackEnd\Components\RequestBuilder\TaskHost.cs (2)
1119if (!e.GetType().GetTypeInfo().IsSerializable && e is not IExtendedBuildEventArgs) 1122_taskLoggingContext.LogWarning(null, new BuildEventFileInfo(string.Empty), "ExpectedEventToBeSerializable", e.GetType().Name);
BackEnd\Components\SdkResolution\SdkResolverService.cs (1)
341catch (Exception e) when ((e is FileNotFoundException || e is FileLoadException) && sdkResolver.GetType().GetTypeInfo().Name.Equals("NuGetSdkResolver", StringComparison.Ordinal))
BackEnd\Node\OutOfProcNode.cs (1)
610buildEvent?.GetType().Name ?? string.Empty);
BackEnd\Shared\BuildRequestConfiguration.cs (2)
887if (GetType() != obj.GetType())
BackEnd\Shared\ConfigurationMetadata.cs (2)
129if (GetType() != obj.GetType())
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (1)
339string realTaskAssemblyLoaction = TaskInstance.GetType().Assembly.Location;
BuildCheck\Infrastructure\BuildCheckBuildEventHandler.cs (1)
57if (_eventHandlers.TryGetValue(e.GetType(), out Action<BuildEventArgs>? handler))
BuildCheck\Infrastructure\BuildCheckForwardingLogger.cs (1)
54if (_eventsToForward.Contains(buildEvent.GetType()))
Construction\ProjectElement.cs (6)
354ErrorUtilities.VerifyThrowArgument(GetType().IsEquivalentTo(element.GetType()), "CannotCopyFromElementOfThatType"); 507if (!clone.GetType().IsEquivalentTo(GetType())) 509ErrorUtilities.ThrowInternalError("{0}.Clone() returned an instance of type {1}.", GetType().Name, clone.GetType().Name);
Construction\ProjectElementContainer.cs (2)
355ErrorUtilities.VerifyThrowArgument(GetType().IsEquivalentTo(element.GetType()), "CannotCopyFromElementOfThatType");
Construction\ProjectExtensionsElement.cs (2)
165ErrorUtilities.VerifyThrowArgument(GetType().IsEquivalentTo(element.GetType()), "CannotCopyFromElementOfThatType");
ErrorUtilities.cs (2)
105if (String.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal)) 107ThrowInternalError("This type does not implement ToString() properly {0}", param.GetType().FullName!);
Evaluation\Evaluator.cs (1)
1808using var assemblyLoadsTracker = AssemblyLoadsTracker.StartTracking(_evaluationLoggingContext, AssemblyLoadingContext.SdkResolution, _sdkResolverService.GetType());
Evaluation\Expander.cs (4)
3417functionBuilder.ReceiverType = propertyValue.GetType(); 3448var receiverType = propertyValue?.GetType() ?? typeof(string); 3552_receiverType = objectInstance.GetType(); 3557args[0] = Convert.ChangeType(args[0], objectInstance.GetType(), CultureInfo.InvariantCulture);
Evaluation\Expander\WellKnownFunctions.cs (3)
26if (args[i].GetType() != type) 41? string.Join(", ", args.Select(a => a?.GetType().Name ?? "null")) 44File.AppendAllText(logFile, $"ReceiverType={receiverType?.FullName}; ObjectInstanceType={objectInstance?.GetType().FullName}; MethodName={methodName}({argSignature})\n");
Evaluation\LazyItemEvaluator.IncludeOperation.cs (1)
138throw new InvalidOperationException(fragment.GetType().ToString());
Instance\ProjectItemGroupTaskInstance.cs (1)
130var typeName = this.GetType().FullName;
Instance\ProjectOnErrorInstance.cs (1)
119var typeName = this.GetType().FullName;
Instance\ProjectPropertyGroupTaskInstance.cs (1)
129var typeName = this.GetType().FullName;
Instance\ProjectTaskInstance.cs (1)
362var typeName = this.GetType().FullName;
Instance\ProjectTaskOutputItemInstance.cs (1)
140var typeName = this.GetType().FullName;
Instance\ProjectTaskOutputPropertyInstance.cs (1)
140var typeName = this.GetType().FullName;
Instance\TaskFactoryLoggingHost.cs (2)
343if (!e.GetType().GetTypeInfo().IsSerializable && 348_loggingContext.LogWarning(null, new BuildEventFileInfo(string.Empty), "ExpectedEventToBeSerializable", e.GetType().Name);
LogMessagePacketBase.cs (2)
417Type eventDerivedType = _buildEvent.GetType(); 616Type eventType = eventArg.GetType();
ResourceUtilities.cs (3)
435if (string.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal) && 436param.GetType() != typeof(string)) 440param.GetType().FullName);
TaskLoggingHelper.cs (3)
56TaskName = taskInstance.GetType().Name; 277Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 472Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
TaskParameter.cs (1)
103Type wrappedParameterType = wrappedParameter.GetType();
Utilities\EngineFileUtilities.cs (3)
288loggingMechanism?.GetType(), 329loggingMechanism?.GetType(), 359loggingMechanism.GetType(),
Utilities\Utilities.cs (2)
671Debug.Fail($"In {nameof(EnumerateProperties)}(): Unexpected property {item} of type {item?.GetType().ToString()}"); 829Debug.Fail($"In {nameof(EnumerateItems)}(): Unexpected {nameof(item)} {item} of type {item?.GetType().ToString()}");
Microsoft.Build.BuildCheck.UnitTests (4)
BuildCheckManagerProviderTests.cs (2)
47_logger.AllBuildEvents.Where(be => be.GetType() == typeof(BuildMessageEventArgs)).Select(be => be.Message).ToArray() 59var mockedField = _testedInstance.GetType().GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance);
EditorConfig_Tests.cs (2)
62if (x.GetType() != y.GetType())
Microsoft.Build.CommandLine.UnitTests (2)
ValidateAssemblyLoadContext.cs (2)
26if (thisLoadContext.GetType().FullName == typeof(MSBuildLoadContext).FullName) 39Log.LogError($"Load context was a {thisLoadContext.GetType().AssemblyQualifiedName} instead of an {typeof(MSBuildLoadContext).AssemblyQualifiedName}");
Microsoft.Build.Engine.OM.UnitTests (11)
Construction\ElementLocationPublic_Tests.cs (1)
125foreach (var property in element.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
Definition\ProjectCollection_Tests.cs (1)
1451Version expectedVersion = new Version(this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version);
ErrorUtilities.cs (2)
105if (String.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal)) 107ThrowInternalError("This type does not implement ToString() properly {0}", param.GetType().FullName!);
ObjectModelRemoting\Helpers\ViewValidation.cs (1)
275throw new NotImplementedException($"Unknown type:{view.GetType().Name}");
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\ProjectElemetExportHelper.cs (1)
107var implType = xml.GetType();
ObjectModelRemoting\RemoteProjectsProviderMock\LinkedObjectsMap.cs (2)
110throw new ObjectDisposedException(GetType().Name); 188throw new ObjectDisposedException(GetType().Name);
ResourceUtilities.cs (3)
435if (string.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal) && 436param.GetType() != typeof(string)) 440param.GetType().FullName);
Microsoft.Build.Engine.UnitTests (29)
BackEnd\BinaryTranslator_Tests.cs (2)
1477if (obj.GetType() != this.GetType())
BackEnd\EventSourceSink_Tests.cs (1)
300Type eventType = buildEventToRaise.GetType();
BackEnd\FailingTask.cs (1)
17BuildEngine.GetType().GetProperty("AllowFailureWithoutError").SetValue(BuildEngine, AllowFailureWithoutError.Equals("True"));
BackEnd\NodePackets_Tests.cs (1)
344.WithTracing(), "Roundtrip deserialization of message type {0} should be equivalent", args.GetType().Name);
BackEnd\SdkResolverLoader_Tests.cs (1)
49resolvers.Select(i => i.GetType().FullName).ShouldBe(new[] { typeof(DefaultSdkResolver).FullName });
BackEnd\TaskBuilderTestTask.cs (2)
1238return GetType().GetProperty(property.Name).GetValue(this, null); 1251GetType().GetProperty(property.Name).SetValue(this, value, null);
BackEnd\TaskHost_Tests.cs (4)
460string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ExpectedEventToBeSerializable", e.GetType().Name); 479string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ExpectedEventToBeSerializable", e.GetType().Name); 499string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ExpectedEventToBeSerializable", e.GetType().Name); 519string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ExpectedEventToBeSerializable", e.GetType().Name);
BuildEventArgsSerialization_Tests.cs (1)
1246Assert.Equal(typeof(T), deserializedArgs.GetType());
Construction\ElementLocation_Tests.cs (11)
45Assert.Contains("RegularElementLocation", location.GetType().FullName); 58Assert.Contains("RegularElementLocation", location.GetType().FullName); 71Assert.Contains("RegularElementLocation", location.GetType().FullName); 172Assert.Contains("RegularElementLocation", location.GetType().FullName); 190Assert.Contains("SmallElementLocation", deserializedLocation.GetType().FullName); 203Assert.Contains("SmallElementLocation", location.GetType().FullName); 248Assert.Contains("SmallElementLocation", location.GetType().FullName); 261Assert.Contains("SmallElementLocation", location.GetType().FullName); 274Assert.Contains("SmallElementLocation", location.GetType().FullName); 292Assert.Contains("SmallElementLocation", location.GetType().FullName); 432foreach (var property in node.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
Evaluation\EvaluationLogging_Tests.cs (2)
132allBuildEvents[0].GetType().ShouldBe(typeof(ProjectEvaluationStartedEventArgs)); 133allBuildEvents[1].GetType().ShouldBe(typeof(ProjectEvaluationFinishedEventArgs));
Instance\ProjectPropertyInstance_Internal_Tests.cs (2)
67Assert.Equal(typeof(ProjectPropertyInstance), property.GetType()); 86Assert.Equal("Microsoft.Build.Execution.ProjectPropertyInstance+ProjectPropertyInstanceImmutable", property.GetType().ToString());
TerminalLogger_Tests.cs (1)
86logger.GetType().ShouldBe(expectedType);
Microsoft.Build.Framework (11)
BinaryTranslator.cs (1)
496Type enumType = value.GetType();
BuildEventContext.cs (2)
254if (GetType() != obj.GetType())
ImmutableSegmentedList`1+ValueBuilder.cs (1)
76throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
LazyFormattedBuildEventArgs.cs (2)
196if (param != null && param.ToString() == param.GetType().FullName) 198throw new InvalidOperationException($"Invalid type for message formatting argument, was {param.GetType().FullName}");
SegmentedArray.cs (1)
135if (typeof(T[]) != destinationArray.GetType() && destinationArray.Rank != 1)
SegmentedDictionary`2.cs (1)
117if (dictionary.GetType() == typeof(SegmentedDictionary<TKey, TValue>))
Traits.cs (3)
587if (string.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal) && 588param.GetType() != typeof(string)) 591param.GetType().FullName);
Microsoft.Build.Framework.UnitTests (3)
ResourceUtilities.cs (3)
435if (string.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal) && 436param.GetType() != typeof(string)) 440param.GetType().FullName);
Microsoft.Build.Tasks.CodeAnalysis (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.Build.Tasks.Core (18)
AssignProjectConfiguration.cs (1)
244Log.LogErrorWithCodeFromResources("General.ErrorExecutingTask", GetType().Name, e.Message);
ErrorUtilities.cs (2)
105if (String.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal)) 107ThrowInternalError("This type does not implement ToString() properly {0}", param.GetType().FullName!);
GenerateManifestBase.cs (1)
463if (manifestType != _manifest.GetType())
GenerateResource.cs (1)
3814_logger.LogErrorWithCodeFromResources(null, fileName, 0, 0, 0, 0, "GenerateResource.OnlyStringsSupported", key, v?.GetType().FullName);
ManifestUtil\ManifestReader.cs (2)
195if (m.GetType() == typeof(ApplicationManifest)) 211n = m.GetType().Name;
ManifestUtil\ManifestWriter.cs (3)
25var s = new XmlSerializer(manifest.GetType()); 99n = manifest.GetType().Name; 116if (manifest.GetType() == typeof(ApplicationManifest))
ResolveNonMSBuildProjectOutput.cs (1)
148Log.LogErrorWithCodeFromResources("General.ErrorExecutingTask", this.GetType().Name, e.Message);
ResourceHandling\LiveObjectResource.cs (2)
24public string TypeAssemblyQualifiedName => Value.GetType().AssemblyQualifiedName; 26public string TypeFullName => Value.GetType().FullName;
ResourceUtilities.cs (3)
435if (string.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal) && 436param.GetType() != typeof(string)) 440param.GetType().FullName);
System.Design.cs (1)
101_resources = new MainAssemblyFallbackResourceManager("System.Design", this.GetType().Assembly);
system.design\stronglytypedresourcebuilder.cs (1)
125? new ResourceData(liveObject.Value.GetType(), liveObject.Value.ToString())
Microsoft.Build.Tasks.UnitTests (1)
ResourceHandling\GenerateResource_Tests.cs (1)
4173return o.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic);
Microsoft.Build.UnitTests.Shared (3)
BuildEventArgsExtension.cs (2)
38if (args.GetType() != other.GetType())
MockLogger.cs (1)
310string msg = eventArgs.Message ?? $"(null message in {eventArgs.GetType().Name} event)";
Microsoft.Build.Utilities.Core (10)
ErrorUtilities.cs (2)
105if (String.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal)) 107ThrowInternalError("This type does not implement ToString() properly {0}", param.GetType().FullName!);
ResourceUtilities.cs (3)
435if (string.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal) && 436param.GetType() != typeof(string)) 440param.GetType().FullName);
TaskLoggingHelper.cs (3)
56TaskName = taskInstance.GetType().Name; 277Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 472Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
ToolTask.cs (2)
643LogPrivate.LogWarningWithCodeFromResources("ToolTask.CommandTooLong", GetType().Name); 1354LogPrivate.LogErrorWithCodeFromResources("ToolTask.ValidateParametersFailed", this.GetType().FullName);
Microsoft.Cci.Extensions (6)
Differs\Differences.cs (1)
36return obj.GetType().Name;
Extensions\DocIdExtensions.cs (1)
83Contract.Assert(false, string.Format("Fell through cases in TypeExtensions.RefDocId() Type of reference: {0}", reference.GetType()));
Extensions\TypeExtensions.cs (3)
151throw new NotSupportedException(string.Format("Unknown IReference '{0}' so we cannot get assembly reference!", reference.GetType().FullName)); 263Contract.Assert(false, String.Format("Fell through cases in TypeExtensions.FullName() Type of reference: {0}", reference.GetType())); 418string.Format("Unexpected type reference that we may need to unwrap {0}", (reference != null ? reference.GetType().FullName : "null")));
Writers\CSharp\CSDeclarationWriter.Enums.cs (1)
186throw new ArgumentException($"Unsupported type {value.GetType()}", nameof(value));
Microsoft.CodeAnalysis (92)
Binding\BindingDiagnosticBag.cs (1)
67Debug.Assert(diagnosticBag?.GetType().IsValueType != true);
CodeGen\MetadataConstant.cs (2)
34Debug.Assert(value == null || value is string || value is DateTime || value is decimal || value.GetType().GetTypeInfo().IsEnum || (value.GetType().GetTypeInfo().IsPrimitive && !(value is IntPtr) && !(value is UIntPtr)));
Collections\Rope.cs (3)
145throw ExceptionUtilities.UnexpectedValue(v.GetType().Name); 177throw ExceptionUtilities.UnexpectedValue(v.GetType().Name); 201throw ExceptionUtilities.UnexpectedValue(v.GetType().Name);
CommandLine\ReportAnalyzerUtil.cs (1)
82.GroupBy(kvp => kvp.Key.GetType().Assembly)
Compilation\Compilation.cs (1)
686throw new ArgumentException(string.Format(CodeAnalysisResources.ReferenceOfTypeIsInvalid1, reference.GetType()),
Compilation\DeterministicKeyBuilder.cs (7)
178WriteType(writer, analyzer.GetType()); 500WriteType(writer, "syntaxTreeOptionsProvider", options.SyntaxTreeOptionsProvider?.GetType()); 501WriteType(writer, "metadataReferenceResolver", options.MetadataReferenceResolver?.GetType()); 502WriteType(writer, "xmlReferenceResolver", options.XmlReferenceResolver?.GetType()); 503WriteType(writer, "sourceReferenceResolver", options.SourceReferenceResolver?.GetType()); 504WriteType(writer, "strongNameProvider", options.StrongNameProvider?.GetType()); 505WriteType(writer, "assemblyIdentityComparer", options.AssemblyIdentityComparer?.GetType());
ConstantValue.cs (1)
812return String.Format("{0}({1}: {2})", this.GetType().Name, valueToDisplay, this.Discriminator);
Diagnostic\DiagnosticInfo.cs (5)
108var type = arg.GetType(); 169Debug.Assert(this.GetType() == result.GetType()); 414other.GetType() == this.GetType())
Diagnostic\DiagnosticWithInfo.cs (2)
164if (other == null || this.GetType() != other.GetType())
Diagnostic\Location.cs (1)
139string result = this.GetType().Name;
DiagnosticAnalyzer\AnalysisContextInfo.cs (1)
115sb.AppendLine($"{nameof(SyntaxNode)}: {GetFlattenedNodeText(_node)} [{_node.GetType().Name}]@{_node.Span} {(lineSpan.HasValue ? lineSpan.Value.ToString() : string.Empty)}");
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1739throw new InvalidOperationException("Unexpected compilation event of type " + compilationEvent.GetType().Name);
DiagnosticAnalyzer\AnalyzerFileReference.cs (3)
431public bool Equals(TExtension? x, TExtension? y) => object.Equals(x?.GetType(), y?.GetType()); 433public int GetHashCode(TExtension obj) => obj.GetType().GetHashCode();
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (1)
1093throw ExceptionUtilities.UnexpectedValue(compilationEvent.GetType().ToString());
DiagnosticAnalyzer\DiagnosticAnalyzer.cs (1)
35return this.GetType().ToString();
Operations\Operation.cs (1)
192private string GetDebuggerDisplay() => $"{GetType().Name} Type: {(Type is null ? "null" : Type)}";
PEWriter\MetadataWriter.cs (1)
1731metadata.GetType().GetField("_customAttributeTableNeedsSorting", BindingFlags.Instance | BindingFlags.NonPublic)!.SetValue(metadata, false);
PEWriter\MetadataWriter.PortablePdb.cs (14)
247Debug.Assert(!value.GetType().GetTypeInfo().IsEnum); 252if (value.GetType() == typeof(int)) 257if (value.GetType() == typeof(string)) 262if (value.GetType() == typeof(bool)) 267if (value.GetType() == typeof(char)) 272if (value.GetType() == typeof(byte)) 277if (value.GetType() == typeof(long)) 282if (value.GetType() == typeof(double)) 287if (value.GetType() == typeof(short)) 292if (value.GetType() == typeof(ushort)) 297if (value.GetType() == typeof(uint)) 302if (value.GetType() == typeof(sbyte)) 307if (value.GetType() == typeof(ulong)) 312if (value.GetType() == typeof(float))
ReferenceManager\AssemblyData.cs (1)
72private string GetDebuggerDisplay() => $"{GetType().Name}: [{Identity.GetDisplayName()}]";
SourceFileResolver.cs (2)
127if (obj == null || GetType() != obj.GetType())
SourceGeneration\GeneratorExtensions.cs (4)
27return igw.Generator.GetType(); 29return generator.GetType(); 41return adaptor.SourceGenerator.GetType(); 43return generator.GetType();
SpecialTypeExtensions.cs (16)
281if (value.GetType() == typeof(int)) 286if (value.GetType() == typeof(string)) 291if (value.GetType() == typeof(bool)) 296if (value.GetType() == typeof(char)) 301if (value.GetType() == typeof(long)) 306if (value.GetType() == typeof(double)) 311if (value.GetType() == typeof(uint)) 316if (value.GetType() == typeof(ulong)) 321if (value.GetType() == typeof(float)) 326if (value.GetType() == typeof(decimal)) 331if (value.GetType() == typeof(short)) 336if (value.GetType() == typeof(ushort)) 341if (value.GetType() == typeof(DateTime)) 346if (value.GetType() == typeof(byte)) 351if (value.GetType() == typeof(sbyte)) 375Debug.Assert(value.GetType().IsPrimitive);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
100throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
66throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
76throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
141if (typeof(T[]) != destinationArray.GetType() && destinationArray.Rank != 1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
154if (enumerable.GetType() == typeof(SegmentedDictionary<TKey, TValue>)) 198else if (enumerable.GetType() == typeof(List<KeyValuePair<TKey, TValue>>))
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
StrongName\DesktopStrongNameProvider.cs (2)
272if (obj is null || GetType() != obj.GetType())
StrongName\StrongNameFileSystem.cs (2)
56return this.GetType() == other?.GetType() && StringComparer.Ordinal.Equals(_signingTempPath, other?._signingTempPath);
Symbols\TypedConstantValue.cs (2)
25Debug.Assert(value == null || value is string || value.GetType().GetTypeInfo().IsEnum || (value.GetType().GetTypeInfo().IsPrimitive && !(value is System.IntPtr) && !(value is System.UIntPtr)) || value is ITypeSymbol);
Syntax\GreenNode.cs (1)
23return this.GetType().Name + " " + this.KindText + " " + this.ToString();
Syntax\SyntaxNode.cs (1)
53return GetType().Name + " " + KindText + " " + ToString();
Syntax\SyntaxNodeOrToken.cs (1)
68return GetType().Name + " " + KindText + " " + ToString();
Syntax\SyntaxToken.cs (1)
47return GetType().Name + " " + (Node != null ? Node.KindText : "None") + " " + ToString();
Syntax\SyntaxTrivia.cs (1)
43return GetType().Name + " " + (UnderlyingNode?.KindText ?? "None") + " " + ToString();
Text\TextChange.cs (1)
54return string.Format("{0}: {{ {1}, \"{2}\" }}", this.GetType().Name, Span, NewText);
TreeDumper.cs (1)
189var ti = o.GetType().GetTypeInfo();
XmlFileResolver.cs (2)
93if (obj == null || GetType() != obj.GetType())
Microsoft.CodeAnalysis.Analyzers (7)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
40throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (1)
68throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IUtf8StringOperationWrapper.cs (1)
39throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (1)
55var type = analyzerConfigOptions.GetType();
Microsoft.CodeAnalysis.AnalyzerUtilities (9)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
40throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (1)
68throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IUtf8StringOperationWrapper.cs (1)
39throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (1)
55var type = analyzerConfigOptions.GetType();
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\CacheBasedEquatable.cs (2)
55|| GetType() != otherEquatable.GetType()
Microsoft.CodeAnalysis.BannedApiAnalyzers (7)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
40throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (1)
68throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IUtf8StringOperationWrapper.cs (1)
39throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (1)
55var type = analyzerConfigOptions.GetType();
Microsoft.CodeAnalysis.CodeStyle (46)
src\Compilers\Core\Portable\SpecialTypeExtensions.cs (16)
281if (value.GetType() == typeof(int)) 286if (value.GetType() == typeof(string)) 291if (value.GetType() == typeof(bool)) 296if (value.GetType() == typeof(char)) 301if (value.GetType() == typeof(long)) 306if (value.GetType() == typeof(double)) 311if (value.GetType() == typeof(uint)) 316if (value.GetType() == typeof(ulong)) 321if (value.GetType() == typeof(float)) 326if (value.GetType() == typeof(decimal)) 331if (value.GetType() == typeof(short)) 336if (value.GetType() == typeof(ushort)) 341if (value.GetType() == typeof(DateTime)) 346if (value.GetType() == typeof(byte)) 351if (value.GetType() == typeof(sbyte)) 375Debug.Assert(value.GetType().IsPrimitive);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
100throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
66throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
76throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
141if (typeof(T[]) != destinationArray.GetType() && destinationArray.Rank != 1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
154if (enumerable.GetType() == typeof(SegmentedDictionary<TKey, TValue>))
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
18var typeString = analyzer.GetType().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ObjectExtensions.cs (1)
10=> obj == null ? "null" : obj.GetType().Name;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\ChainedFormattingRules.cs (1)
104(obj.GetType(), name),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (19)
183Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 191var type = value.GetType(); 206if (value.GetType() == typeof(int)) 210else if (value.GetType() == typeof(double)) 215else if (value.GetType() == typeof(bool)) 219else if (value.GetType() == typeof(char)) 224else if (value.GetType() == typeof(byte)) 229else if (value.GetType() == typeof(short)) 234else if (value.GetType() == typeof(long)) 239else if (value.GetType() == typeof(sbyte)) 244else if (value.GetType() == typeof(float)) 249else if (value.GetType() == typeof(ushort)) 254else if (value.GetType() == typeof(uint)) 258else if (value.GetType() == typeof(ulong)) 265throw ExceptionUtilities.UnexpectedValue(value.GetType()); 268else if (value.GetType() == typeof(decimal)) 273else if (value.GetType() == typeof(DateTime)) 278else if (value.GetType() == typeof(string)) 284throw new InvalidOperationException($"Unsupported object type: {value.GetType()}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (2)
129if (existingConstants[0].Equals(Convert.ChangeType(2, existingConstants[0].GetType())) && 130existingConstants[1].Equals(Convert.ChangeType(1, existingConstants[1].GetType())))
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
166string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_but_given_one_is_1, typeof(TDeclarationNode).Name, destination.GetType().Name), 185typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, destination.GetType().Name), 206typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, destination.GetType().Name), 224typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, typeof(TDeclarationNode4).Name, destination.GetType().Name),
Microsoft.CodeAnalysis.Collections.Package (6)
Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
100throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
66throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
76throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
Segmented\SegmentedArray.cs (1)
141if (typeof(T[]) != destinationArray.GetType() && destinationArray.Rank != 1)
Segmented\SegmentedDictionary`2.cs (1)
154if (enumerable.GetType() == typeof(SegmentedDictionary<TKey, TValue>))
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.CodeAnalysis.Contracts.Package (1)
ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.CodeAnalysis.CSharp (23)
Binder\Binder.cs (1)
958var description = scope.GetType().Name;
Binder\DecisionDagBuilder.cs (3)
2369this == obj || obj is SequenceTests other && this.GetType() == other.GetType() && RemainingTests.SequenceEqual(other.RemainingTests); 2373int value = Hash.Combine(length, this.GetType().GetHashCode());
BoundTree\BoundNode.cs (1)
427var result = GetType().Name;
BoundTree\Formatting.cs (1)
21RoslynDebug.Assert(this.Type is { }, $"Unexpected null type in {this.GetType().Name}");
FlowAnalysis\AbstractFlowPass.cs (1)
896RoslynDebug.Assert(false, $"Should Visit{node.Kind} be overridden in {this.GetType().Name}?");
FlowAnalysis\DefiniteAssignment.cs (3)
187_shouldCheckConverted = this.GetType() == typeof(DefiniteAssignmentPass); 206_shouldCheckConverted = this.GetType() == typeof(DefiniteAssignmentPass); 228_shouldCheckConverted = this.GetType() == typeof(DefiniteAssignmentPass);
FlowAnalysis\NullableWalker.cs (2)
496return $"{{{GetType().Name} WhenTrue:{Dump(StateWhenTrue)} WhenFalse:{Dump(StateWhenFalse)}{"}"}"; 500return $"{{{GetType().Name} {Dump(State)}{"}"}";
SymbolDisplay\ObjectDisplay.cs (1)
45Type type = obj.GetType();
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
897return value.GetType().GetTypeInfo().IsPrimitive || value is string || value is decimal;
SymbolDisplay\SymbolDisplayVisitor_Constants.cs (1)
44Debug.Assert(value.GetType().GetTypeInfo().IsPrimitive || value is string || value is decimal);
Symbols\AbstractTypeParameterMap.cs (1)
42result.Append(this.GetType().Name);
Symbols\ReferenceManager.cs (1)
90throw new NotSupportedException(string.Format(CSharpResources.CantReferenceCompilationOf, compilationReference.GetType(), "C#"));
Syntax\InternalSyntax\SyntaxToken.cs (2)
364System.Diagnostics.Debug.Assert(this.GetType() == typeof(SyntaxToken)); 370System.Diagnostics.Debug.Assert(this.GetType() == typeof(SyntaxToken));
Utilities\ValueSetFactory.NumericValueSet.cs (4)
165Debug.Assert(this._tc.GetType() == other._tc.GetType()); 242Debug.Assert(this._tc.GetType() == other._tc.GetType());
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
30/// value would cause a different type to be seen in a <see cref="System.Object.GetType()"/> call,
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
107var asyncToken = asyncListener.BeginAsyncOperation(GetType().Name + ".Start");
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
CommentSelection\CSharpToggleBlockCommentCommandHandlerTests.cs (1)
245.First(export => typeof(CSharpToggleBlockCommentCommandHandler).Equals(export.GetType()));
CommentSelection\CSharpToggleLineCommentCommandHandlerTests.cs (1)
1134.First(export => typeof(ToggleLineCommentCommandHandler).Equals(export.GetType()));
Completion\ArgumentProviders\ArgumentProviderOrderTests.cs (1)
31var actualOrder = orderedCSharpArgumentProviders.Select(x => x.Value.GetType()).ToArray();
Completion\CompletionProviders\CompletionProviderOrderTests.cs (1)
32var actualOrder = orderedCSharpCompletionProviders.Select(x => x.Value.GetType()).ToArray();
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\KeywordRecommenderTests.cs (1)
43var name = GetType().Name;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (14)
CodeGen\CodeGenTupleTest.cs (14)
12793Assert.Equal("TupleElementFieldSymbol", m1Item1.GetType().Name); 12812Assert.Equal("TupleElementFieldSymbol", m2Item1.GetType().Name); 12834Assert.Equal("TupleVirtualElementFieldSymbol", m2a2.GetType().Name); 28074Assert.Equal(module is SourceModuleSymbol ? "SourceNamedTypeSymbol" : "PENamedTypeSymbolGeneric", type.GetType().Name); 28136return s.GetType().Name + ": " + s.ToTestDisplayString(); 28178return s.GetType().Name + ": " + s.ToTestDisplayString(); 28252namedType.GetType().Name); 28762Assert.Equal(isSourceSymbol ? "SourceMemberFieldSymbolFromDeclarator" : "PEFieldSymbol", underlying.GetType().Name); 28773Assert.Equal("SubstitutedFieldSymbol", underlying.GetType().Name); 28781return fields.Select(s => s.GetType().Name + ": " + s.Name); 28786return s.GetType().Name + ": " + s.ToTestDisplayString(); 28933Assert.Equal("SubstitutedFieldSymbol", underlying.GetType().Name); 28941return fields.Select(s => s.GetType().Name + ": " + s.Name); 28946return s.GetType().Name + ": " + s.ToTestDisplayString();
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (1)
src\Compilers\CSharp\Portable\SymbolDisplay\ObjectDisplay.cs (1)
45Type type = obj.GetType();
Microsoft.CodeAnalysis.CSharp.Features (2)
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (2)
50yield return KeyValuePairUtil.Create((helper, useExpressionBody: true), helper.GetType().Name + "_UseExpressionBody"); 51yield return KeyValuePairUtil.Create((helper, useExpressionBody: false), helper.GetType().Name + "_UseBlockBody");
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_IConversionExpression.cs (2)
5407throw new ArgumentException($"Cannot handle syntax of type {syntax.GetType()}"); 5432throw new ArgumentException($"Cannot handle arguments of type {operation.GetType()}");
Microsoft.CodeAnalysis.CSharp.Scripting (1)
CSharpScript.cs (1)
100return Create<T>(code, options, globalsType ?? globals?.GetType()).RunAsync(globals, cancellationToken);
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
InteractiveSessionReferencesTests.cs (1)
456Assert.Equal(s0.Result.ReturnValue.GetType(), s1.Result.ReturnValue);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (6)
InteractiveSessionTests.cs (5)
245Assert.True(e.GetType().GetTypeInfo().IsEnum, "Expected enum"); 246Assert.Equal(typeof(int), Enum.GetUnderlyingType(e.GetType())); 2033", options: ScriptOptions, globalsType: globals.GetType()); 2067", options: ScriptOptions, globalsType: globals.GetType()); 2101", options: ScriptOptions, globalsType: globals.GetType());
ScriptTests.cs (1)
395globalsType: globals.GetType()).
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (9)
Semantics\SyntaxTreeRootTests.cs (2)
44Assert.Equal(typeof(CompilationUnitSyntax), tree.GetRoot().GetType()); 54Assert.NotEqual(typeof(CompilationUnitSyntax), root.GetType());
SourceGeneration\GeneratorDriverTests.cs (7)
537Path.Combine(generator.GetType().Assembly.GetName().Name!, generator.GetType().FullName!, "source.cs"), 538Path.Combine(generator2.GetType().Assembly.GetName().Name!, generator2.GetType().FullName!, "source.cs") 3353MetadataReference.CreateFromAssemblyInternal(this.GetType().Assembly), 4394Assert.Same(generator.GetType(), type); 4416Assert.Same(generator.GetType(), type);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (50)
Compilation\SymbolVisitorTests.cs (46)
41_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 46_output.Append(symbol.GetType().Name + " of "); 52_output.Append(symbol.GetType().Name + " of "); 58_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 76_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 83_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 100_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 109_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 119_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 127_output.Append(symbol.GetType().Name + " " + symbol.Name); 138_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 146_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 153_output.Append(symbol.GetType().Name + " of "); 164_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 178_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 182_output.Append(symbol.GetType().Name + " " + symbol.Name); 209_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 215_output.Append(symbol.GetType().Name + " of "); 222_output.Append(symbol.GetType().Name + " of "); 229_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 250_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 258_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 278_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 288_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 299_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 307_output.Append(symbol.GetType().Name + " " + symbol.Name); 319_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 328_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 336_output.Append(symbol.GetType().Name + " of "); 349_output.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 365_output.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 369_output.Append(symbol.GetType().Name + " " + symbol.Name); 392argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 401argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 410argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 421argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 429argument.Append(symbol.GetType().Name + " " + symbol.Name); 441argument.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 449argument.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 457argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 467argument.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name + ": "); 481argument.Append(symbol.GetType().Name + " of "); 488argument.Append(symbol.GetType().Name + " of "); 500argument.Append(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 515argument.AppendLine(new string(' ', 2 * _indent) + symbol.GetType().Name + " " + symbol.Name); 519argument.Append(symbol.GetType().Name + " " + symbol.Name);
Symbols\Source\EnumTests.cs (1)
997if (first != null && first.GetType() == typeof(long))
Symbols\TypeTests.cs (3)
627Assert.False(f1 is ErrorTypeSymbol, f1.GetType().ToString() + " : " + f1.ToTestDisplayString()); 644Assert.False(objType is ErrorTypeSymbol, objType.GetType().ToString() + " : " + objType.ToTestDisplayString()); 652Assert.False(dynType is ErrorTypeSymbol, dynType.GetType().ToString() + " : " + dynType.ToTestDisplayString()); // this is ok
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (28)
LexicalAndXml\XmlDocCommentTests.cs (28)
1723Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[2].GetStructure().GetType()); 1757Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1758Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[3].GetStructure().GetType()); 1799Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1800Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[3].GetStructure().GetType()); 1832Assert.Equal(typeof(MethodDeclarationSyntax), (tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0].GetType()); 1842Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1867Assert.Equal(typeof(MethodDeclarationSyntax), (tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0].GetType()); 1877Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1902Assert.Equal(typeof(PropertyDeclarationSyntax), (tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0].GetType()); 1912Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1937Assert.Equal(typeof(IndexerDeclarationSyntax), (tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0].GetType()); 1947Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1972Assert.Equal(typeof(MethodDeclarationSyntax), (tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0].GetType()); 1984Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2009Assert.Equal(typeof(ClassDeclarationSyntax), tree.GetCompilationUnitRoot().Members[0].GetType()); 2020Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2047Assert.Equal(typeof(MethodDeclarationSyntax), (tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0].GetType()); 2058Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2090Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2124Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2155Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2185Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[2].GetStructure().GetType()); 2217Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2641Assert.Equal(typeof(XmlElementSyntax), doc.Content[0].GetType()); 3358if (element.GetType() == typeof(XmlElementSyntax)) 3362else if (element.GetType() == typeof(XmlTextSyntax)) 3366else if (element.GetType() == typeof(XmlCDataSectionSyntax))
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Extensions.cs (1)
548if (!o.GetType().IsArray)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdDumpTest.cs (2)
318if (value.GetType() == typeof(string)) 324else if (value.GetType() == typeof(bool))
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
30/// value would cause a different type to be seen in a <see cref="System.Object.GetType()"/> call,
Microsoft.CodeAnalysis.EditorFeatures (19)
Adornments\AbstractAdornmentManager.cs (4)
107using (_asyncListener.BeginAsyncOperation(GetType() + ".OnLayoutChanged")) 153using (_asyncListener.BeginAsyncOperation(GetType().Name + ".OnTagsChanged.1")) 184using (_asyncListener.BeginAsyncOperation(GetType() + ".OnTagsChanged.2")) 201using (_asyncListener.BeginAsyncOperation(GetType().Name + ".UpdateInvalidSpans.1"))
artifacts\obj\Microsoft.CodeAnalysis.EditorFeatures\Release\net472\GeneratedInternalTypeHelper.g.cs (1)
47return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
Classification\Syntactic\SyntacticClassificationTaggerProvider.Tagger.cs (1)
29var tagComputer = _tagComputer ?? throw new ObjectDisposedException(GetType().FullName);
Editor\EditorLayerExtensionManager.cs (3)
62var providerType = provider.GetType(); 113Log(functionId, $"Name: {provider.GetType().FullName} Assembly Version: {provider.GetType().Assembly.GetName().Version}");
LanguageServer\AbstractInProcLanguageClient.cs (1)
219var serverTypeName = languageClient.GetType().Name;
Lightup\ISmartRenameSessionFactoryWrapper.cs (1)
43throw new InvalidCastException($"Cannot cast '{instance.GetType().FullName}' to '{WrappedTypeName}'");
Lightup\ISmartRenameSessionWrapper.cs (1)
115throw new InvalidCastException($"Cannot cast '{instance.GetType().FullName}' to '{WrappedTypeName}'");
Lightup\LightupHelpers.cs (3)
34if (!wrappedObject.TryGetValue(obj.GetType(), out var canCast)) 36canCast = underlyingType.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo()); 37wrappedObject.TryAdd(obj.GetType(), canCast);
RenameTracking\RenameTrackingTaggerProvider.cs (1)
78text.Container.GetType().FullName));
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (2)
77_asyncListener.BeginAsyncOperation(GetType().Name + ".UpdateTrackingSessionAfterIsRenamableIdentifierTask")); 110_asyncListener.BeginAsyncOperation($"{GetType().Name}.{nameof(QueueUpdateToStateMachine)}"));
Structure\InvalidOutliningRegionException.cs (1)
20=> $"OutliningService({service.GetType()}) produced an invalid region. ITextSnapshot span is {snapshotSpan}. OutliningSpan is {regionSpan}.";
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (7)
Options\OptionSerializerTests.cs (4)
80VerifyEnumValues(option, defaultValue.GetType(), allowsPacalCase: true, allowsSnakeCase: false); 83VerifyEnumInvalidParse(option, defaultValue.GetType()); 133VerifyEnumValues(option, defaultValue.GetType(), allowsPacalCase: true, allowsSnakeCase: true); 136VerifyEnumInvalidParse(option, defaultValue.GetType());
QuickInfo\ToolTipAssert.cs (2)
25Assert.IsType(expected.GetType(), actual); 125result.Append($"{indent}New {element.GetType().Name}(");
SignatureHelp\AbstractSignatureHelpProviderTests.cs (1)
383var signatureHelpProvider = workspace.ExportProvider.GetExportedValues<ISignatureHelpProvider>().Single(provider => provider.GetType() == signatureHelpProviderType);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (2)
Intellisense\TestState.vb (2)
81Single(Function(e As ICompletionPresenterProvider) e.GetType().FullName = "Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense.MockCompletionPresenterProvider") 83Single(Function(e As ICommandHandler) e.GetType().Name = PredefinedCompletionNames.CompletionCommandHandler)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (7)
CodeFixes\CodeFixServiceTests.cs (1)
611=> Messages.Add(source.GetType().Name, ToLogFormat(exception));
CodeRefactorings\CodeRefactoringServiceTest.cs (2)
280.Where(p => p.GetType().Assembly == assembly) 285Assert.Contains(actualProviders, p => p.GetType() == type);
CommentSelection\ToggleBlockCommentCommandHandlerTests.cs (1)
1504.First(export => typeof(ToggleBlockCommentCommandHandler).Equals(export.GetType()));
Options\GlobalOptionsTests.cs (3)
106Assert.Equal(options.GetType(), defaultOptions.GetType()); 107Recurse(options.GetType(), options, defaultOptions, language);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (2)
143New AnalyzerFileReference(DiagnosticExtensions.GetCompilerDiagnosticAnalyzer(LanguageNames.CSharp).GetType().Assembly.Location, TestAnalyzerAssemblyLoader.LoadFromFile), 144New AnalyzerFileReference(DiagnosticExtensions.GetCompilerDiagnosticAnalyzer(LanguageNames.VisualBasic).GetType().Assembly.Location, TestAnalyzerAssemblyLoader.LoadFromFile)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (2)
ExpressionEvaluatorFatalError.cs (2)
31var openSubKeyMethod = currentUserKey.GetType().GetTypeInfo().GetDeclaredMethod("OpenSubKey", [typeof(string), typeof(bool)]); 36var getValueMethod = eeKey.GetType().GetTypeInfo().GetDeclaredMethod("GetValue", [typeof(string)]);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (3)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\ExpressionEvaluatorFatalError.cs (2)
31var openSubKeyMethod = currentUserKey.GetType().GetTypeInfo().GetDeclaredMethod("OpenSubKey", [typeof(string), typeof(bool)]); 36var getValueMethod = eeKey.GetType().GetTypeInfo().GetDeclaredMethod("GetValue", [typeof(string)]);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (19)
Debugger\Engine\DkmClrValue.cs (8)
104var valueType = new DkmClrType(this.Type.RuntimeInstance, (value == null || elementType.IsPointer) ? elementType : (TypeImpl)value.GetType()); 310DkmClrType.Create(appDomain, (TypeImpl)((fieldValue == null) ? field.FieldType : fieldValue.GetType())), 324DkmClrType.Create(appDomain, (TypeImpl)((propertyValue == null) ? property.PropertyType : propertyValue.GetType())), 346DkmClrType.Create(appDomain, (TypeImpl)((methodValue == null) ? method.ReturnType : methodValue.GetType())), 436var valueType = runtime.GetType((TypeImpl)RawValue.GetType()); 534type = (TypeImpl)value.GetType(); 572var type = DkmClrType.Create(this.Type.AppDomain, (TypeImpl)((element == null) ? array.GetType().GetElementType() : element.GetType()));
Debugger\Engine\DkmDataContainer.cs (1)
39Guid key = item.GetType().GUID;
Debugger\MemberInfo\TypeImpl.cs (2)
113return o != null && o.GetType() == this.GetType() && ((TypeImpl)o).Type == this.Type;
ResultProviderTestBase.cs (5)
68type = value.GetType(); 119return FormatValue(value, value.GetType(), useHexadecimal); 136return HasUnderlyingString(value, value.GetType()); 147var clrValue = GetValueForUnderlyingString(value, value.GetType()); 484var enumTypeName = e.GetType().Name;
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\ExpressionEvaluatorFatalError.cs (2)
31var openSubKeyMethod = currentUserKey.GetType().GetTypeInfo().GetDeclaredMethod("OpenSubKey", [typeof(string), typeof(bool)]); 36var getValueMethod = eeKey.GetType().GetTypeInfo().GetDeclaredMethod("GetValue", [typeof(string)]);
Microsoft.CodeAnalysis.ExternalAccess.Extensions (5)
Internal\ExtensionMessageHandlerWrapper.cs (5)
24Name = handler.GetType().FullName; 43if ((message is null && MessageType.IsValueType) || (message is not null && !MessageType.IsAssignableFrom(message.GetType()))) 45throw new InvalidOperationException(string.Format(ExternalAccessExtensionsResources.The_message_type_0_is_not_assignable_to_1, message?.GetType().FullName ?? "null", MessageType.FullName)); 52if ((response is null && ResponseType.IsValueType) || (response is not null && !ResponseType.IsAssignableFrom(response.GetType()))) 54throw new InvalidOperationException(string.Format(ExternalAccessExtensionsResources.The_message_type_0_is_not_assignable_to_1, response?.GetType().FullName ?? "null", ResponseType.FullName));
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (2)
RazorAnalyzerAssemblyResolverTests.cs (2)
29InitialAssemblyCount = AssemblyLoadContext.GetLoadContext(this.GetType().Assembly)!.Assemblies.Count(); 37var count = AssemblyLoadContext.GetLoadContext(this.GetType().Assembly)!.Assemblies.Count();
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
Internal\XamlDiagnosticSource.cs (1)
23string IDiagnosticSource.ToDisplayString() => $"{this.GetType().Name}: {document.FilePath ?? document.Name} in {document.Project.Name}";
Microsoft.CodeAnalysis.Features (21)
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (1)
120else if (defaultValue.Value?.GetType() is Type t && t.IsEnum)
CodeFixes\RoslynAssemblyHelper.cs (1)
15=> source.GetType().GetTypeInfo().Assembly.GetName().GetPublicKey().SequenceEqual(
CodeFixes\Service\CodeFixService.cs (1)
873codeFixProvider.GetType().Name + "." + nameof(CodeFixProvider.FixableDiagnosticIds)));
Common\AbstractProjectExtensionProvider.cs (1)
124var typeInfo = extension.GetType().GetTypeInfo();
Completion\ArgumentProvider.cs (1)
14=> Name = GetType().FullName!;
Completion\CompletionProvider.cs (1)
22=> Name = GetType().FullName!;
Completion\Providers\EmbeddedLanguageCompletionProvider.cs (1)
18Name = GetType().FullName!;
Diagnostics\DiagnosticAnalyzerExtensions.cs (2)
33var typeInfo = analyzer.GetType().GetTypeInfo(); 48=> analyzer.GetType().Assembly.GetName().Name ?? throw ExceptionUtilities.Unreachable();
Diagnostics\DiagnosticAnalyzerTelemetry.cs (1)
54_analyzerInfoMap = _analyzerInfoMap.SetItem(analyzer.GetType(), new Data(analyzerTelemetryInfo, isTelemetryCollectionAllowed));
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
311=> TryGetDisplayName(node, editKind) ?? throw ExceptionUtilities.UnexpectedValue(node.GetType().Name); 378throw ExceptionUtilities.UnexpectedValue(node.GetType().Name);
EditAndContinue\DeclarationBody.cs (2)
88GetType() == other?.GetType() && RootNodes.SequenceEqual(other.RootNodes);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingWorkItem.cs (1)
166=> $"{DocumentId?.ToString() ?? ProjectId.ToString()}, ({InvocationReasons}), LowPriority:{IsLowPriority}, ActiveMember:{ActiveMember != null}, Retry:{IsRetry}, ({string.Join("|", SpecificAnalyzers.Select(a => a.GetType().Name))})";
ExtractInterface\AbstractExtractInterfaceService.cs (1)
169default: throw new InvalidOperationException($"Unable to extract interface for operation of type {extractInterfaceOptions.GetType()}");
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
122var type = codeAction.GetType();
MetadataAsSource\MetadataAsSourceFileService.cs (1)
107var providerTempPath = Path.Combine(_rootTemporaryPathWithGuid, provider.GetType().Name);
Organizing\AbstractOrganizingService.cs (1)
42return n => map.GetOrAdd(n.GetType(), getter);
Structure\Syntax\BlockSpanCollector.cs (1)
65if (_nodeProviderMap.TryGetValue(node.GetType(), out var providers))
Workspace\MiscellaneousFileUtilities.cs (1)
49var projectId = ProjectId.CreateNewId(debugName: $"{workspace.GetType().Name} Files Project for {filePath}");
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
449Node ({newNode.GetType().Name}):
Microsoft.CodeAnalysis.InteractiveHost (7)
Interactive\Core\InteractiveHost.Service.cs (1)
665script = serviceState.ReplServiceProvider.CreateScript<object>(code, scriptOptions, serviceState.Globals.GetType(), serviceState.AssemblyLoader);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
100throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
66throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
76throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
141if (typeof(T[]) != destinationArray.GetType() && destinationArray.Rank != 1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
154if (enumerable.GetType() == typeof(SegmentedDictionary<TKey, TValue>))
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\ExtensionManager.cs (1)
20=> _logger.Log(LogLevel.Error, exception, $"{provider.GetType()} threw an exception.");
Microsoft.CodeAnalysis.LanguageServer.Protocol (23)
Handler\CodeActions\CodeActionResolveHelper.cs (1)
59logFunction($"Skipping code action operation for '{data.UniqueIdentifier}'. It was a '{option.GetType().FullName}'");
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (3)
110context.TraceInformation($"{this.GetType()}. Skipping due to {nameof(SolutionCrawlerRegistrationService.EnableSolutionCrawler)}={false}"); 118var handlerName = $"{this.GetType().Name}(category: {category})"; 215context.TraceInformation($"{this.GetType()} finished getting diagnostics");
Handler\Diagnostics\DiagnosticSourceProviders\DiagnosticSourceManager.cs (1)
148public string ToDisplayString() => $"{this.GetType().Name}: count={sources.Length}";
Handler\Diagnostics\DiagnosticSources\AbstractDocumentDiagnosticSource.cs (1)
32public string ToDisplayString() => $"{this.GetType().Name}: {Document.FilePath ?? Document.Name} in {Document.Project.Name}";
Handler\RelatedDocuments\RelatedDocumentsHandler.cs (2)
44context.TraceInformation($"{this.GetType()} started getting related documents"); 88context.TraceInformation($"{this.GetType()} finished getting related documents");
Handler\RequestContextFactory.cs (1)
68throw new InvalidOperationException($"{nameof(IMethodHandler)} implementation {methodHandler.GetType()} does not implement {nameof(ISolutionRequiredHandler)}");
Handler\SourceGenerators\SourceGeneratedDocumentCache.cs (1)
59return new SourceGeneratedDocumentCache(this.GetType().Name);
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (3)
40_versionedCache = new(this.GetType().Name); 65context.TraceInformation($"{this.GetType()} started getting spell checking spans"); 131context.TraceInformation($"{this.GetType()} finished getting spans");
LspServices\LspServices.cs (1)
176var handlerType = handler.GetType();
Protocol\Converters\NaturalObjectConverter.cs (1)
20var runtimeType = value.GetType();
Protocol\Extensions\Converters\VSExtensionUtilities.cs (1)
47var existingConverterType = converters[i].GetType();
Protocol\Internal\Converters\VSInternalExtensionUtilities.cs (1)
60var existingConverterType = converters[i].GetType();
Protocol\Internal\VSInternalLocation.cs (1)
39throw new InvalidOperationException($"{value?.GetType()} is an invalid type.");
Protocol\Internal\VSInternalReferenceItem.cs (2)
78throw new InvalidOperationException($"{value.GetType()} is an invalid type."); 166throw new InvalidOperationException($"{value?.GetType()} is an invalid type.");
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\HandlerProvider.cs (1)
80var handlerType = handler.GetType();
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\QueueItem.cs (1)
217throw new NotImplementedException($"Unrecognized {nameof(IMethodHandler)} implementation {handler.GetType()}.");
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
97var noValueType = NoValue.Instance.GetType();
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (9)
HandlerTests.cs (8)
324return Task.FromResult(this.GetType().Name); 346return Task.FromResult(this.GetType().Name); 363return Task.FromResult(this.GetType().Name); 378ResultSource.SetResult(this.GetType().Name); 408ResultSource.SetResult(this.GetType().Name); 446return Task.FromResult(this.GetType().Name); 470return Task.FromResult(this.GetType().Name); 489return Task.FromResult(this.GetType().Name);
LspServicesTests.cs (1)
93public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind) => new TestLspServiceFromFactory(this.GetType().Name);
Microsoft.CodeAnalysis.PooledObjects.Package (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.CodeAnalysis.PublicApiAnalyzers (5)
DeclarePublicApiAnalyzer.cs (3)
276var provider = analyzerOptions.GetType().GetRuntimeProperty("AnalyzerConfigOptionsProvider")?.GetValue(analyzerOptions); 282var getOptionsMethod = provider.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "GetOptions"); 289var tryGetValueMethod = options.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetValue");
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
Microsoft.CodeAnalysis.Rebuild.UnitTests (2)
RoundTripUtil.cs (2)
218var type = originalOptions.GetType(); 258var type = originalOptions.GetType();
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\BrokeredServiceBase.cs (1)
82=> TraceLogger.TraceEvent(errorType, 0, $"{GetType()}: {message}");
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
40throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (1)
68throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IUtf8StringOperationWrapper.cs (1)
39throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (1)
55var type = analyzerConfigOptions.GetType();
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Verifiers\CSharpSourceGeneratorVerifier`1+Test.cs (1)
95foreach (var name in GetType().Assembly.GetManifestResourceNames())
Verifiers\VisualBasicSourceGeneratorVerifier`1+Test.cs (1)
80foreach (var name in GetType().Assembly.GetManifestResourceNames())
Microsoft.CodeAnalysis.Scripting (14)
Hosting\CommandLine\CommandLineRunner.cs (3)
207var script = Script.CreateInitialScript<int>(_scriptCompiler, code, options, globals.GetType(), assemblyLoaderOpt: null); 233var script = Script.CreateInitialScript<object>(_scriptCompiler, SourceText.From(initialScriptCodeOpt), options, globals.GetType(), assemblyLoaderOpt: null); 285newScript = Script.CreateInitialScript<object>(_scriptCompiler, SourceText.From(code ?? string.Empty), options, globals.GetType(), assemblyLoaderOpt: null);
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (6)
94Type type = obj.GetType(); 257FormatObjectMembers(result, proxy ?? obj, obj.GetType().GetTypeInfo(), includeNonPublic, inlineMembers); 332var type = obj.GetType().GetTypeInfo(); 527TypeInfo type = obj.GetType().GetTypeInfo(); 543result.Append(_formatter.TypeNameFormatter.FormatArrayTypeName(array.GetType(), array, _typeNameOptions)); 547result.Append(_formatter.TypeNameFormatter.FormatTypeName(collection.GetType(), _typeNameOptions));
Hosting\ObjectFormatter\CommonPrimitiveFormatter.cs (1)
55var type = obj.GetType();
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (2)
108var type = obj.GetType().GetTypeInfo(); 136TypeInfo type = obj.GetType().GetTypeInfo();
Script.cs (1)
596var runtimeType = globals.GetType().GetTypeInfo();
ScriptState.cs (1)
106foreach (var field in state.GetType().GetTypeInfo().DeclaredFields)
Microsoft.CodeAnalysis.Scripting.TestUtilities (1)
TestRuntimeMetadataReferenceResolver.cs (1)
30string testDir = Path.GetDirectoryName(GetType().GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName);
Microsoft.CodeAnalysis.Test.Utilities (15)
Assert\TestExceptionUtilities.cs (1)
15string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Compilation\TestOperationVisitor.cs (1)
31throw new NotImplementedException(operation.GetType().ToString());
Diagnostics\DiagnosticDescription.cs (2)
92_errorCodeType = errorCodeType ?? code.GetType(); 117_errorCodeType = errorCodeType ?? code.GetType();
Diagnostics\DiagnosticExtensions.cs (1)
412return new AnalyzerImageReference(ImmutableArray.Create(analyzer), display: analyzer.GetType().FullName);
Diagnostics\OptionsDiagnosticAnalyzer.cs (1)
24Debug.Assert(expectedOptions.AnalyzerConfigOptionsProvider.GetType() == typeof(CompilerAnalyzerConfigOptionsProvider));
Mocks\TestDocumentationCommentProvider.cs (3)
18public override bool Equals(object obj) => obj != null && this.GetType() == obj.GetType(); 19public override int GetHashCode() => GetType().GetHashCode();
Platform\Custom\MetadataSignatureHelper.cs (1)
78if (value.GetType() == typeof(string))
Syntax\NodeHelpers.cs (3)
149var typeObject = node.GetType(); 160var typeObject = token.GetType(); 171var typeObject = trivia.GetType();
TestHelpers.cs (2)
52var valueType = value.GetType(); 123code.GetType(),
Microsoft.CodeAnalysis.Threading.Package (6)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
100throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
66throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
76throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
141if (typeof(T[]) != destinationArray.GetType() && destinationArray.Rank != 1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
154if (enumerable.GetType() == typeof(SegmentedDictionary<TKey, TValue>))
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.CodeAnalysis.UnitTests (63)
AnalyzerAssemblyLoaderTests.cs (28)
312a.GetType().GetMethod("Write")!.Invoke(a, new object[] { sb, "Test A" }); 317b.GetType().GetMethod("Write")!.Invoke(b, new object[] { sb, "Test B" }); 374var writeMethod = b.GetType().GetMethod("Write")!; 552var writeMethod = b.GetType().GetMethod("Write")!; 584var writeMethod = b.GetType().GetMethod("Write")!; 700var writeMethod = b.GetType().GetMethod("Write")!; 738var writeMethod = b.GetType().GetMethod("Write")!; 798g.GetType().GetMethod("Write")!.Invoke(g, new object[] { sb, "Test G" }); 802e.GetType().GetMethod("Write")!.Invoke(e, new object[] { sb, "Test E" }); 854e.GetType().GetMethod("Write")!.Invoke(e, new object[] { sb, "Test E" }); 913e.GetType().GetMethod("Write")!.Invoke(e, new object[] { sb, "Test E" }); 994e.GetType().GetMethod("Write")!.Invoke(e, new object[] { sb, "Test E" }); 1050e.GetType().GetMethod("Write")!.Invoke(e, new object[] { sb, "Test E" }); 1084g.GetType().GetMethod("Write")!.Invoke(g, new object[] { sb, "Test G" }); 1088e.GetType().GetMethod("Write")!.Invoke(e, new object[] { sb, "Test E" }); 1144g.GetType().GetMethod("Write")!.Invoke(g, new object[] { sb, "Test G" }); 1148var eWrite = e.GetType().GetMethod("Write")!; 1203var prop = a.GetType().GetProperty("Ran", BindingFlags.Public | BindingFlags.Instance); 1323g.GetType().GetMethod("Write")!.Invoke(g, new object[] { sb, "Test G" }); 1327e.GetType().GetMethod("Write")!.Invoke(e, new object[] { sb, "Test E" }); 1353delta1Instance.GetType().GetMethod("Write")!.Invoke(delta1Instance, new object[] { sb, "Test D1" }); 1357delta2Instance.GetType().GetMethod("Write")!.Invoke(delta2Instance, new object[] { sb, "Test D2" }); 1385var ex = Assert.ThrowsAny<Exception>(() => analyzer.GetType().GetMethod("Method")!.Invoke(analyzer, new object[] { sb })); 1390analyzer.GetType().GetMethod("Method")!.Invoke(analyzer, new object[] { sb }); 1409analyzer.GetType().GetMethod("Method")!.Invoke(analyzer, new object[] { sb }); 1446var result = analyzer.GetType().GetMethod("GetFileAttributes")!.Invoke(analyzer, new[] { testFixture.AnalyzerWithNativeDependency }); 1496d!.GetType().GetMethod("Write")!.Invoke(d, new object[] { sb, "Test D" }); 1530var writeMethod = b.GetType().GetMethod("Write")!;
Analyzers\AnalyzerFileReferenceTests.cs (5)
127var analyzerNames = analyzers.Select(a => a.GetType().Name); 134analyzerNames = analyzers.Select(a => a.GetType().Name); 519var csharpAnalyzers = reference.GetAnalyzers(LanguageNames.CSharp).Select(a => a.GetType().FullName).ToArray(); 526var vbAnalyzers = reference.GetAnalyzers(LanguageNames.VisualBasic).Select(a => a.GetType().FullName).ToArray(); 534var allAnalyzers = reference.GetAnalyzersForAllLanguages().Select(a => a.GetType().FullName).ToArray();
Collections\DebuggerAttributes.cs (6)
43DebuggerAttributeInfo info = ValidateDebuggerTypeProxyProperties(obj.GetType(), obj); 52return ValidateDebuggerTypeProxyProperties(obj.GetType(), obj); 97public static Type GetProxyType(object obj) => GetProxyType(obj.GetType()); 131var objType = obj.GetType(); 237for (Type? t = obj.GetType(); t != null; t = t.GetTypeInfo().BaseType) 250for (Type? t = obj.GetType(); t != null; t = t.GetTypeInfo().BaseType)
Collections\HashSet\TestingTypes.cs (4)
78if (obj != null && obj.GetType() == typeof(EquatableBackwardsOrder)) 197if (obj?.GetType() == typeof(SimpleInt)) 206if (other?.GetType() == typeof(SimpleInt)) 213if (other?.GetType() == typeof(SimpleInt))
Collections\IdentifierCollectionTests.cs (4)
42Assert.Equal(idcol.GetEnumerator().GetType(), ((System.Collections.IEnumerable)idcol).GetEnumerator().GetType()); 59Assert.Equal(idcol.GetEnumerator().GetType(), ((System.Collections.IEnumerable)idcol).GetEnumerator().GetType());
Collections\ImmutableSegmentedListTest.cs (1)
805var addMethod = list.GetType().GetMethod("Add");
Collections\ImmutablesTestBase.cs (12)
60else if (first.GetType() != second.GetType()) 65else if (first.GetType().IsValueType) 67throw new NotSupportedException($"Unable to compare '{first.GetType()}' for identity."); 80else if (first.GetType() != second.GetType()) 85else if (first.GetType().IsValueType) 87throw new NotSupportedException($"Unable to compare '{first.GetType()}' for identity."); 101else if (first.GetType() != second.GetType()) 106else if (first.GetType().IsValueType) 108throw new NotSupportedException($"Unable to compare '{first.GetType()}' for identity.");
Collections\List\CollectionAsserts.cs (2)
39Assert.IsType(e.Current.GetType(), a.Current); 65Assert.IsType(e.Current.GetType(), a.Current);
Text\TextChangeTests.cs (1)
598var chunkField = text.GetType().GetField("_chunks", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
Microsoft.CodeAnalysis.VisualBasic (15)
CommandLine\VisualBasicCommandLineParser.vb (1)
1802diagnosticBuilder.Add(Diagnostic.Create(VisualBasic.MessageProvider.Instance, ERRID.ERR_InvalidPreprocessorConstantType, symbol.Key, symbol.Value.GetType()))
Compilation\VisualBasicDeterministicKeyBuilder.vb (1)
46Dim type = value.GetType()
Lowering\AsyncRewriter\AsyncRewriter.CapturedSymbolOrExpression.vb (1)
30Debug.Assert(False, "This method should not be called for " + Me.GetType.Name)
Lowering\AsyncRewriter\AsyncRewriter.vb (1)
460Debug.Assert(Not expression.IsLValue, "Need to support LValues of type " + expression.GetType.Name)
Preprocessor\ExpressionEvaluator.vb (1)
547If value.GetType().GetTypeInfo().IsValueType Then
SymbolDisplay\ObjectDisplay.vb (1)
44Dim type = obj.GetType()
SymbolDisplay\SymbolDisplayVisitor_Constants.vb (1)
21Debug.Assert(value.GetType().GetTypeInfo().IsPrimitive OrElse TypeOf value Is String OrElse TypeOf value Is Decimal OrElse TypeOf value Is DateTime)
Symbols\ReferenceManager.vb (1)
113Throw New NotSupportedException(String.Format(VBResources.CantReferenceCompilationFromTypes, compilationReference.GetType(), "Visual Basic"))
Symbols\SubstitutedErrorType.vb (2)
259Not Me.GetType().Equals(obj.GetType()) Then
Symbols\SubstitutedNamedType.vb (2)
531Not Me.GetType().Equals(other.GetType()) Then
Symbols\UnboundGenericType.vb (3)
302Return other IsNot Nothing AndAlso other.GetType() = Me.GetType() AndAlso other.OriginalDefinition.Equals(OriginalDefinition, comparison) 306Return Hash.Combine(Me.GetType(), OriginalDefinition.GetHashCode())
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Analyzers\VisualBasic\Analyzers\ConvertTypeofToNameof\VisualBasicConvertTypeOfToNameOfDiagnosticAnalyzer.vb (1)
26Dim isParentValid = node.Parent.GetType() Is GetType(MemberAccessExpressionSyntax)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
ExpressionTrees\Sources\ExprLambdaUtils.vb (1)
64Dim vType = val.GetType()
Microsoft.CodeAnalysis.VisualBasic.Features (1)
src\Analyzers\VisualBasic\Analyzers\ConvertTypeofToNameof\VisualBasicConvertTypeOfToNameOfDiagnosticAnalyzer.vb (1)
26Dim isParentValid = node.Parent.GetType() Is GetType(MemberAccessExpressionSyntax)
Microsoft.CodeAnalysis.VisualBasic.ResultProvider (1)
src\Compilers\VisualBasic\Portable\SymbolDisplay\ObjectDisplay.vb (1)
44Dim type = obj.GetType()
Microsoft.CodeAnalysis.VisualBasic.Scripting (1)
VisualBasicScript.vb (1)
47Return Create(Of T)(code, options, globals?.GetType()).RunAsync(globals, cancellationToken)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
Semantics\Conversions.vb (1)
1369Select Case System.Type.GetTypeCode(value.GetType())
Semantics\SyntaxTreeRootTests.vb (2)
30Assert.Equal(GetType(CompilationUnitSyntax), tree.GetRoot().GetType()) 39Assert.NotEqual(GetType(CompilationUnitSyntax), root.GetType())
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (1)
SymbolsTests\Source\SourceSymbolTests.vb (1)
654Assert.Equal({"MyTemplateLocation", "SourceLocation", "SourceLocation", "SourceLocation", "SourceLocation", "MetadataLocation"}, locations.Select(Function(l) l.GetType().Name))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
Syntax\SyntaxFactoryTests.vb (1)
105Dim literalMethod = literalMethods.Single(Function(m) m.GetParameters().Single().ParameterType = value.GetType())
TestSyntaxNodes.vb (1)
3372Assert.Equal("Microsoft.CodeAnalysis.VisualBasic.Syntax.IfDirectiveTriviaSyntax", x(0).GetType.ToString)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
Extensions.vb (1)
286If Not o.GetType.IsArray Then
VBParser.vb (1)
26Return node.GetType().GetTypeInfo().GetDeclaredProperty("Kind").GetValue(node, Nothing).ToString()
Microsoft.CodeAnalysis.Workspaces (76)
CodeActions\CodeAction.cs (4)
107var type = this.GetType(); 204_providerTypeForTelemetry = provider.GetType(); 217: this.GetType(); 377=> throw new NotSupportedException(GetType().FullName);
CodeFixesAndRefactorings\FixAllLogger.cs (2)
67m[providerKey] = fixAllState.Provider.GetType().FullName!; 73m[providerKey] = fixAllState.Provider.GetType().FullName!.GetHashCode().ToString();
Diagnostics\Extensions.cs (1)
77var type = analyzer.GetType();
ExtensionManager\IExtensionManagerExtensions.cs (1)
110return n => map.TryGetValue(n.GetType(), out var extensions) ? extensions : [];
Log\WorkspaceErrorLogger.cs (1)
22=> Logger.Log(FunctionId.Extension_Exception, (source, exception) => source.GetType().Name + " : " + ToLogFormat(exception), source, exception, LogLevel.Error);
Serialization\SerializedPortableExecutableReference.cs (1)
65MetadataKind={metadata switch { null => "null", AssemblyMetadata => "assembly", ModuleMetadata => "module", _ => metadata.GetType().Name }}
Serialization\SerializerService_Reference.cs (2)
52throw ExceptionUtilities.UnexpectedValue(reference.GetType()); 111throw ExceptionUtilities.UnexpectedValue(reference.GetType());
src\Compilers\Core\Portable\SpecialTypeExtensions.cs (16)
281if (value.GetType() == typeof(int)) 286if (value.GetType() == typeof(string)) 291if (value.GetType() == typeof(bool)) 296if (value.GetType() == typeof(char)) 301if (value.GetType() == typeof(long)) 306if (value.GetType() == typeof(double)) 311if (value.GetType() == typeof(uint)) 316if (value.GetType() == typeof(ulong)) 321if (value.GetType() == typeof(float)) 326if (value.GetType() == typeof(decimal)) 331if (value.GetType() == typeof(short)) 336if (value.GetType() == typeof(ushort)) 341if (value.GetType() == typeof(DateTime)) 346if (value.GetType() == typeof(byte)) 351if (value.GetType() == typeof(sbyte)) 375Debug.Assert(value.GetType().IsPrimitive);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
100throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
66throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
76throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
141if (typeof(T[]) != destinationArray.GetType() && destinationArray.Rank != 1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (2)
154if (enumerable.GetType() == typeof(SegmentedDictionary<TKey, TValue>)) 198else if (enumerable.GetType() == typeof(List<KeyValuePair<TKey, TValue>>))
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
18var typeString = analyzer.GetType().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ObjectExtensions.cs (1)
10=> obj == null ? "null" : obj.GetType().Name;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\ChainedFormattingRules.cs (1)
104(obj.GetType(), name),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (19)
183Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 191var type = value.GetType(); 206if (value.GetType() == typeof(int)) 210else if (value.GetType() == typeof(double)) 215else if (value.GetType() == typeof(bool)) 219else if (value.GetType() == typeof(char)) 224else if (value.GetType() == typeof(byte)) 229else if (value.GetType() == typeof(short)) 234else if (value.GetType() == typeof(long)) 239else if (value.GetType() == typeof(sbyte)) 244else if (value.GetType() == typeof(float)) 249else if (value.GetType() == typeof(ushort)) 254else if (value.GetType() == typeof(uint)) 258else if (value.GetType() == typeof(ulong)) 265throw ExceptionUtilities.UnexpectedValue(value.GetType()); 268else if (value.GetType() == typeof(decimal)) 273else if (value.GetType() == typeof(DateTime)) 278else if (value.GetType() == typeof(string)) 284throw new InvalidOperationException($"Unsupported object type: {value.GetType()}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (2)
129if (existingConstants[0].Equals(Convert.ChangeType(2, existingConstants[0].GetType())) && 130existingConstants[1].Equals(Convert.ChangeType(1, existingConstants[1].GetType())))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
166string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_but_given_one_is_1, typeof(TDeclarationNode).Name, destination.GetType().Name), 185typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, destination.GetType().Name), 206typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, destination.GetType().Name), 224typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, typeof(TDeclarationNode4).Name, destination.GetType().Name),
Workspace\Solution\DocumentId.cs (1)
63=> string.Format("({0}, #{1} - {2})", this.GetType().Name, this.Id, _debugName);
Workspace\Solution\FileTextLoader.cs (1)
68GetType(), _ => new StrongBox<bool>(new Func<Stream, Workspace, SourceText>(CreateText).Method.DeclaringType != typeof(FileTextLoader))).Value;
Workspace\Solution\ProjectId.cs (1)
72=> string.Format("({0}, #{1} - {2})", this.GetType().Name, this.Id, _debugName);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (6)
153_ => throw ExceptionUtilities.UnexpectedValue(state.GetType()), 172_ => throw ExceptionUtilities.UnexpectedValue(state.GetType()), 300_ => throw ExceptionUtilities.UnexpectedValue(state.GetType()) 736_ => throw ExceptionUtilities.UnexpectedValue(state.GetType()), 848throw ExceptionUtilities.UnexpectedValue(state.GetType()); 953throw ExceptionUtilities.UnexpectedValue(state.GetType());
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
410var driverType = generatorDriver.GetType();
Workspace\Solution\SolutionId.cs (1)
59=> string.Format("({0}, #{1} - {2})", GetType().Name, this.Id, _debugName);
Workspace\Solution\TextLoader.cs (2)
64GetType(), 71throw new NotImplementedException($"{GetType()} must override {nameof(LoadTextAndVersionAsync)}");
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (8)
Rpc\RpcServer.cs (2)
114var method = rpcTarget.GetType().GetMethod(request.Method, BindingFlags.Public | BindingFlags.Instance); 150result = task.GetType().GetProperty("Result")!.GetValue(task);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
100throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
66throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
76throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}");
src\Dependencies\Collections\Segmented\SegmentedArray.cs (1)
141if (typeof(T[]) != destinationArray.GetType() && destinationArray.Rank != 1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
154if (enumerable.GetType() == typeof(SegmentedDictionary<TKey, TValue>))
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
src\Workspaces\MSBuild\BuildHost\Rpc\RpcServer.cs (2)
114var method = rpcTarget.GetType().GetMethod(request.Method, BindingFlags.Public | BindingFlags.Instance); 150result = task.GetType().GetProperty("Result")!.GetValue(task);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (4)
ObjectExtensions.cs (2)
21var type = instance.GetType(); 34var type = instance.GetType();
Options\OptionsTestHelpers.cs (2)
127.WithValue(GetDifferentValue(codeStyle.GetType().GetGenericArguments()[0], codeStyle.Value!)!) 130.WithValue(GetDifferentValue(codeStyle.GetType().GetGenericArguments()[0], codeStyle.Value!)!)
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
ObjectSerializationTests.cs (1)
95r => value != null && value.GetType().IsEnum
Remote\ServiceDescriptorTests.cs (3)
214var deserialized = MessagePackSerializer.Deserialize(original.GetType(), stream, messagePackOptions); 285var deserialized = MessagePackSerializer.Deserialize(original.GetType(), stream, messagePackOptions); 328formatter => formatter.GetType() is { IsGenericType: true } and var formatterType &&
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
559var state = syntaxAndDeclarationsManager.GetType().GetMethod("GetLazyState", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)!.Invoke(syntaxAndDeclarationsManager, null);
WorkspaceTests\AdhocWorkspaceTests.cs (1)
576Assert.Equal(typeof(DefaultDocumentTextDifferencingService), service.GetType());
Microsoft.CommonLanguageServerProtocol.Framework.Example (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.CommonLanguageServerProtocol.Framework.Package (4)
HandlerProvider.cs (1)
80var handlerType = handler.GetType();
QueueItem.cs (1)
217throw new NotImplementedException($"Unrecognized {nameof(IMethodHandler)} implementation {handler.GetType()}.");
RequestExecutionQueue.cs (1)
97var noValueType = NoValue.Instance.GetType();
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Microsoft.CSharp (9)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (2)
56tempForIncrement = Expression.Variable(value != null ? value.GetType() : typeof(object), "t0"); 119Expression.Assign(tempForIncrement, Expression.Convert(arg0.Expression, arg0.Value.GetType())),
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (3)
72this.type = value == null ? "<null>" : value.GetType().ToString(); 195delegateSignatureTypes[i + 1] = args[i].GetType(); 219Delegate target = (Delegate)site.GetType().GetField("Target").GetValue(site);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (1)
521arg.RuntimeObjectActualType = SymbolTable.GetCTypeFromType(argument.Value.GetType());
Microsoft\CSharp\RuntimeBinder\Semantics\ConstVal.cs (1)
90Type.GetTypeCode(o.GetType()) switch
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (2)
1540Debug.Assert(Type.GetTypeCode(defValue.GetType()) != TypeCode.Decimal); // Handled above 1541switch (Type.GetTypeCode(defValue.GetType()))
Microsoft.Data.Analysis (1)
PrimitiveDataFrameColumn.cs (1)
239if (value == null || value.GetType() == typeof(T))
Microsoft.Data.Analysis.Tests (1)
test\Microsoft.ML.TestFramework\BaseTestClass.cs (1)
61ITest test = (ITest)output.GetType().GetField("test", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(output);
Microsoft.DotNet.Arcade.Sdk.Tests (3)
Utilities\TestProjectFixture.cs (3)
34_logOutputDir = GetType().Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().Single(m => m.Key == "LogOutputDir").Value; 51var nugetRoot = GetType().Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().Single(m => m.Key == "NuGetPackageRoot").Value; 52var pkgVersion = GetType().Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().Single(m => m.Key == "PackageVersion").Value;
Microsoft.DotNet.AsmDiff (1)
DiffApiDefinition.cs (1)
58throw new NotImplementedException("Unknown CCI object type: " + obj.GetType());
Microsoft.DotNet.Build.Tasks.Feed (1)
src\Common\Internal\EnumExtensions.cs (1)
16Type type = value.GetType();
Microsoft.DotNet.Build.Tasks.Packaging (3)
PackageIndex.cs (2)
739throw new JsonSerializationException($"Expected {nameof(InboxFrameworks)} but got {value.GetType()}"); 853throw new JsonSerializationException($"Expected {nameof(MetaPackages)} but got {value.GetType()}");
PackageReport.cs (1)
106throw new JsonSerializationException($"Expected {nameof(NuGetFramework)} but got {value.GetType()}");
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\BaseAnalyzer.cs (1)
29if (StringComparer.OrdinalIgnoreCase.Equals(line.ToString(), GetType().Name))
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\AssertEx.cs (2)
64if (x.GetType() != y.GetType())
Microsoft.DotNet.RemoteExecutor (1)
RemoteExecutor.cs (1)
598Type targetType = d.Target.GetType();
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (1)
ServiceClientCodeFactory.cs (1)
93HelperFactory.RegisterAllForType(hb, language.GetType(), language);
Microsoft.DotNet.XUnitExtensions (1)
src\Microsoft.DotNet.XUnitExtensions.Shared\XunitParallelTheoryTestCaseRunner.cs (1)
76Aggregator.Add(new InvalidOperationException($"Data discoverer specified for {reflectionAttribute.Attribute.GetType()} on {TestCase.TestMethod.TestClass.Class.Name}.{TestCase.TestMethod.Method.Name} does not implement IDataDiscoverer."));
Microsoft.Extensions.AI (4)
ChatCompletion\FunctionInvokingChatClient.cs (1)
674Throw.InvalidOperationException($"{GetType().Name}.{nameof(CreateResponseMessages)} returned null or an empty collection of messages.");
ChatCompletion\OpenTelemetryChatClient.cs (1)
472JsonSerializer.SerializeToNode(result, _jsonSerializerOptions.GetTypeInfo(result.GetType())) :
Functions\AIFunctionFactory.cs (1)
986string json = JsonSerializer.Serialize(value, serializerOptions.GetTypeInfo(value.GetType()));
Functions\AIFunctionFactoryOptions.cs (1)
102/// This may be different than the actual type of the object (<see cref="object.GetType"/>) if the method returns a derived type
Microsoft.Extensions.AI.Abstractions (7)
AITool.cs (1)
23public virtual string Name => GetType().Name;
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (3)
32converter.GetType().Assembly == typeof(JsonConverter).Assembly; 74Type converterType = nullableConverter.GetType(); 101Type converterType = enumConverter.GetType();
Utilities\AIJsonUtilities.Schema.Create.cs (2)
212? JsonSerializer.Serialize(defaultValue, serializerOptions.GetTypeInfo(defaultValue.GetType())) 220? JsonSerializer.SerializeToNode(defaultValue, serializerOptions.GetTypeInfo(defaultValue.GetType()))
Microsoft.Extensions.AI.Abstractions.Tests (4)
ChatCompletion\DelegatingChatClientTests.cs (1)
141GetServiceCallback = (type, key) => type == expectedResult.GetType() && key == expectedKey
Embeddings\DelegatingEmbeddingGeneratorTests.cs (1)
102GetServiceCallback = (type, key) => type == expectedResult.GetType() && key == expectedKey
SpeechToText\DelegatingSpeechToTextClientTests.cs (1)
142GetServiceCallback = (type, key) => type == expectedResult.GetType() && key == expectedKey
Utilities\AIJsonUtilitiesTests.cs (1)
62Type anonType = new { Name = 42 }.GetType();
Microsoft.Extensions.AI.Evaluation (2)
CompositeEvaluator.cs (2)
55$"The '{nameof(evaluator.EvaluationMetricNames)}' property on '{evaluator.GetType().FullName}' returned an empty collection. An evaluator must advertise the names of the metrics that it supports."); 154$"The '{nameof(e.EvaluationMetricNames)}' property on '{e.GetType().FullName}' returned an empty collection. An evaluator must advertise the names of the metrics that it supports.");
Microsoft.Extensions.AI.Evaluation.Quality (2)
EvaluationMetricExtensions.cs (1)
147throw new NotSupportedException($"{metric.GetType().Name} is not supported.");
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (2)
ScenarioRunResultTests.cs (2)
360if (x?.GetType().Name != y?.GetType().Name)
Microsoft.Extensions.AI.Evaluation.Safety (1)
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.Extensions.AI.Ollama (1)
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.Extensions.AI.Tests (11)
ChatCompletion\DistributedCachingChatClientTest.cs (3)
737Assert.IsType(expectedMessage.GetType(), actualMessage); 746Assert.IsType(expectedItem.GetType(), actualItem); 780Assert.IsType(expectedItemItem.GetType(), actualItemItem);
ChatCompletion\FunctionInvokingChatClientTests.cs (8)
981Assert.Equal(expectedMessage.GetType(), chatMessage.GetType()); 989Assert.Equal(expectedItem.GetType(), chatItem.GetType()); 1075Assert.Equal(expectedMessage.GetType(), chatMessage.GetType()); 1083Assert.Equal(expectedItem.GetType(), chatItem.GetType());
Microsoft.Extensions.AmbientMetadata.Application (1)
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.Extensions.AsyncState (1)
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.Extensions.Caching.Hybrid (3)
Internal\DefaultHybridCache.cs (2)
82&& _backendCache.GetType() == typeof(MemoryDistributedCache) 83&& _localCache.GetType() == typeof(MemoryCache))
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (38)
CacheServiceExtensionsTests.cs (2)
175&& l2.GetType() == typeof(MemoryDistributedCache) 176&& l1.GetType() == typeof(MemoryCache))
RedisCacheSetAndRemoveTests.cs (10)
22var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 32var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 45var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 62var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 79var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 95var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 105var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 119var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 136var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 159var cache = RedisTestConfig.CreateCacheInstance(GetType().Name);
TimeExpirationAsyncTests.cs (13)
40var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 58var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 79var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 92var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 108var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 124var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 144var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 157var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 170var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 186var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 204var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 217var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 242var cache = RedisTestConfig.CreateCacheInstance(GetType().Name);
TimeExpirationTests.cs (13)
23var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 41var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 62var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 75var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 91var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 108var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 128var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 141var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 154var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 171var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 189var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 202var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 227var cache = RedisTestConfig.CreateCacheInstance(GetType().Name);
Microsoft.Extensions.Compliance.Redaction (4)
RedactorProvider.cs (2)
51if (r.GetType() == m.Value) 66if (r.GetType() == defaultRedactorType)
src\Shared\Data.Validation\LengthAttribute.cs (2)
140throw new InvalidOperationException($"{nameof(LengthAttribute)} is not supported for fields of type {value.GetType()} (see field {validationContext.GetDisplayName()})"); 150private static PropertyInfo? GetCountProperty(object value) => value.GetType().GetRuntimeProperty("Count");
Microsoft.Extensions.Compliance.Redaction.Tests (3)
RedactorProviderTests.cs (3)
97Assert.Equal(typeof(NullRedactor), r1.GetType()); 98Assert.Equal(typeof(NullRedactor), r2.GetType()); 99Assert.Equal(typeof(ErasingRedactor), r3.GetType());
Microsoft.Extensions.Configuration (1)
ConfigurationProvider.cs (1)
125public override string ToString() => GetType().Name;
Microsoft.Extensions.Configuration.Binder (4)
BindingPoint.cs (1)
47return _initialValue?.GetType() is { } initialValueType
ConfigurationBinder.cs (3)
144BindInstance(instance.GetType(), bindingPoint, configuration, options, false); 225List<PropertyInfo> modelProperties = GetAllProperties(instance.GetType()); 244nameof(options.ErrorOnUnknownConfiguration), nameof(BinderOptions), instance.GetType(),
Microsoft.Extensions.Configuration.EnvironmentVariables (1)
EnvironmentVariablesConfigurationProvider.cs (1)
54string s = GetType().Name;
Microsoft.Extensions.Configuration.FileExtensions (1)
FileConfigurationProvider.cs (1)
54=> $"{GetType().Name} for '{Source.Path}' ({(Source.Optional ? "Optional" : "Required")})";
Microsoft.Extensions.Configuration.KeyPerFile (1)
KeyPerFileConfigurationProvider.cs (1)
117=> $"{GetType().Name} for files in '{GetDirectoryName()}' ({(Source.Optional ? "Optional" : "Required")})";
Microsoft.Extensions.DependencyInjection (8)
DependencyInjectionEventSource.cs (1)
267builder.Append(instance.GetType());
ServiceLookup\CallSiteFactory.cs (1)
691else if (parameterType != serviceIdentifier.ServiceKey.GetType()
ServiceLookup\CallSiteVisitor.cs (1)
54throw new NotSupportedException(SR.Format(SR.CallSiteTypeNotSupported, callSite.GetType()));
ServiceLookup\ConstantCallSite.cs (2)
18throw new ArgumentException(SR.Format(SR.ConstantCantBeConvertedToServiceType, defaultValue.GetType(), serviceType)); 25public override Type ImplementationType => DefaultValue?.GetType() ?? _serviceType;
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (1)
94owner: GetType(),
ServiceProvider.cs (1)
163ThrowHelper.ThrowInvalidOperationException_NoKeyedServiceRegistered(serviceType, serviceKey.GetType());
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
38return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.Extensions.DependencyInjection.Abstractions (6)
ActivatorUtilities.cs (2)
179argumentTypes[i] = parameters[i]?.GetType(); 813Type? givenType = givenParameters[givenIndex]?.GetType();
ServiceDescriptor.cs (4)
317return ImplementationInstance.GetType(); 321Type[]? typeArguments = ImplementationFactory.GetType().GenericTypeArguments; 336return KeyedImplementationInstance.GetType(); 340Type[]? typeArguments = KeyedImplementationFactory.GetType().GenericTypeArguments;
Microsoft.Extensions.Diagnostics.Abstractions (1)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
38return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.Extensions.Diagnostics.ExceptionSummarization (2)
ExceptionSummarizer.cs (1)
95$"Exception summary provider {exceptionSummaryProvider.GetType().Name} returned invalid short description index {descriptionIndex}");
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.Extensions.Diagnostics.Probes (2)
src\Shared\Data.Validation\LengthAttribute.cs (2)
140throw new InvalidOperationException($"{nameof(LengthAttribute)} is not supported for fields of type {value.GetType()} (see field {validationContext.GetDisplayName()})"); 150private static PropertyInfo? GetCountProperty(object value) => value.GetType().GetRuntimeProperty("Count");
Microsoft.Extensions.Diagnostics.Probes.Tests (3)
KubernetesProbesExtensionsTests.cs (3)
36var hostedServices = host.Services.GetServices<IHostedService>().Where(service => service.GetType().Name == "TcpEndpointProbesService"); 80var hostedServices = host.Services.GetServices<IHostedService>().Where(service => service.GetType().Name == "TcpEndpointProbesService"); 108var hostedServices = host.Services.GetServices<IHostedService>().Where(service => service.GetType().Name == "TcpEndpointProbesService");
Microsoft.Extensions.Diagnostics.ResourceMonitoring (3)
ResourceMonitorService.cs (1)
118Log.HandlePublishUtilizationException(_logger, e, publisher.GetType().FullName!);
src\Shared\Data.Validation\LengthAttribute.cs (2)
140throw new InvalidOperationException($"{nameof(LengthAttribute)} is not supported for fields of type {value.GetType()} (see field {validationContext.GetDisplayName()})"); 150private static PropertyInfo? GetCountProperty(object value) => value.GetType().GetRuntimeProperty("Count");
Microsoft.Extensions.FileProviders.Embedded.Tests (11)
EmbeddedFileProviderTests.cs (11)
26var provider = new EmbeddedFileProvider(GetType().Assembly); 42var provider = new EmbeddedFileProvider(GetType().Assembly); 62var provider = new EmbeddedFileProvider(GetType().Assembly, Namespace + ".SubNamespace"); 76var provider = new EmbeddedFileProvider(GetType().Assembly); 109var provider = new EmbeddedFileProvider(GetType().Assembly, Namespace + ".Resources"); 147var provider = new EmbeddedFileProvider(GetType().Assembly); 185var provider = new EmbeddedFileProvider(GetType().Assembly); 206var provider = new EmbeddedFileProvider(GetType().Assembly, Namespace + ".Resources"); 226var provider = new EmbeddedFileProvider(GetType().Assembly, "Unknown.Namespace"); 243var provider = new EmbeddedFileProvider(GetType().Assembly); 258var provider = new EmbeddedFileProvider(GetType().Assembly);
Microsoft.Extensions.Http (1)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
38return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.Extensions.Http.Diagnostics (1)
Logging\Internal\HttpClientLogger.cs (1)
234Log.EnrichmentError(_logger, e, enricher.GetType().FullName, request.Method, logRecord.Host, logRecord.Path);
Microsoft.Extensions.Http.Resilience (2)
src\Shared\Data.Validation\LengthAttribute.cs (2)
140throw new InvalidOperationException($"{nameof(LengthAttribute)} is not supported for fields of type {value.GetType()} (see field {validationContext.GetDisplayName()})"); 150private static PropertyInfo? GetCountProperty(object value) => value.GetType().GetRuntimeProperty("Count");
Microsoft.Extensions.Http.Resilience.Tests (2)
Helpers\OptionsUtilities.cs (1)
52.GetType()
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (1)
354Assert.Equal(typeof(TestHandlerStub), handlers.First().GetType());
Microsoft.Extensions.Logging (1)
LoggerInformation.cs (1)
76ProviderType = provider.GetType();
Microsoft.Extensions.Logging.Abstractions (1)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
38return item == null ? null : GetTypeDisplayName(item.GetType(), fullName);
Microsoft.Extensions.Logging.Generators (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
Microsoft.Extensions.ObjectPool (1)
DisposableObjectPool.cs (1)
34throw new ObjectDisposedException(GetType().Name);
Microsoft.Extensions.Options (2)
OptionsCache.cs (1)
55if (GetType() != typeof(OptionsCache<TOptions>))
OptionsServiceCollectionExtensions.cs (1)
244Type configureType = configureInstance.GetType();
Microsoft.Extensions.Options.Contextual (1)
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
Microsoft.Extensions.Options.DataAnnotations (2)
DataAnnotationValidateOptions.cs (2)
62if (TryValidateOptions(options, options.GetType().Name, validationResults, ref errors, ref visited)) 96foreach (PropertyInfo propertyInfo in options.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public))
Microsoft.Extensions.Options.SourceGeneration (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
Microsoft.Extensions.ServiceDiscovery (1)
Http\ResolvingHttpDelegatingHandler.cs (1)
98throw new InvalidOperationException($"Endpoints of type {endPoint.GetType()} are not supported");
Microsoft.Extensions.Telemetry (3)
Logging\Import\LoggerInformation.cs (1)
90ProviderType = provider.GetType();
src\Shared\Data.Validation\LengthAttribute.cs (2)
140throw new InvalidOperationException($"{nameof(LengthAttribute)} is not supported for fields of type {value.GetType()} (see field {validationContext.GetDisplayName()})"); 150private static PropertyInfo? GetCountProperty(object value) => value.GetType().GetRuntimeProperty("Count");
Microsoft.Extensions.Telemetry.PerformanceTests (1)
BenchLogger.cs (1)
66if (o?.GetType() == typeof(Guid))
Microsoft.Extensions.Telemetry.Tests (3)
Logging\ExtendedLoggerFactoryTests.cs (3)
471Assert.StartsWith(loggerProvider.ScopeProvider!.GetType().FullName, scope!.GetType().FullName); 483Assert.Contains("LoggerExternalScopeProvider+Scope", scope!.GetType().FullName);
Microsoft.Gen.Logging.Generated.Tests (2)
TagProviderTests.cs (1)
403["param2.Type"] = obj2.GetType().ToString(),
test\Generators\Microsoft.Gen.Logging\TestClasses\TagProviderWithObjectExtensions.cs (1)
41list.Add("Type", param?.GetType());
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
Microsoft.Interop.JavaScript.JSImportGenerator (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
Microsoft.Interop.SourceGeneration (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
Microsoft.JSInterop (5)
Infrastructure\DotNetDispatcher.cs (2)
125else if (syncResult?.GetType() is { IsGenericType: true } syncResultType 383var type = objectReference.Value.GetType();
Infrastructure\TaskGenericsUtil.cs (2)
28var getter = _cachedResultGetters.GetOrAdd(task.GetType(), taskInstanceType => 108return _cachedResultSetters.GetOrAdd(taskCompletionSource.GetType(), tcsType =>
JSRuntime.cs (1)
353throw new InvalidOperationException($"{dotNetObjectReference.GetType().Name} is already being tracked by a different instance of {nameof(JSRuntime)}." +
Microsoft.JSInterop.Tests (1)
DotNetObjectReferenceTest.cs (1)
50var expected = $"{objRef.GetType().Name} is already being tracked by a different instance of {nameof(JSRuntime)}. A common cause is caching an instance of {nameof(DotNetObjectReference<string>)}" +
Microsoft.Maui (16)
Animations\LerpingAnimation.cs (2)
83 var type = StartValue?.GetType() ?? EndValue?.GetType();
Converters\PrimitiveTypeConversions.cs (1)
25 if (value is not null && IsImplicitlyConvertibleToDouble(value.GetType()))
Handlers\HybridWebView\HybridWebViewHandler.cs (2)
214 var resultType = result.GetType(); 243 throw new InvalidOperationException($"The method {requestMethodName} couldn't be found on the {nameof(jsInvokeTarget)} of type {jsInvokeTarget.GetType().FullName}.");
Hosting\ImageSources\ImageSourceServiceProviderExtensions.cs (2)
9 provider.GetImageSourceService(imageSource.GetType()); 16 provider.GetRequiredImageSourceService(imageSource.GetType());
HotReload\HotReloadHelper.cs (3)
70 if (!replacedViews.TryGetValue(view.GetType().FullName!, out var newViewType)) 72 return newView.GetType() == newViewType; 83 var viewType = view.GetType();
Platform\ElementExtensions.cs (3)
75 var viewType = view.GetType(); 87 handlersWithConstructors.Add(view.GetType()); 149 handler = context.Handlers.GetHandler(element.GetType());
Platform\ReflectionExtensions.cs (1)
27 return self.IsAssignableFrom(o.GetType());
Primitives\Font.cs (2)
104 if (obj.GetType() != GetType())
Microsoft.Maui.Controls (65)
AnimatableKey.cs (4)
54 if (obj.GetType() != GetType()) 62 if (obj.GetType() != GetType())
BindableProperty.cs (2)
96 throw new ArgumentException($"Default value did not match return type. Property: {returnType} {declaringType.Name}.{propertyName} Default value type: {defaultValue.GetType().Name}, ", nameof(defaultValue)); 215 Type valueType = value.GetType();
BindablePropertyConverter.cs (2)
140 return vsTarget.GetType(); 146 return veTarget.GetType();
Binding.cs (1)
138 ? $"Cannot apply relative binding to {bindObj.GetType().FullName} because it is not a superclass of Element."
BindingExpression.cs (4)
74 if (sourceObject != null && !dataType.IsAssignableFrom(sourceObject.GetType())) 76 BindingDiagnostics.SendBindingFailure(Binding, "Binding", $"Mismatch between the specified x:DataType ({dataType}) and the current binding context ({sourceObject.GetType()})."); 140 TypeInfo currentType = current is IReflectableType reflectable ? reflectable.GetTypeInfo() : current.GetType().GetTypeInfo(); 153 BindingDiagnostics.SendBindingFailure(Binding, current, target, property, "Binding", PropertyNotFoundErrorMessage, part.Content, current, target.GetType(), property.PropertyName);
CompareStateTrigger.cs (2)
75 value1 = ConvertToEnum(value2.GetType(), value1); 77 value1 = Convert.ChangeType(value1, value2.GetType(), CultureInfo.InvariantCulture);
ContentConverter.cs (1)
116 if (type.IsAssignableFrom(parent.GetType()))
DataTemplate.cs (2)
21 _idString = GetType().FullName + _id; 37 _idString = GetType().FullName + _id;
DataTemplateSelector.cs (2)
22 if (recycle && _dataTemplates.TryGetValue(item.GetType(), out dataTemplate)) 36 _dataTemplates[item.GetType()] = dataTemplate;
Device.cs (1)
122 return GetNamedSize(size, targetElement.GetType());
Element\Element_StyleSheets.cs (1)
30 var t = GetType();
FlyoutPage\FlyoutPage.cs (1)
390 return $"{GetType().FullName}: {debugText}";
FontSizeConverter.cs (1)
57 var type = serviceProvider.GetService(typeof(IProvideValueTarget)) is IProvideValueTarget valueTargetProvider ? valueTargetProvider.TargetObject.GetType() : typeof(Label);
Hosting\Effects\AppHostBuilderExtensions.cs (1)
120 if (_registeredEffects != null && _registeredEffects.TryGetValue(fromEffect.GetType(), out Func<PlatformEffect> effectType))
ImageSource.cs (1)
25 _mergedStyle = new MergedStyle(GetType(), this);
Interactivity\BindingCondition.cs (1)
76 converted = s_valueConverter.Convert(Value, other != null ? other.GetType() : typeof(object), null, null);
Interactivity\EventTrigger.cs (2)
80 _eventinfo = bindable.GetType().GetRuntimeEvent(Event); 85 Application.Current?.FindMauiContext()?.CreateLogger<EventTrigger>()?.LogWarning("Cannot attach EventTrigger to {Type}.{Event}. Check if the handler exists and if the signature is right.", bindable.GetType(), Event);
MultiBinding.cs (1)
220 types[i] = values[i]?.GetType() ?? typeof(object);
Page\Page.cs (1)
964 return $"{this.GetType().FullName}: {debugText}";
Platform\IElementExtensions.cs (1)
10 string typeName = $"{self?.Handler?.GetType().Name}";
PlatformBindingHelpers.cs (5)
44 var targetPropertyInfo = target.GetType().GetProperty(targetProperty); 84 var mi = target.GetType().GetProperty(targetProperty)?.SetMethod; 86 throw new InvalidOperationException(Format("Native Binding on {0}.{1} failed due to missing or inaccessible property", target.GetType(), targetProperty)); 95 SetValueFromRenderer(proxy, bindableProperty, target.GetType().GetProperty(targetProperty)?.GetMethod.Invoke(target, Array.Empty<object>())); 171 throw new ArgumentException(Format("No declared or accessible event {0} on {1}", updateSourceEventName, target.GetType()), nameof(updateSourceEventName));
Registrar.cs (7)
122 returnValue = GetHandler(type, visual?.GetType() ?? _defaultVisualType); 126 Type handlerType = GetHandlerType(type, visual?.GetType() ?? _defaultVisualType); 130 returnValue = (TRegistrable)DependencyResolver.ResolveOrCreate(handlerType, source, visual?.GetType(), args); 152 var type = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : obj.GetType(); 154 return GetHandler(type, (obj as IVisualController)?.EffectiveVisual?.GetType()) as TOut; 163 var type = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : obj.GetType(); 202 var type = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : obj.GetType();
RelativeBindingSource.cs (2)
166 AncestorType!.IsAssignableFrom(element.GetType()); 171 AncestorType!.IsAssignableFrom(element.BindingContext.GetType());
ResourceDictionary.cs (1)
412 var rootObjectType = (serviceProvider.GetService(typeof(Xaml.IRootObjectProvider)) as Xaml.IRootObjectProvider)?.RootObject.GetType();
Routing.cs (1)
134 return $"{DefaultPrefix}{bindable.GetType().Name}{++s_routeCount}";
Shell\Shell.cs (1)
1002 throw new InvalidOperationException($"Unable to determine the current Shell instance you want to use. Please access Shell via the Windows property on {Application.Current.GetType()}.");
Shell\ShellContent.cs (1)
377 var type = content.GetType();
Span.cs (2)
17 _mergedStyle = new MergedStyle(GetType(), this); 190 throw new InvalidOperationException($"{gesture.GetType().Name} is not supported on a {nameof(Span)}");
StyleableElement\StyleableElement.cs (1)
19 _mergedStyle = new MergedStyle(GetType(), this);
TypeConversionHelper.cs (5)
17 Type valueType = value.GetType(); 55 convertedValue = converter.ConvertTo(value, targetType) ?? throw new InvalidOperationException($"The {converter.GetType()} returned null when converting {valueType} to {targetType}"); 61 convertedValue = converter.ConvertFrom(value) ?? throw new InvalidOperationException($"The {converter.GetType()} returned null when converting from {valueType}"); 83 Type valueType = value.GetType(); 174 $"It is not possible to convert value of type {value.GetType()} to {targetType} via an implicit cast " +
TypedBinding.cs (2)
189 ? $"Cannot apply relative binding to {bindObj.GetType().FullName} because it is not a superclass of Element." 293 BindingDiagnostics.SendBindingFailure(this, "Binding", $"Mismatch between the specified x:DataType ({typeof(TSource)}) and the current binding context ({sourceObject.GetType()}).");
ViewExtensions.cs (1)
301 throw new ArgumentException($"Unable to find {nameof(IAnimationManager)} for '{animatable.GetType().FullName}'.", nameof(animatable));
VisualElement\VisualElement.cs (1)
2471 return $"{GetType().FullName}: {debugText}";
VisualElement\VisualElement_StyleSheet.cs (2)
24 if (styleAttribute.TargetType.IsAssignableFrom(GetType())) 39 var propertyOwnerType = styleAttribute.PropertyOwnerType ?? GetType();
Xaml\TypeConversionExtensions.cs (1)
219 if (value != null && !toType.IsAssignableFrom(value.GetType()))
Microsoft.Maui.Controls.BindingSourceGen (1)
AccessExpressionBuilder.cs (1)
18 _ => throw new NotSupportedException($"Unsupported path part type: {nextPart.GetType()}"),
Microsoft.Maui.Controls.Maps (2)
Pin.cs (2)
94 if (obj.GetType() != GetType())
Microsoft.Maui.Controls.SourceGen (1)
src\Controls\src\Xaml\XmlName.cs (1)
32 if (obj.GetType() != typeof(XmlName))
Microsoft.Maui.Controls.Xaml (46)
ApplyPropertiesVisitor.cs (26)
216 if (xpe == null && (addMethod = collection.GetType().GetRuntimeMethods().First(mi => mi.Name == "Add" && mi.GetParameters().Length == 1)) != null) 266 if (value.GetType().GetCustomAttribute<AcceptEmptyServiceProviderAttribute>() == null) 309 rootElement.GetType().Assembly, true, out xpe); 334 var bpOwnerType = xamlelement.GetType(); 341 var elementType = xamlelement.GetType(); 354 ResourceDictionaryHelpers.LoadFromSource(rd, (string)value, rootElement.GetType(), lineInfo); 377 var assemblyName = rootElement.GetType().Assembly?.GetName().Name; 383 var bpOwnerType = element.GetType(); 406 if (value != null && !value.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path) 414 if (value != null && !value.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path) 422 if (value != null && !value.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path) 438 var bpOwnerType = xamlElement.GetType(); 462 var elementType = element.GetType(); 473 var rootElementType = rootElement.GetType(); 517 exception = new XamlParseException($"No method {value} with correct signature found on type {rootElement.GetType()}", lineInfo); 525 var elementType = element.GetType(); 546 var elementType = element.GetType(); 578 var elementType = element.GetType(); 642 var elementType = element.GetType(); 659 var elementType = element.GetType(); 691 var elementType = element.GetType(); 723 if (method.IsPrivate && method.DeclaringType == rootElement.GetType()) 725 if ((method.IsAssembly || method.IsFamilyOrAssembly) && method.DeclaringType.AssemblyQualifiedName == rootElement.GetType().AssemblyQualifiedName) 727 if (method.IsFamily && method.DeclaringType.IsAssignableFrom(rootElement.GetType())) 744 var addMethod = collection.GetType().GetRuntimeMethods().First(mi => mi.Name == "Add" && mi.GetParameters().Length == 1); 836 var runTimeName = source.GetType().GetCustomAttribute<RuntimeNamePropertyAttribute>();
CreateValuesVisitor.cs (8)
51 var type = XamlParser.GetElementType(node.XmlType, node, Context.RootElement?.GetType().Assembly, true, 109 if (converted != null && converted.GetType() == type) 171 var assemblyName = (Context.RootAssembly ?? Context.RootElement?.GetType().Assembly)?.GetName().Name; 172 if (assemblyName != null && value != null && !value.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(Context.RootElement) is string path) 181 Context.Types[node] = rnode.Root.GetType(); 190 var assemblyName = (Context.RootAssembly ?? Context.RootElement.GetType().Assembly)?.GetName().Name; 191 if (rnode.Root != null && !rnode.Root.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(Context.RootElement) is string path) 252 Type[] types = arguments == null ? Array.Empty<Type>() : arguments.Select(a => a.GetType()).ToArray();
MarkupExpressionParser.cs (1)
69 var parser = Activator.CreateInstance(GetType()) as IExpressionParser;
MarkupExtensionParser.cs (5)
70 var t = markupExtension.GetType(); 87 setter = markupExtension.GetType().GetRuntimeProperty(prop).SetMethod; 91 throw new XamlParseException($"Multiple properties with name '{markupExtension.GetType()}.{prop}' found.", serviceProvider, innerException: e); 99 value = strValue.ConvertTo(markupExtension.GetType().GetRuntimeProperty(prop).PropertyType, 106 throw new XamlParseException($"Multiple properties with name '{markupExtension.GetType()}.{prop}' found.", serviceProvider, innerException: e);
MarkupExtensions\StaticResourceExtension.cs (1)
42 Type valueType = value.GetType();
MarkupExtensions\StyleSheetExtension.cs (1)
32 var rootObjectType = (serviceProvider.GetService(typeof(IRootObjectProvider)) as IRootObjectProvider)?.RootObject.GetType();
XamlFilePathAttribute.cs (1)
15 internal static string GetFilePathForObject(object view) => (view?.GetType().GetCustomAttributes(typeof(XamlFilePathAttribute), false).FirstOrDefault() as XamlFilePathAttribute)?.FilePath;
XamlLoader.cs (1)
85 RootAssembly = rootAssembly ?? view.GetType().Assembly,
XamlServiceProvider.cs (1)
337 context.RootElement.GetType().Assembly, true, out var xpe) is Type parentType
XmlName.cs (1)
32 if (obj.GetType() != typeof(XmlName))
Microsoft.Maui.Essentials (2)
Types\Location.shared.cs (2)
255 if (obj.GetType() != GetType())
Microsoft.ML.AutoML (12)
API\BinaryClassificationExperiment.cs (1)
445throw new ArgumentException($"The runner metric manager is of type {_metricManager.GetType()} which expected to be of type {typeof(ITrainValidateDatasetManager)} or {typeof(ICrossValidateDatasetManager)}");
API\MulticlassClassificationExperiment.cs (1)
423throw new ArgumentException($"The runner metric manager is of type {_metricManager.GetType()} which expected to be of type {typeof(ITrainValidateDatasetManager)} or {typeof(ICrossValidateDatasetManager)}");
API\RegressionExperiment.cs (1)
450throw new ArgumentException($"The runner metric manager is of type {_metricManager.GetType()} which expected to be of type {typeof(ITrainValidateDatasetManager)} or {typeof(ICrossValidateDatasetManager)}");
AutoMLExperiment\AutoMLExperiment.cs (1)
224var mostRecentAddedStopServices = stopServices.GroupBy(s => s.GetType()).Select(g => g.Last()).ToList();
TrainerExtensions\TrainerExtensionCatalog.cs (1)
54return _extensionTypesToTrainerNames[trainerExtension.GetType()];
TrainerExtensions\TrainerExtensionUtil.cs (3)
239if (propertyType == value?.GetType()) 264var fi = obj.GetType().GetField(param.Name); 296throw new InvalidOperationException($"Cannot set parameter {param.Name} for {obj.GetType()}");
Utils\SweepableParamAttributes.cs (4)
94var type = o.GetType(); 115return $"[{GetType().Name}({name}new object[]{{{string.Join(", ", Options.Select(TranslateOption))}}})]"; 164return $"[{GetType().Name}({name}{Min}f, {Max}f{optional})]"; 211return $"[{GetType().Name}({name}{Min}, {Max}{optional})]";
Microsoft.ML.AutoML.SourceGenerator (5)
Template\EstimatorType.cs (1)
306System.Type t = objectToConvert.GetType();
Template\SearchSpace.cs (1)
323System.Type t = objectToConvert.GetType();
Template\SweepableEstimator.cs (1)
325System.Type t = objectToConvert.GetType();
Template\SweepableEstimator_T_.cs (1)
330System.Type t = objectToConvert.GetType();
Template\SweepableEstimatorFactory.cs (1)
301System.Type t = objectToConvert.GetType();
Microsoft.ML.AutoML.Tests (3)
Utils\TaskAgnosticIterationResult.cs (3)
76if (!supportedTypes.Contains(metric.GetType())) 81var propertiesToReport = metric.GetType().GetProperties().Where(p => p.PropertyType == typeof(double)); 83return propertiesToReport.ToDictionary(p => p.Name, p => (double)metric.GetType().GetProperty(p.Name).GetValue(metric));
Microsoft.ML.CodeGenerator (12)
CodeGenerator\CSharp\TrainerGeneratorBase.cs (2)
63Type type = kv.Value.GetType(); 145if (kv.Value.GetType() == typeof(CustomProperty))
Templates\Azure\Console\AzureModelBuilder.cs (1)
400System.Type t = objectToConvert.GetType();
Templates\Azure\Model\AzureImageModelOutputClass.cs (1)
341System.Type t = objectToConvert.GetType();
Templates\Azure\Model\AzureObjectDetectionModelOutputClass.cs (1)
341System.Type t = objectToConvert.GetType();
Templates\Console\ConsumeModel.cs (1)
352System.Type t = objectToConvert.GetType();
Templates\Console\ModelBuilder.cs (1)
717System.Type t = objectToConvert.GetType();
Templates\Console\ModelInputClass.cs (1)
315System.Type t = objectToConvert.GetType();
Templates\Console\ModelOutputClass.cs (1)
358System.Type t = objectToConvert.GetType();
Templates\Console\ModelProject.cs (1)
347System.Type t = objectToConvert.GetType();
Templates\Console\PredictProgram.cs (1)
374System.Type t = objectToConvert.GetType();
Templates\Console\PredictProject.cs (1)
352System.Type t = objectToConvert.GetType();
Microsoft.ML.Core (25)
CommandLine\CmdParser.cs (11)
259var destinationType = destination.GetType(); 282return ParseArguments(env, settings, destination, destination.GetType(), reporter); 295var info = GetArgumentInfo(destination.GetType(), destination); 335Type t1 = values.GetType(); 336Type t2 = defaults.GetType(); 354Type t1 = values.GetType(); 355Type t2 = defaults.GetType(); 374var info = GetArgumentInfo(values.GetType(), null); 1927var type = value.GetType(); 2035var type = value.GetType(); 2110var type = value.GetType();
ComponentModel\ComponentCatalog.cs (1)
1087var key = (AttributeType: attribute.GetType(), attribute.ContractName);
Data\ServerChannel.cs (1)
186var field = factory.GetType().GetField("Port");
EntryPoints\EntryPointUtils.cs (1)
56foreach (var fieldInfo in args.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
EntryPoints\ModuleArgs.cs (6)
238_type = val.GetType(); 241Contracts.Check(_type == val.GetType(), "All Range attribute values must be of the same type"); 374var type = o.GetType(); 395return $"[TlcModule.{GetType().Name}({name}new object[]{{{string.Join(", ", Options.Select(TranslateOption))}}})]"; 448return $"[TlcModule.{GetType().Name}({name}{Min}f, {Max}f{optional})]"; 499return $"[TlcModule.{GetType().Name}({name}{Min}, {Max}{optional})]";
SearchSpace\ChoiceAttribute.cs (3)
22var candidatesType = candidates.Select(o => o.GetType()).Distinct(); 33var candidatesType = candidates.Select(o => o.GetType()).Distinct(); 35Contract.Assert(candidatesType.First() == defaultValue.GetType(), "candidates type doesn't match with defaultValue type");
Utilities\ResourceManagerUtils.cs (1)
315if (request.GetType() == typeof(FileWebRequest))
Utilities\Utils.cs (1)
1248Type type = value.GetType();
Microsoft.ML.Data (63)
Commands\ShowSchemaCommand.cs (1)
94writer.WriteLine("---- {0} ----", view.GetType().Name);
Data\DataViewTypeManager.cs (3)
60typeAttributes = typeAttributes.Where(attr => attr.GetType().IsSubclassOf(typeof(DataViewTypeAttribute))); 95typeAttributes = typeAttributes.Where(attr => attr.GetType().IsSubclassOf(typeof(DataViewTypeAttribute))); 157if (!attr.GetType().IsSubclassOf(typeof(DataViewTypeAttribute)))
Data\DataViewUtils.cs (2)
1132$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'."); 1323$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
DataLoadSave\Binary\BinaryLoader.cs (1)
2043$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
DataLoadSave\Binary\BinarySaver.cs (1)
851_host.CheckParam(value.GetType() == type.RawType, nameof(value), "Value doesn't match type");
DataLoadSave\Database\DatabaseLoaderCursor.cs (1)
167$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
DataLoadSave\Text\TextLoaderCursor.cs (1)
326$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
DataLoadSave\Transpose\TransposeLoader.cs (2)
697$"expected type: '{_getter.GetType().GetGenericArguments().First().GetGenericArguments().First()}'."); 891$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
DataView\AppendRowsDataView.cs (1)
197$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
DataView\ArrayDataViewBuilder.cs (1)
88values.GetType().GetElementType().TryGetDataKind(out InternalDataKind kind);
DataView\BatchDataViewMapperBase.cs (1)
126$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
DataView\CacheDataView.cs (1)
1213$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
DataView\DataViewConstructionUtils.cs (1)
438$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
DataView\RowToRowMapperTransform.cs (2)
341$"expected type: '{originFn.GetType().GetGenericArguments().First()}'."); 408$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
DataView\Transposer.cs (3)
321$"expected type: '{_getter.GetType().GetGenericArguments().First().GetGenericArguments().First()}'."); 1175$"expected type: '{originFn.GetType().GetGenericArguments().First()}'."); 1508$"expected type: '{_getter.GetType().GetGenericArguments().First()}'.");
Dirty\PredictorUtils.cs (13)
30writer.WriteLine("'{0}' does not support saving summary", predictor.GetType().Name); 31ch.Error("'{0}' does not support saving summary", predictor.GetType().Name); 55writer.WriteLine("'{0}' does not support saving in text format, writing out model summary instead", predictor.GetType().Name); 57predictor.GetType().Name); 62writer.WriteLine("'{0}' does not support saving in text format", predictor.GetType().Name); 63ch.Error("'{0}' doesn't currently have standardized text format for /mt", predictor.GetType().Name); 76ch.Error("'{0}' doesn't currently have standardized binary format for /mb", predictor.GetType().Name); 102writer.WriteLine("'{0}' does not support saving in INI format, writing out model summary instead", predictor.GetType().Name); 104predictor.GetType().Name); 109writer.WriteLine("'{0}' does not support saving in INI format", predictor.GetType().Name); 110ch.Error("'{0}' doesn't currently have standardized INI format output", predictor.GetType().Name); 129writer.WriteLine("'{0}' does not support saving in code.", predictor.GetType().Name); 130ch.Error("'{0}' doesn't currently support saving the model as code", predictor.GetType().Name);
EntryPoints\EntryPointNode.cs (4)
234_ectx.Assert(value == null || Type.IsAssignableFrom(value.GetType())); 544var inputColName = inputInstance.GetType().GetField(colField).GetValue(inputInstance); 854_host.Assert(bindings.Skip(1).All(binding => binding.GetType().Equals(firstBinding.GetType())));
EntryPoints\InputBuilder.cs (5)
220Contracts.Check(instance.GetType() == _type); 276var type = instanceVal.GetType(); 356var deftype = defaultsVal.GetType(); 540throw ectx.Except($"Unexpected value type: {value.GetType()}"); 719_ectx.Check(output.GetType() == _type);
EntryPoints\SummarizePredictor.cs (1)
89bldr.AddColumn("PredictorName", predictor.GetType().ToString());
Model\Pfa\SavePfaCommand.cs (1)
112ch.Warning("Had to stop walkback of pipeline at {0} since it cannot save itself as PFA", transform.GetType().Name);
Prediction\Calibrator.cs (4)
819Type[] genericTypeArgs = { predictor.GetType(), calibrator.GetType() }; 825predictor.GetType(), 826calibrator.GetType()
Scorers\PredictionTransformer.cs (2)
790var genericCtor = CreateConstructor(model.GetType(), predictionTransformerType); 801var genericCtor = CreateConstructor(model.GetType(), predictionTransformerType);
Scorers\RowToRowScorerBase.cs (1)
304$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
TrainCatalog.cs (1)
121var type = o.GetType();
Training\TrainerUtils.cs (1)
452throw _env.Except($"Training resulted in a model of type {model.GetType().Name}.");
Transforms\GenerateNumberTransform.cs (1)
447$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
Transforms\LabelConvertTransform.cs (1)
228$"expected type: '{_getter.GetType().GetGenericArguments().First().GetGenericArguments().First()}'.");
Transforms\NAFilter.cs (1)
433$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
Transforms\PerGroupTransformBase.cs (1)
309$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
Transforms\RangeFilter.cs (1)
328$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
Transforms\RowShufflingTransformer.cs (1)
721$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
Transforms\TransformBase.cs (2)
237$"expected type: '{originFn.GetType().GetGenericArguments().First()}'."); 911$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
Microsoft.ML.DataView (1)
DataViewSchema.cs (1)
215throw new ArgumentNullException(nameof(getter), $"Getter of type '{typeof(TValue)}' expected, but {getter.GetType()} found");
Microsoft.ML.Ensemble (4)
Selector\SubModelSelector\BaseBestPerformanceSelector.cs (1)
49Contracts.Assert(value.GetType() == type);
Selector\SubModelSelector\BaseSubModelSelector.cs (1)
48ch.Info("| {0} |{1}", metric, model.Predictor.GetType().Name);
Trainer\EnsembleModelParametersBase.cs (1)
158writer.WriteLine("The Model {0} does not support saving summaries", Models[i].GetType().Name);
Trainer\EnsembleTrainerBase.cs (1)
218ch.Info("{0}{1}", string.Join("", model.Metrics.Select(m => string.Format("| {0} |", m.Value))), model.Predictor.GetType().Name);
Microsoft.ML.EntryPoints (4)
JsonUtils\ExecuteGraphCommand.cs (2)
171if (ipmArray != null && !ipmArray.GetType().IsValueType) 178if (idvArray != null && !idvArray.GetType().IsValueType)
JsonUtils\JsonManifestUtils.cs (2)
429ja.Add(BuildValueToken(ectx, item, item.GetType(), catalog)); 458var type = value.GetType();
Microsoft.ML.FastTree (6)
Dataset\Dataset.cs (5)
409Type arrayDataType = Data.GetType().GetElementType(); 679Type arrayDataType = qddata.Data.GetType().GetElementType(); 841Type t = arrays.First(x => x != null).GetType().GetElementType(); 843if (arrays.Any(x => x != null && t != x.GetType().GetElementType())) 845IEnumerable<string> typeNameEnumerable = arrays.Select(x => x.GetType().GetElementType()).Distinct().Select(x => x.Name).OrderBy(n => n);
Utils\FastTreeIniFileUtils.cs (1)
50newSection.AppendLine("Type=" + calibrator.GetType().Name);
Microsoft.ML.GenAI.Core (1)
CausalLMPipelineChatClient.cs (1)
88serviceType.IsAssignableFrom(GetType()) ? this :
Microsoft.ML.GenAI.LLaMA (1)
Llama3_1ChatTemplateBuilder.cs (1)
69throw new NotSupportedException($"Only text content is supported, but got {item.GetType().Name}");
Microsoft.ML.GenAI.Phi (1)
Phi3\Phi3ChatTemplateBuilder.cs (1)
72throw new NotSupportedException($"Only text content is supported, but got {item.GetType().Name}");
Microsoft.ML.IntegrationTests (4)
Debugging.cs (1)
152rowSum += (float)row.GetType().GetProperty(property).GetValue(row, null);
IntegrationTestBaseClass.cs (1)
53ITest test = (ITest)output.GetType().GetField("test", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(output);
IntrospectiveTraining.cs (1)
375string value = (string)row.GetType().GetProperty(Adult.CategoricalFeatures[i]).GetValue(row, null);
Prediction.cs (1)
117var field = model.GetType().BaseType.BaseType.GetField("_disposed", bfIsDisposed);
Microsoft.ML.InternalCodeAnalyzer (1)
InstanceInitializerAnalyzer.cs (1)
52var typeInfo = symbol.GetType().GetTypeInfo();
Microsoft.ML.KMeansClustering (1)
KMeansModelParameters.cs (1)
139WarnOnOldNormalizer(ctx, GetType(), Host);
Microsoft.ML.LightGbm (2)
LightGbmArguments.cs (1)
179FieldInfo[] fields = BoosterOptions.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
LightGbmTrainerBase.cs (1)
417Type optionsType = LightGbmTrainerOptions.GetType();
Microsoft.ML.Maml (1)
HelpCommand.cs (1)
243writer.WriteLine(CmdParser.ArgumentsUsage(_env, args.GetType(), args, false, columns));
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
151ch.Warning("Had to stop walkback of pipeline at {0} since it cannot save itself as ONNX.", transform.GetType().Name);
Microsoft.ML.Parquet (3)
ParquetLoader.cs (2)
606$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'."); 763if (enu.Current is IList && enu.Current.GetType().IsGenericType)
PartitionedFileLoader.cs (1)
428$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
Microsoft.ML.PCA (1)
PcaTrainer.cs (1)
514WarnOnOldNormalizer(ctx, GetType(), Host);
Microsoft.ML.Predictor.Tests (1)
CmdLine\CmdLine.cs (1)
103wrt.WriteLine(CmdParser.ArgumentsUsage(env, defaults.GetType(), defaults, false, 200));
Microsoft.ML.SearchSpace (1)
Parameter.cs (1)
183Enum e => Parameter.FromEnum(e, e.GetType()),
Microsoft.ML.StandardTrainers (6)
LdSvm\LdSvmModelParameters.cs (1)
119WarnOnOldNormalizer(ctx, GetType(), Host);
Standard\LinearModelParameters.cs (4)
203WarnOnOldNormalizer(ctx, GetType(), Host); 329Type type = GetType(); 331Contracts.Check(type == models[0].GetType(), "Submodel for parameter mixer has the wrong type"); 341Contracts.Check(type == m.GetType(), "Submodel for parameter mixer has the wrong type");
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
604WarnOnOldNormalizer(ctx, GetType(), Host);
Microsoft.ML.TestFramework (2)
BaseTestClass.cs (1)
61ITest test = (ITest)output.GetType().GetField("test", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(output);
SubComponent.cs (1)
218var dst = Create(type ?? src.GetType());
Microsoft.ML.Tests (10)
CalibratedModelParametersTests.cs (9)
39Assert.Equal(expectedInternalType, castedModel.Model.GetType()); 40Assert.Equal(model.Model.GetType(), castedModel.Model.GetType()); 61Assert.Equal(expectedInternalType, castedModel.Model.GetType()); 62Assert.Equal(model.Model.GetType(), castedModel.Model.GetType()); 84Assert.Equal(expectedInternalType, castedModel.Model.GetType()); 85Assert.Equal(model.Model.GetType(), castedModel.Model.GetType());
CollectionsDataViewTest.cs (1)
101if (!CompareObjectValues(x.GetValue(i), y.GetValue(i), x.GetType().GetElementType()))
Microsoft.ML.TimeSeries (2)
SequentialTransformerBase.cs (2)
995$"expected type: '{originFn.GetType().GetGenericArguments().First()}'."); 1067$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
Microsoft.ML.TorchSharp (4)
AutoFormerV2\AutoformerV2.cs (4)
66if (layer.GetType() == typeof(BatchNorm2d)) 100if (layer.GetType() == typeof(Linear)) 112else if (layer.GetType() == typeof(LayerNorm)) 124else if (layer.GetType() == typeof(BatchNorm2d))
Microsoft.ML.Transforms (17)
Expression\BuiltinFunctions.cs (1)
37Type type = v.GetType();
Expression\LambdaBinder.cs (3)
1429if (res != null && res.GetType() != best.Method.ReturnType) 1433node.Head.Value, best.Provider.NameSpace, res.GetType(), best.Method.ReturnType)); 1456_host.Assert(res.GetType() == best.Method.ReturnType);
Expression\Node.cs (1)
335Contracts.Assert(value == null || value.GetType() == ToSysType(kind));
ExpressionTransformer.cs (2)
427var types = _columns[iinfo].Del.GetType().GetGenericArguments(); 569var types = _columns[iinfo].Del.GetType().GetGenericArguments();
MissingValueReplacing.cs (5)
249Host.Assert(repValue.GetType() == _replaceTypes[i].RawType || repValue.GetType() == _replaceTypes[i].GetItemType().RawType); 519Host.Assert(repValue.GetType() == _replaceTypes[iinfo].RawType || repValue.GetType() == _replaceTypes[iinfo].GetItemType().RawType); 520var meth = func.GetMethodInfo().GetGenericMethodDefinition().MakeGenericMethod(repValue.GetType());
OptionalColumnTransform.cs (1)
493$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
PermutationFeatureImportanceExtensions.cs (1)
684var predictionTransformerGenericType = GetImplementedIPredictionTransformer(lastTransformer.GetType());
ProduceIdTransform.cs (1)
223$"expected type: '{idGetter.GetType().GetGenericArguments().First()}'.");
StatefulCustomMappingTransformer.cs (1)
326$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
SvmLight\SvmLightLoader.cs (1)
487$"expected type: '{_getter.GetType().GetGenericArguments().First()}'.");
Microsoft.TestUtilities (1)
XUnit\ConditionalTheoryDiscoverer.cs (1)
57var type = obj.GetType();
Microsoft.VisualBasic.Core (84)
Microsoft\VisualBasic\Collection.vb (2)
470If obj1.GetType() Is obj2.GetType() Then
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (1)
150Debug.Assert(GetTypeCode(Result.GetType()) = tc, "Widest type is invalid")
Microsoft\VisualBasic\CompilerServices\Conversions.vb (7)
2457Debug.Assert(IsIntrinsicType(Expression.GetType) OrElse IsEnum(Expression.GetType), "this function converts between intrinsic types only") 2516Dim SourceType As Type = Expression.GetType 2581Dim SourceType As Type = Expression.GetType 2639InvocationResult.GetType().Equals(TargetType.GetGenericArguments()(0))) Then 2641Dim PostConversion As ConversionClass = ClassifyPredefinedConversion(TargetType, InvocationResult.GetType) 2676Dim SourceType As Type = Expression.GetType
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (2)
1461CType(c.GetType().GetField("Target").GetValue(c), System.Delegate) 1488CType(c.GetType().GetField("Target").GetValue(c), System.Delegate)
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (11)
80objType = o.GetType() 279objType = o.GetType() 398indexTypes(i) = oArg.GetType() 505objType = o.GetType() 722If RValueBase AndAlso o.GetType().IsValueType Then 723Throw New Exception(SR.Format(SR.RValueBaseForValueType, o.GetType().Name, o.GetType().Name)) 741objType = o.GetType() 767If Not NewValue.GetType() Is elemType Then 963objType = o.GetType() 1165If (Value Is Nothing) OrElse Member.DeclaringType.IsAssignableFrom(Value.GetType) Then
Microsoft\VisualBasic\CompilerServices\ObjectFlowControl.vb (12)
25If Expression IsNot Nothing AndAlso Expression.GetType.IsValueType() Then 27SR.Format(SR.SyncLockRequiresReferenceType1, VBFriendlyName(Expression.GetType))) 155Dim startType As Type = Start.GetType() 156Dim limitType As Type = Limit.GetType() 157Dim stepType As Type = StepValue.GetType() 269Dim counterTypeCode As TypeCode = Counter.GetType.GetTypeCode 290Counter = ConvertLoopElement("Start", Counter, Counter.GetType(), loopFor._widestType) 293loopFor._limit = ConvertLoopElement("Limit", loopFor._limit, loopFor._limit.GetType(), loopFor._widestType) 294loopFor._stepValue = ConvertLoopElement("Step", loopFor._stepValue, loopFor._stepValue.GetType(), loopFor._widestType) 301Dim resultTypeCode As TypeCode = loopFor._counter.GetType.GetTypeCode ' CType(LoopFor.Counter, IConvertible).GetTypeCode() 324If loopFor._counter.GetType() IsNot loopFor._widestType Then 325loopFor._counter = ConvertLoopElement("Start", loopFor._counter, loopFor._counter.GetType(), loopFor._widestType)
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (11)
1145Type1 = obj.GetType() 1153Type1 = obj.GetType() 1161Type1 = obj.GetType() 1169Type1 = obj.GetType() 1216Type1 = obj1.GetType() 1220Type2 = obj2.GetType() 1313Type1 = obj1.GetType() 1317Type2 = obj2.GetType() 1410Type1 = obj1.GetType() 1414Type2 = obj2.GetType() 3529fromType = obj.GetType()
Microsoft\VisualBasic\CompilerServices\Operators.Resolution.vb (3)
140rightType = arguments(1).GetType 144leftType = arguments(0).GetType 148rightType = arguments(1).GetType
Microsoft\VisualBasic\CompilerServices\Operators.vb (15)
47Return o.GetType.GetTypeCode 56Debug.Assert(left Is Nothing OrElse right Is Nothing OrElse left.GetType.GetTypeCode = right.GetType.GetTypeCode, 65Return left.GetType 68Dim leftType As Type = left.GetType 69If leftType Is right.GetType Then 78Return right.GetType 1143Return NotSByte(Convert.ToSByte(Operand), Operand.GetType()) 1146Return NotByte(Convert.ToByte(Operand), Operand.GetType()) 1149Return NotInt16(Convert.ToInt16(Operand), Operand.GetType()) 1152Return NotUInt16(Convert.ToUInt16(Operand), Operand.GetType()) 1155Return NotInt32(Convert.ToInt32(Operand), Operand.GetType()) 1158Return NotUInt32(Convert.ToUInt32(Operand), Operand.GetType()) 1161Return NotInt64(Convert.ToInt64(Operand), Operand.GetType()) 1164Return NotUInt64(Convert.ToUInt64(Operand), Operand.GetType())
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (1)
2139Return argument.GetType
Microsoft\VisualBasic\CompilerServices\StructUtils.vb (1)
35typ = oStruct.GetType()
Microsoft\VisualBasic\CompilerServices\Symbols.vb (1)
788_type = instance.GetType
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (2)
338Return VBFriendlyName(obj.GetType, obj) 525Dim defaultValueType As System.Type = defaultValue.GetType
Microsoft\VisualBasic\CompilerServices\VB6File.vb (3)
872Return VTFromComType(VarName.GetType()) 2157typ = obj.GetType() 2251CurrentType = value.GetType()
Microsoft\VisualBasic\CompilerServices\VB6RandomFile.vb (2)
206typ = Value.GetType 445typ = Value.GetType
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (1)
528ArgTypes(ArgIndex) = args(ArgIndex).GetType()
Microsoft\VisualBasic\CompilerServices\Versioned.vb (1)
114typ = Expression.GetType()
Microsoft\VisualBasic\Conversion.vb (2)
167Throw VbMakeException(New ArgumentException(SR.Format(SR.Argument_NotNumericType2, NameOf(Number), Number.GetType().FullName)), vbErrors.TypeMismatch) 240Throw VbMakeException(New ArgumentException(SR.Format(SR.Argument_NotNumericType2, NameOf(Number), Number.GetType().FullName)), vbErrors.TypeMismatch)
Microsoft\VisualBasic\Information.vb (2)
255Return VarTypeFromComType(VarName.GetType()) 434typ = VarName.GetType()
Microsoft\VisualBasic\Strings.vb (4)
1242If (Expression Is Nothing) OrElse (Expression.GetType() Is Nothing) Then 1364typ = Expression.GetType() 1441typ = Expression.GetType() 1803typ = Expression.GetType()
Microsoft.VisualStudio.LanguageServices (19)
artifacts\obj\Microsoft.VisualStudio.LanguageServices\Release\net472\GeneratedInternalTypeHelper.g.cs (1)
47return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
CallHierarchy\Finders\AbstractCallFinder.cs (1)
58var asyncToken = _asyncListener.BeginAsyncOperation(this.GetType().Name + ".Search");
ChangeSignature\ChangeSignatureDialogViewModel.cs (1)
375throw ExceptionUtilities.UnexpectedValue(parameter.GetType().ToString());
DebuggerIntelliSense\DebuggerTextView.HACK_CompletionSession.cs (2)
51var shimController = propertyList.Single(x => x.Value != null && x.Value.GetType().Name == "ShimCompletionController").Value; 52var shimControllerType = shimController.GetType();
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.cs (4)
65var extensionManagerType = _extensionManager.GetType(); 71var extensionType = extension.GetType(); 74var extension_HeaderType = extension_Header.GetType(); 121var contentType = content.GetType();
Interactive\VsInteractiveWindowProvider.cs (2)
154c => c.GetType().GetCustomAttributes(typeof(ContentTypeAttribute), inherit: true).Any( 159c => c.GetType().GetCustomAttributes(typeof(ContentTypeAttribute), inherit: true).Any(
LanguageClient\LogHubLspLogger.cs (1)
30Contract.Fail($"{GetType().FullName} was double disposed");
Log\VisualStudioErrorLogger.cs (1)
26var name = source.GetType().Name;
Options\VisualStudioSettingsOptionPersister.cs (1)
226var type = value.GetType();
Packaging\PackageInstallerServiceFactory_UndoRedo.cs (1)
98var token = this.packageInstallerService._listener.BeginAsyncOperation($"{GetType().Name}.{nameof(Do)}");
ProjectSystem\InvisibleEditor.cs (2)
130throw new ObjectDisposedException(GetType().Name); 190=> Debug.Assert(Environment.HasShutdownStarted, GetType().Name + " was leaked without Dispose being called.");
Snippets\AbstractSnippetInfoService.cs (1)
117using var token = _waiter.BeginAsyncOperation(GetType().Name + ".Start");
Venus\ContainedLanguage.IVsContainedLanguage.cs (1)
54var field = intellisenseHost.GetType().GetField("_simpleTextViewWindow", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
artifacts\obj\Microsoft.VisualStudio.LanguageServices.CSharp\Release\net472\GeneratedInternalTypeHelper.g.cs (1)
47return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
CodeModel\FileCodeFunctionTests.cs (1)
227Assert.True(testObject.Parent is CodeClass, testObject.Parent.GetType().ToString());
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
CodeModel\AbstractCodeElementTests`1.vb (1)
454Dim type = obj.GetType()
MSBuild (13)
ErrorUtilities.cs (2)
105if (String.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal)) 107ThrowInternalError("This type does not implement ToString() properly {0}", param.GetType().FullName!);
LogMessagePacketBase.cs (2)
417Type eventDerivedType = _buildEvent.GetType(); 616Type eventType = eventArg.GetType();
OutOfProcTaskAppDomainWrapperBase.cs (2)
328PropertyInfo paramInfo = wrappedTask.GetType().GetProperty(param.Key, BindingFlags.Instance | BindingFlags.Public); 358PropertyInfo[] finalPropertyValues = wrappedTask.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
OutOfProcTaskHostNode.cs (2)
1198if (!e.GetType().GetTypeInfo().IsSerializable && e is not IExtendedBuildEventArgs) 1203LogWarningFromResource("ExpectedEventToBeSerializable", e.GetType().Name);
ResourceUtilities.cs (3)
435if (string.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal) && 436param.GetType() != typeof(string)) 440param.GetType().FullName);
TaskParameter.cs (1)
103Type wrappedParameterType = wrappedParameter.GetType();
XMake.cs (1)
1351Type t1 = loggers[0].GetType();
MSBuildTaskHost (18)
BinaryTranslator.cs (1)
496Type enumType = value.GetType();
D\a\_work\1\s\bin\repo\msbuild\src\Shared\ErrorUtilities.cs\ErrorUtilities.cs (2)
105if (String.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal)) 107ThrowInternalError("This type does not implement ToString() properly {0}", param.GetType().FullName!);
LogMessagePacketBase.cs (3)
417Type eventDerivedType = _buildEvent.GetType(); 486Type eventDerivedType = _buildEvent.GetType(); 616Type eventType = eventArg.GetType();
OutOfProcTaskAppDomainWrapperBase.cs (2)
328PropertyInfo paramInfo = wrappedTask.GetType().GetProperty(param.Key, BindingFlags.Instance | BindingFlags.Public); 358PropertyInfo[] finalPropertyValues = wrappedTask.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
OutOfProcTaskHostNode.cs (2)
1198if (!e.GetType().GetTypeInfo().IsSerializable && e is not IExtendedBuildEventArgs) 1203LogWarningFromResource("ExpectedEventToBeSerializable", e.GetType().Name);
ResourceUtilities.cs (3)
435if (string.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal) && 436param.GetType() != typeof(string)) 440param.GetType().FullName);
TaskLoader.cs (1)
136Type taskType = taskInstanceInOtherAppDomain.GetType();
TaskParameter.cs (1)
103Type wrappedParameterType = wrappedParameter.GetType();
Traits.cs (3)
587if (string.Equals(param.GetType().ToString(), param.ToString(), StringComparison.Ordinal) && 588param.GetType() != typeof(string)) 591param.GetType().FullName);
Mvc.Api.Analyzers.Test (24)
ActualApiResponseMetadataFactoryTest.cs (6)
69var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { source }); 364var testSource = MvcTestSource.Read(GetType().Name, "TryGetActualResponseMetadataTests"); 365var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source }); 405var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { source }); 424var testSource = MvcTestSource.Read(GetType().Name, test); 425var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
AddResponseTypeAttributeCodeFixProviderIntegrationTest.cs (2)
84return MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource }); 89return MvcTestSource.Read(GetType().Name, fileName)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest.cs (2)
52var testSource = MvcTestSource.Read(GetType().Name, testMethod); 66var testSource = MvcTestSource.Read(GetType().Name, testMethod);
ApiActionsDoNotRequireExplicitModelValidationCheckCodeFixProviderTest.cs (2)
49return MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource }); 54return MvcTestSource.Read(GetType().Name, fileName)
ApiControllerFactsTest.cs (3)
34var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { source }); 128var testSource = MvcTestSource.Read(GetType().Name, testFile); 129var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
ApiConventionAnalyzerIntegrationTest.cs (2)
263var testSource = MvcTestSource.Read(GetType().Name, testMethod); 282var testSource = MvcTestSource.Read(GetType().Name, testMethod);
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (1)
22var project = CreateProjectWithReferencesInBinDir(GetType().Assembly, source);
MvcFactsTest.cs (2)
222var testSource = MvcTestSource.Read(GetType().Name, test); 223var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
SymbolApiConventionMatcherTest.cs (2)
555var testSource = MvcTestSource.Read(GetType().Name, test); 556var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
SymbolApiResponseMetadataProviderTest.cs (2)
476var testSource = MvcTestSource.Read(GetType().Name, test); 477var project = MvcDiagnosticAnalyzerRunner.CreateProjectWithReferencesInBinDir(GetType().Assembly, new[] { testSource.Source });
Mvc.RoutingWebSite (1)
Controllers\RouteDataController.cs (1)
38var routers = RouteData.Routers.Select(r => r.GetType().FullName).ToArray();
PresentationBuildTasks (7)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (2)
4696|| (KnownTypes.Types[(int)KnownElements.DependencyProperty].IsAssignableFrom(propertyMember.GetType())), 4738KnownTypes.Types[(int)KnownElements.DependencyProperty].IsAssignableFrom(PropertyMember.GetType( )) )
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (1)
1750_previousXamlParser.GetType() != typeof(StyleXamlParser); }
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (2)
1182baseType = dynamicObject.GetType(); 5247_xmlReader.GetType().FullName);
src\Microsoft.DotNet.Wpf\src\WindowsBase\System\IO\Packaging\CompoundFile\VersionPair.cs (2)
246if (obj.GetType() != GetType())
PresentationCore (227)
MS\Internal\Ink\ExtendedProperty.cs (5)
39if (obj == null || obj.GetType() != GetType()) 48Type type1 = this.Value.GetType(); 49Type type2 = that.Value.GetType(); 174Type type = _value.GetType();
MS\Internal\Ink\ExtendedPropertyCollection.cs (2)
24if (o == null || o.GetType() != GetType())
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (10)
61interopTypeInfo = SerializationHelper.ConvertToVarEnum(attribute.Value.GetType(), true); 786if (!(value.GetType() == typeof(int))) 794if (value.GetType() != typeof(DrawingFlags)) 801Type valueType = value.GetType(); 819Type t = value.GetType(); 843if ( value.GetType() != typeof(bool)) 850if ( value.GetType() != typeof(double) ) 874if ( value.GetType() != typeof(byte) ) 887if ( value.GetType() != typeof(byte[]) ) 895VarEnum varEnum = SerializationHelper.ConvertToVarEnum(value.GetType(), true);
MS\Internal\Ink\StrokeFIndices.cs (2)
92if (obj == null || GetType() != obj.GetType())
MS\Internal\Ink\StrokeIntersection.cs (2)
107if (obj == null || GetType() != obj.GetType())
MS\Internal\Media\VisualTreeUtils.cs (3)
177Debug.Fail(String.Format("Unhandled HitTestResult type '{0}'", result.GetType().Name)); 253throw new System.InvalidOperationException(SR.Format(SR.Visual_NotAVisual, element.GetType())); 283element?.GetType()));
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\PerfService.cs (1)
38Type type = key.GetType();
System\Windows\DataObjectExtensions.cs (1)
23dataObject.GetType().FullName));
System\Windows\Diagnostics\XamlSourceInfoHelper.cs (1)
113if (obj is string || obj.GetType().IsValueType)
System\Windows\FreezableCollection.cs (3)
496throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 639throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "T"));
System\Windows\Generated\ContentElement.cs (6)
71throw new ArgumentException(SR.Format(SR.Animation_DependencyPropertyIsNotAnimatable, dp.Name, this.GetType()), nameof(dp)); 77throw new ArgumentException(SR.Format(SR.Animation_AnimationTimelineTypeMismatch, clock.Timeline.GetType(), dp.Name, dp.PropertyType), nameof(clock)); 87throw new InvalidOperationException(SR.Format(SR.IAnimatable_CantAnimateSealedDO, dp, this.GetType())); 136throw new ArgumentException(SR.Format(SR.Animation_DependencyPropertyIsNotAnimatable, dp.Name, this.GetType()), nameof(dp)); 142throw new ArgumentException(SR.Format(SR.Animation_AnimationTimelineTypeMismatch, animation.GetType(), dp.Name, dp.PropertyType), nameof(animation)); 152throw new InvalidOperationException(SR.Format(SR.IAnimatable_CantAnimateSealedDO, dp, this.GetType()));
System\Windows\Generated\TextDecorationCollection.cs (3)
408throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 497throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "TextDecoration"));
System\Windows\Generated\UIElement.cs (6)
71throw new ArgumentException(SR.Format(SR.Animation_DependencyPropertyIsNotAnimatable, dp.Name, this.GetType()), nameof(dp)); 77throw new ArgumentException(SR.Format(SR.Animation_AnimationTimelineTypeMismatch, clock.Timeline.GetType(), dp.Name, dp.PropertyType), nameof(clock)); 87throw new InvalidOperationException(SR.Format(SR.IAnimatable_CantAnimateSealedDO, dp, this.GetType())); 136throw new ArgumentException(SR.Format(SR.Animation_DependencyPropertyIsNotAnimatable, dp.Name, this.GetType()), nameof(dp)); 142throw new ArgumentException(SR.Format(SR.Animation_AnimationTimelineTypeMismatch, animation.GetType(), dp.Name, dp.PropertyType), nameof(animation)); 152throw new InvalidOperationException(SR.Format(SR.IAnimatable_CantAnimateSealedDO, dp, this.GetType()));
System\Windows\Ink\DrawingAttributes.cs (3)
500if (o == null || o.GetType() != this.GetType()) 705Type t = propertyData.GetType();
System\Windows\Input\Command\CommandManager.cs (3)
317Type classType = targetElement.GetType(); 366Type classType = targetElement.GetType(); 547Type senderType = sender.GetType();
System\Windows\Input\Command\RoutedCommand.cs (2)
122throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, target.GetType())); 158throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, target.GetType()));
System\Windows\Input\FocusChangedEventArgs.cs (2)
29throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, oldFocus.GetType())); 32throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, newFocus.GetType()));
System\Windows\Input\KeyboardDevice.cs (3)
120throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, element.GetType())); 406throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, o.GetType())); 432throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, o.GetType()));
System\Windows\Input\MouseDevice.cs (2)
299throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, eltDO.GetType())); 546throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, relativeTo.GetType()));
System\Windows\Input\Stylus\Pointer\PointerLogic.cs (5)
535throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, oldCapture.GetType())); 561throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, _stylusCapture.GetType())); 626throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, oldOver.GetType())); 655throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, _stylusOver.GetType())); 791throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, _stylusCapture.GetType()));
System\Windows\Input\Stylus\Pointer\PointerStylusDevice.cs (1)
552throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, doStylusCapture.GetType()));
System\Windows\Input\Stylus\Wisp\WispLogic.cs (5)
2087throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, oldCapture.GetType())); 2116throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, _stylusCapture.GetType())); 2175throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, oldOver.GetType())); 2204throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, _stylusOver.GetType())); 2444throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, _stylusCapture.GetType()));
System\Windows\Input\Stylus\Wisp\WispStylusDevice.cs (2)
245throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, doStylusCapture.GetType())); 1162throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, relativeTo.GetType()));
System\Windows\Input\TouchDevice.cs (1)
331throw new ArgumentException(SR.Format(SR.Invalid_IInputElement, element.GetType()), nameof(element));
System\Windows\InterOp\HwndMouseInputProvider.cs (1)
1121Type type = rootVisual?.GetType();
System\Windows\Media\Animation\AnimationStorage.cs (3)
492target.GetType().FullName, 493((AnimationClock)sender).Timeline.GetType().FullName), 989d.GetType().FullName));
System\Windows\Media\Animation\Clock.cs (2)
585timeline.GetType().Name)); 4317builder.Append(GetType().Name);
System\Windows\Media\Animation\Generated\Animatable.cs (6)
70throw new ArgumentException(SR.Format(SR.Animation_DependencyPropertyIsNotAnimatable, dp.Name, this.GetType()), nameof(dp)); 76throw new ArgumentException(SR.Format(SR.Animation_AnimationTimelineTypeMismatch, clock.Timeline.GetType(), dp.Name, dp.PropertyType), nameof(clock)); 86throw new InvalidOperationException(SR.Format(SR.IAnimatable_CantAnimateSealedDO, dp, this.GetType())); 135throw new ArgumentException(SR.Format(SR.Animation_DependencyPropertyIsNotAnimatable, dp.Name, this.GetType()), nameof(dp)); 141throw new ArgumentException(SR.Format(SR.Animation_AnimationTimelineTypeMismatch, animation.GetType(), dp.Name, dp.PropertyType), nameof(animation)); 151throw new InvalidOperationException(SR.Format(SR.IAnimatable_CantAnimateSealedDO, dp, this.GetType()));
System\Windows\Media\Animation\Generated\ByteAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\ColorAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\DecimalAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\DoubleAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\Int16Animation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\Int32Animation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\Int64Animation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\Point3DAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\PointAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\QuaternionAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\RectAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\Rotation3DAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\SingleAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\SizeAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\TimelineCollection.cs (3)
407throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 496throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Timeline"));
System\Windows\Media\Animation\Generated\Vector3DAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Generated\VectorAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Timeline.cs (1)
1074builder.Append(GetType().Name);
System\Windows\Media\CharacterMetricsDictionary.cs (3)
199Type elementType = array.GetType().GetElementType(); 500throw new ArgumentException(SR.Format(SR.CannotConvertType, key.GetType(), "int"), nameof(key)); 517throw new ArgumentException(SR.Format(SR.CannotConvertType, typeof(CharacterMetrics), value.GetType()));
System\Windows\Media\CultureSpecificStringDictionary.cs (3)
168Type elementType = array.GetType().GetElementType(); 312throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(string)), nameof(value)); 325throw new ArgumentException(SR.Format(SR.CannotConvertType, key.GetType(), typeof(XmlLanguage)), nameof(key));
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (3)
410throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 499throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "BitmapEffect"));
System\Windows\Media\Effects\Generated\ShaderEffect.cs (1)
147return (Freezable)Activator.CreateInstance(this.GetType());
System\Windows\Media\Effects\ShaderEffect.cs (2)
863Type t = value.GetType(); 945Type t = value.GetType();
System\Windows\Media\FamilyMapCollection.cs (2)
93Type elementType = array.GetType().GetElementType(); 367throw new ArgumentException(SR.Format(SR.CannotConvertType, obj.GetType(), typeof(FontFamilyMap)));
System\Windows\Media\FamilyTypefaceCollection.cs (2)
359throw new ArgumentException(SR.Format(SR.CannotConvertType, obj.GetType(), typeof(FamilyTypeface))); 371Type elementType = array.GetType().GetElementType();
System\Windows\Media\FontFamilyConverter.cs (1)
67if ((o != null) && (o.GetType() == typeof(string)))
System\Windows\Media\Generated\DoubleCollection.cs (3)
382throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 455throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "double"));
System\Windows\Media\Generated\DrawingCollection.cs (3)
429throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 518throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Drawing"));
System\Windows\Media\Generated\GeneralTransformCollection.cs (3)
417throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 506throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "GeneralTransform"));
System\Windows\Media\Generated\GeometryCollection.cs (3)
429throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 518throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Geometry"));
System\Windows\Media\Generated\GradientStopCollection.cs (3)
417throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 506throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "GradientStop"));
System\Windows\Media\Generated\Int32Collection.cs (3)
382throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 455throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "int"));
System\Windows\Media\Generated\PathFigureCollection.cs (3)
418throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 507throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "PathFigure"));
System\Windows\Media\Generated\PathSegmentCollection.cs (3)
417throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 506throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "PathSegment"));
System\Windows\Media\Generated\PointCollection.cs (3)
382throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 455throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Point"));
System\Windows\Media\Generated\TextEffectCollection.cs (3)
417throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 506throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "TextEffect"));
System\Windows\Media\Generated\TransformCollection.cs (3)
429throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 518throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Transform"));
System\Windows\Media\Generated\VectorCollection.cs (3)
382throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 455throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Vector"));
System\Windows\Media\Imaging\BitmapMetadata.cs (2)
1260if (rating != null && rating.GetType() == typeof(ushort)) 1311if (fileTime != null && fileTime.GetType() == typeof(System.Runtime.InteropServices.ComTypes.FILETIME))
System\Windows\Media\Imaging\PropVariant.cs (2)
227Type type = value.GetType(); 314Type type = value.GetType();
System\Windows\Media\Imaging\WriteableBitmap.cs (2)
1074elementType = exemplar.GetType(); 1102elementType = exemplar.GetType();
System\Windows\Media\Visual.cs (2)
1985hitTestParameters.GetType().Name, this.GetType().Name));
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (3)
415throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 504throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "GeneralTransform3D"));
System\Windows\Media3D\Generated\MaterialCollection.cs (3)
427throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 516throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Material"));
System\Windows\Media3D\Generated\Model3DCollection.cs (3)
427throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 516throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Model3D"));
System\Windows\Media3D\Generated\Point3DCollection.cs (3)
380throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 453throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Point3D"));
System\Windows\Media3D\Generated\Transform3DCollection.cs (3)
427throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 516throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Transform3D"));
System\Windows\Media3D\Generated\Vector3DCollection.cs (3)
380throw new ArgumentException(SR.Format(SR.Collection_BadDestArray, this.GetType().Name), e); 453throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Vector3D"));
System\Windows\Media3D\Generated\Visual3D.cs (6)
70throw new ArgumentException(SR.Format(SR.Animation_DependencyPropertyIsNotAnimatable, dp.Name, this.GetType()), nameof(dp)); 76throw new ArgumentException(SR.Format(SR.Animation_AnimationTimelineTypeMismatch, clock.Timeline.GetType(), dp.Name, dp.PropertyType), nameof(clock)); 86throw new InvalidOperationException(SR.Format(SR.IAnimatable_CantAnimateSealedDO, dp, this.GetType())); 135throw new ArgumentException(SR.Format(SR.Animation_DependencyPropertyIsNotAnimatable, dp.Name, this.GetType()), nameof(dp)); 141throw new ArgumentException(SR.Format(SR.Animation_AnimationTimelineTypeMismatch, animation.GetType(), dp.Name, dp.PropertyType), nameof(animation)); 151throw new InvalidOperationException(SR.Format(SR.IAnimatable_CantAnimateSealedDO, dp, this.GetType()));
System\Windows\Media3D\ModelVisual3D.cs (3)
79throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, nameof(Visual3D))); 92throw new System.InvalidOperationException(SR.Format(SR.AddText_Invalid, this.GetType().Name));
System\Windows\Media3D\Viewport3DVisual.cs (1)
495throw new NotSupportedException(SR.Format(SR.HitTest_Invalid, nameof(GeometryHitTestParameters), this.GetType().Name));
System\Windows\Media3D\Visual3D.cs (2)
657hitTestParameters.GetType().Name, this.GetType().Name));
System\Windows\Media3D\Visual3DCollection.cs (2)
450throw new System.ArgumentException(SR.Format(SR.Collection_BadType, this.GetType().Name, value.GetType().Name, "Visual3D"));
System\Windows\PresentationSource.cs (5)
119throw new ArgumentException(SR.Format(SR.Invalid_IInputElement, element.GetType()), nameof(element)); 163throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, o.GetType())); 185throw new ArgumentException(SR.Format(SR.Invalid_IInputElement, e.GetType()), nameof(e)); 244throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, o.GetType())); 699throw new InvalidOperationException(SR.Format(SR.Invalid_IInputElement, doTarget.GetType()));
System\Windows\RoutedEvent.cs (1)
87Type handlerType = handler.GetType();
System\Windows\UIElement.cs (6)
672throw new InvalidOperationException(SR.Format(SR.UIElement_Layout_PositiveInfinityReturned, this.GetType().FullName)); 676throw new InvalidOperationException(SR.Format(SR.UIElement_Layout_NaNReturned, this.GetType().FullName)); 802(parent == null ? "" : parent.GetType().FullName), 803this.GetType().FullName)); 1901throw new ArgumentException(SR.Format(SR.Invalid_IInputElement, d.GetType())); 1937throw new ArgumentException(SR.Format(SR.Invalid_IInputElement, d.GetType()));
PresentationCore.Tests (4)
System\Windows\DataObjectTests.cs (4)
48data.GetData(testData.GetType().FullName!).Should().Be(testData); 95data.GetData(intData.GetType().FullName!).Should().Be(intData); 96data.GetData(stringData.GetType().FullName!).Should().Be(stringData); 109data.GetData(data1.GetType().FullName!).Should().Be(data2);
PresentationFramework (480)
HashHelper.cs (1)
26internal static bool HasReliableHashCode(object item) => item is not null && !s_unreliableTypes.Contains(item.GetType());
MS\Internal\Annotations\Anchoring\AttachedAnnotation.cs (2)
239_selectionProcessor = _locatorManager.GetSelectionProcessor(attachedAnchor.GetType()); 249Debug.Assert(_selectionProcessor != null, SR.Format(SR.NoProcessorForSelectionType, attachedAnchor.GetType()));
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (3)
449throw new ArgumentException(SR.WrongSelectionType, $"selection: type={selection.GetType()}"); 455throw new ArgumentException(SR.WrongSelectionType, $"selection: type={selection.GetType()}"); 475throw new ArgumentException(SR.WrongSelectionType, $"selection: type={selection.GetType()}");
MS\Internal\Annotations\Anchoring\LocatorManager.cs (3)
340SelectionProcessor selProcessor = GetSelectionProcessor(selection.GetType()); 707SelectionProcessor selProcessor = GetSelectionProcessor(selection.GetType()); 1036SelectionProcessor selProcessor = GetSelectionProcessor(selection.GetType());
MS\Internal\Annotations\Anchoring\TextSelectionHelper.cs (2)
72throw new ArgumentException(SR.WrongSelectionType, $"anchor1: type = {anchor1.GetType()}"); 75throw new ArgumentException(SR.WrongSelectionType, $"Anchor2: type = {anchor2.GetType()}");
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (1)
501Type type = component.GetType();
MS\Internal\AppModel\Journaling.cs (3)
538throw new Exception(SR.Format(SR.InvalidPageFunctionType, contentObject.GetType())); 617string typeName = pageFunction.GetType().AssemblyQualifiedName; 649Debug.Assert(contentObject.GetType().AssemblyQualifiedName == this._typeName,
MS\Internal\AppModel\ReturnEventSaver.cs (3)
72returnDelegate.GetType().AssemblyQualifiedName, 73returnDelegate.Target.GetType().AssemblyQualifiedName, 116if (!string.Equals(_returnList[i]._targetTypeName, caller.GetType().AssemblyQualifiedName, StringComparison.Ordinal))
MS\Internal\Data\BindingCollection.cs (1)
114throw new NotSupportedException(SR.Format(SR.BindingCollectionContainsNonBinding, binding.GetType().Name));
MS\Internal\Data\ClrBindingWorker.cs (1)
191ParentBindingExpression.SetupDefaultValueConverter(item.GetType());
MS\Internal\Data\DefaultValueConverter.cs (3)
322((o != null && destinationType.IsAssignableFrom(o.GetType())) || 579if (o != null && _sourceType.IsAssignableFrom(o.GetType())) 617if ((o != null && _targetType.IsAssignableFrom(o.GetType())) ||
MS\Internal\Data\DynamicValueConverter.cs (2)
40Type sourceType = value.GetType(); 65Type targetType = value.GetType();
MS\Internal\Data\EnumerableCollectionView.cs (1)
582TraceData.CollectionChangedWithoutNotification(SourceCollection.GetType().FullName));
MS\Internal\Data\IndexedEnumerable.cs (1)
476Type srcType = collection.GetType();
MS\Internal\Data\PropertyPathWorker.cs (4)
1581throw new InvalidOperationException(SR.Format(SR.CannotWriteToReadOnly, item.GetType(), pi.Name)); 1586throw new InvalidOperationException(SR.Format(SR.CannotWriteToReadOnly, item.GetType(), pd.Name)); 1591throw new InvalidOperationException(SR.Format(SR.CannotWriteToReadOnly, item.GetType(), dp.Name)); 1596throw new InvalidOperationException(SR.Format(SR.CannotWriteToReadOnly, item.GetType(), dpa.PropertyName));
MS\Internal\Data\ValueTable.cs (1)
222pd = TypeDescriptor.GetProperties(item.GetType())[name];
MS\Internal\Data\ViewManager.cs (3)
593collectionViewType.Name, collection.GetType()), e); 834Type cachedViewType = (cvp == null) ? cv.GetType() : cvp.ProxiedView.GetType();
MS\Internal\Data\XDeferredAxisSource.cs (1)
76MemberInfo[] aryMembers = xda.GetType().GetDefaultMembers();
MS\Internal\Data\XmlBindingWorker.cs (2)
549return $"{node.GetType().Name} ({node.Name})"; 557return string.Create(TypeConverterHelper.InvariantEnglishUS, $"{nodeList.GetType().Name} (hash={AvTrace.GetHashCodeHelper(nodeList)} Count={nodeList.Count})");
MS\Internal\DataStreams.cs (1)
243DependencyProperty dp = DependencyProperty.FromName(subStream._propertyName, element.GetType());
MS\Internal\FrameworkObject.cs (1)
65object arg = (d != null) ? (object)d.GetType() : (object)"NULL";
MS\Internal\Helper.cs (10)
291throw new InvalidOperationException(SR.Format(SR.MustBeFrameworkDerived, d.GetType())); 580Type targetType = targetObject.GetType(); 662!memberType.IsAssignableFrom(markupExtension.GetType())) 665markupExtension.GetType().Name, 682if (!typeof(BindingBase).IsAssignableFrom(markupExtension.GetType()) || 683!typeof(Collection<BindingBase>).IsAssignableFrom(targetProperty.GetType())) 686markupExtension.GetType().Name, 687targetProperty.GetType().Name)); 706if (!typeof(BindingBase).IsAssignableFrom(markupExtension.GetType()) || 710markupExtension.GetType().Name,
MS\Internal\Ink\EraserBehavior.cs (2)
171|| _cachedStylusShape.GetType() != InkCanvas.EraserShape.GetType()) )
MS\Internal\Ink\PenCursorManager.cs (1)
63if (stylusShape.GetType() == typeof(RectangleStylusShape))
MS\Internal\Interop\InternalDispatchObject.cs (1)
128throw new MissingMethodException(GetType().Name, name);
MS\Internal\IO\Packaging\ContentDescriptor.cs (2)
37if (other.GetType() != GetType())
MS\Internal\LayoutDump.cs (15)
206writer.WriteStartElement(visual.GetType().Name); 243writer.WriteStartElement(element.GetType().Name); 265Type t = element.GetType(); 298writer.WriteAttributeString("Type", page.GetType().FullName); 314Type t = page.GetType(); 739writer.WriteAttributeString("Type", paragraph.Element.GetType().FullName); 761writer.WriteAttributeString("Type", paragraph.Element.GetType().FullName); 779writer.WriteAttributeString("Type", paragraph.Element.GetType().FullName); 797writer.WriteAttributeString("Type", paragraph.Element.GetType().FullName); 814writer.WriteAttributeString("Type", paragraph.Element.GetType().FullName); 861writer.WriteAttributeString("Type", paragraph.Element.GetType().FullName); 901Type paragraphResultType = paragraph.GetType(); 904Type paraClientType = paraClient.GetType(); 946Type paragraphResultType = paragraph.GetType(); 961Type typeOfCell = cell.GetType();
MS\Internal\Markup\StaticExtension.cs (1)
83throw new ArgumentException(SR.Format(SR.MarkupExtensionNoContext, GetType().Name, "IXamlTypeResolver"));
MS\Internal\PtsHost\ContainerParagraph.cs (1)
1018throw new InvalidOperationException(SR.Format(SR.TextSchema_TextIsNotAllowedInThisContext, Element.GetType().Name));
MS\Internal\Text\TypographyProperties.cs (2)
691if (this.GetType() != other.GetType())
MS\Internal\TraceData.cs (7)
103traceBuilder.Append(objectParam.GetType().Name); 191traceBuilder.AppendFormat("'{0}' (Name='{1}')", fe.GetType().Name, fe.Name); 195traceBuilder.AppendFormat("'{0}' (HashCode={1})", o.GetType().Name, o.GetHashCode()); 248Type type = o.GetType(); 280DependencyProperty dp => $"{dp.GetType().Name}({dp.Name})", 281PropertyInfo pi => $"{pi.GetType().Name}({pi.Name})", 282PropertyDescriptor pd => $"{pd.GetType().Name}({pd.Name})",
MS\Internal\Utility\TraceLog.cs (1)
60return string.Create(CultureInfo.InvariantCulture, $"{o.GetType().Name}.{o.GetHashCode()}");
MS\Internal\WeakHashtable.cs (1)
53Debug.Assert(!key.GetType().IsValueType, "WeakHashtable doesn't support value-type keys. Use WeakObjectHashtable instead.");
MS\Internal\WeakObjectHashtable.cs (1)
50if (key != null && !key.GetType().IsValueType)
MS\Internal\WindowsRuntime\Generated\WinRT\ComWrappersSupport.cs (5)
62Type type = o.GetType(); 103var interfaces = obj.GetType().GetInterfaces(); 132IID = GuidGenerator.GetIID(obj.GetType()), 133Vtable = (IntPtr)obj.GetType().GetHelperType().GetField("AbiToProjectionVftablePtr", BindingFlags.Public | BindingFlags.Static).GetValue(null) 154Type type = obj.GetType();
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (1)
815if (value.GetType() == HelperType)
System\Windows\Application.cs (5)
424if (bamlStream == null || bamlStream.Assembly != component.GetType().Assembly) 426throw new Exception(SR.Format(SR.UriNotMatchWithRootType, component.GetType( ), resourceLocator)); 1680throw new InvalidOperationException(SR.Format(SR.CannotCallRunMultipleTimes, this.GetType().FullName)); 1687throw new ArgumentException(SR.Format(SR.WindowPassedShouldBeOnApplicationThread, window.GetType().FullName, this.GetType().FullName));
System\Windows\Automation\Peers\CalendarAutomationPeer.cs (1)
171return this.Owner.GetType().Name;
System\Windows\Automation\Peers\CalendarButtonAutomationPeer.cs (1)
54return Owner.GetType().Name;
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (1)
71return Owner.GetType().Name;
System\Windows\Automation\Peers\DataGridCellAutomationPeer.cs (1)
47return Owner.GetType().Name;
System\Windows\Automation\Peers\DataGridColumnHeaderAutomationPeer.cs (1)
44return Owner.GetType().Name;
System\Windows\Automation\Peers\DataGridColumnHeadersPresenterAutomationPeer.cs (1)
47return Owner.GetType().Name;
System\Windows\Automation\Peers\DataGridDetailsPresenterAutomationPeer.cs (1)
31return this.Owner.GetType().Name;
System\Windows\Automation\Peers\DataGridRowAutomationPeer.cs (1)
46return Owner.GetType().Name;
System\Windows\Automation\Peers\DataGridRowHeaderAutomationPeer.cs (1)
44return Owner.GetType().Name;
System\Windows\Automation\Peers\DatePickerAutomationPeer.cs (1)
109return Owner.GetType().Name;
System\Windows\Automation\Peers\GridViewCellAutomationPeer.cs (1)
34return Owner.GetType().Name;
System\Windows\Automation\Peers\ItemAutomationPeer.cs (1)
653if (value != null && !value.GetType().IsValueType &&
System\Windows\Automation\Peers\UserControlAutomationPeer.cs (1)
18return Owner.GetType().Name;
System\Windows\ColorConvertedBitmapExtension.cs (1)
92throw new InvalidOperationException(SR.Format(SR.MarkupExtensionNoContext, GetType().Name, "IUriContext" ));
System\Windows\Condition.cs (1)
135value.GetType().Name));
System\Windows\Controls\AdornedElementPlaceholder.cs (3)
59throw new ArgumentException (SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(UIElement)), nameof(value)); 62throw new ArgumentException(SR.Format(SR.CanOnlyHaveOneChild, this.GetType(), value.GetType()));
System\Windows\Controls\ComboBox.cs (1)
719undoManager.OpenedUnit.GetType() != typeof(TextParentUndoUnit))
System\Windows\Controls\DataErrorValidationRule.cs (1)
91idei.GetType().FullName,
System\Windows\Controls\DataGridAutoGeneratingColumnEventArgs.cs (2)
106typeof(PropertyDescriptor).IsAssignableFrom(value.GetType()) || 107typeof(PropertyInfo).IsAssignableFrom(value.GetType()),
System\Windows\Controls\Decorator.cs (3)
65throw new ArgumentException (SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(UIElement)), nameof(value)); 70throw new ArgumentException(SR.Format(SR.CanOnlyHaveOneChild, this.GetType(), value.GetType()));
System\Windows\Controls\FlowDocumentReader.cs (1)
1921throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(FlowDocument)), nameof(value));
System\Windows\Controls\FlowDocumentScrollViewer.cs (2)
1559if(scrollInfo.GetType() == typeof(System.Windows.Controls.ScrollContentPresenter)) 1804throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(FlowDocument)), nameof(value));
System\Windows\Controls\Frame.cs (1)
1198Debug.Assert(JournalEntry.GetType().IsSerializable);
System\Windows\Controls\Grid.cs (1)
77throw (new ArgumentException(SR.Format(SR.Grid_UnexpectedParameterType, value.GetType(), typeof(UIElement)), nameof(value)));
System\Windows\Controls\GridView.cs (1)
88return SR.Format(SR.ToStringFormatString_GridView, this.GetType(), Columns.Count);
System\Windows\Controls\GridViewColumn.cs (1)
61return SR.Format(SR.ToStringFormatString_GridViewColumn, this.GetType(), Header);
System\Windows\Controls\GridViewColumnHeader.cs (1)
741System.Reflection.Assembly assembly = this.GetType().Assembly;
System\Windows\Controls\GridViewHeaderRowPresenter.cs (1)
1178Type headerType = (srcHeader != null ? srcHeader.GetType() : typeof(GridViewColumnHeader));
System\Windows\Controls\GridViewRowPresenter.cs (3)
35this.GetType(), 88Type oldType = e.OldValue?.GetType(); 89Type newType = e.NewValue?.GetType();
System\Windows\Controls\GroupItem.cs (1)
186throw new InvalidOperationException(SR.Format(SR.StyleForWrongType, style.TargetType.Name, this.GetType().Name));
System\Windows\Controls\HeaderedContentControl.cs (1)
385string typeText = this.GetType().ToString();
System\Windows\Controls\HeaderedItemsControl.cs (1)
332string typeText = this.GetType().ToString();
System\Windows\Controls\InkCanvas.cs (2)
777|| oldShape.Rotation != _eraserShape.Rotation || oldShape.GetType() != _eraserShape.GetType())
System\Windows\Controls\ItemContainerGenerator.cs (4)
112string.Create(CultureInfo.InvariantCulture, $"ItemContainerGenerator for {Host.GetType().Name} {label} - {_itemsGenerated} items")); 329_containerType = container.GetType(); 331else if (_containerType != container.GetType()) 1107Type sourceType = source.GetType();
System\Windows\Controls\ItemsControl.cs (2)
3477throw new InvalidOperationException(SR.Format(SR.StyleForWrongType, style.TargetType.Name, container.GetType().Name)); 3964return SR.Format(SR.ToStringFormatString_ItemsControl, this.GetType(), itemsCount);
System\Windows\Controls\ItemsPanelTemplate.cs (1)
155throw new ArgumentException(SR.Format(SR.TemplateTargetTypeMismatch, "ItemsPresenter", templatedParent.GetType().Name));
System\Windows\Controls\ItemsPresenter.cs (1)
321if (oldPanel != null && oldPanel.GetType() == type)
System\Windows\Controls\MenuItem.cs (1)
2101throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, nameof(MenuItem), nameof(Separator), itemContainer));
System\Windows\Controls\PageRanges.cs (1)
170if (obj == null || obj.GetType() != typeof(PageRange))
System\Windows\Controls\Panel.cs (1)
91throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(UIElement)), nameof(value));
System\Windows\Controls\PasswordTextContainer.cs (1)
885Invariant.Assert(false, $"Unexpected type: {strongReference.GetType()}");
System\Windows\Controls\Primitives\GridViewRowPresenterBase.cs (1)
35this.GetType(),
System\Windows\Controls\Primitives\MenuBase.cs (1)
504throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, nameof(MenuItem), nameof(Separator), itemContainer));
System\Windows\Controls\Primitives\Popup.cs (1)
1297throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(UIElement)), nameof(value));
System\Windows\Controls\Primitives\RangeBase.cs (1)
357string typeText = this.GetType().ToString();
System\Windows\Controls\Primitives\Selector.cs (2)
597Type selectedType = value?.GetType(); 625Type itemType = itemValue.GetType();
System\Windows\Controls\Primitives\StatusBar.cs (1)
123throw new InvalidOperationException(SR.Format(SR.InvalidItemContainer, this.GetType().Name, nameof(StatusBarItem), nameof(Separator), itemContainer));
System\Windows\Controls\Primitives\ToggleButton.cs (1)
281string typeText = this.GetType().ToString();
System\Windows\Controls\RichTextBox.cs (3)
153throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(FlowDocument)), nameof(value)); 158throw new ArgumentException(SR.Format(SR.CanOnlyHaveOneChild, this.GetType(), value.GetType()));
System\Windows\Controls\ScrollViewer.cs (1)
2250if(isi.GetType() == typeof(System.Windows.Controls.ScrollContentPresenter))
System\Windows\Controls\TextBlock.cs (3)
127throw new ArgumentException(SR.Format(SR.TextPanelIllegalParaTypeForIAddChild, "value", value.GetType())); 132Type parentType = _complexContent.TextContainer.Parent.GetType(); 134Type valueType = value.GetType();
System\Windows\Controls\ToolBar.cs (3)
460Type feType = fe.GetType(); 596throw new NotSupportedException(SR.Format(SR.ToolBar_InvalidStyle_ToolBarPanel, child.GetType())); 619throw new NotSupportedException(SR.Format(SR.ToolBar_InvalidStyle_ToolBarOverflowPanel, child.GetType()));
System\Windows\Controls\ToolBarTray.cs (1)
272throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(ToolBar)), nameof(value));
System\Windows\Controls\UIElementCollection.cs (3)
36throw new ArgumentNullException(SR.Format(SR.Panel_NoNullVisualParent, "visualParent", this.GetType())); 391throw new System.ArgumentException(SR.Format(SR.Collection_BadType, "UIElementCollection", value.GetType().Name, "UIElement")); 515throw new ArgumentNullException(SR.Format(SR.Panel_NoNullChildren, this.GetType()));
System\Windows\Controls\ViewPort3D.cs (1)
232throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(Visual3D)), nameof(value));
System\Windows\Controls\VirtualizingStackPanel.cs (3)
6564Debug.Fail($"Unexpected container type: {((container == null) ? "null" : container.GetType().Name)}"); 8919if (this.GetType().Name != "RibbonMenuItemsPanel") 12230for (Type t = o.GetType(); !isWPFControl && t != null; t = t.BaseType)
System\Windows\Controls\WebBrowser.cs (1)
428Type t = value.GetType();
System\Windows\ControlTemplate.cs (1)
67throw new ArgumentException(SR.Format(SR.TemplateTargetTypeMismatch, _targetType.Name, templatedParent.GetType().Name));
System\Windows\CornerRadiusConverter.cs (1)
123throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(CornerRadius)), nameof(value));
System\Windows\Data\BindingExpression.cs (4)
1318&& !targetType.IsAssignableFrom(value.GetType())) 1650string name = String.IsNullOrEmpty(stringFormat) ? converter.GetType().Name : "StringFormat"; 1666converter.GetType().Name, 2156if (sourceType.IsAssignableFrom(value.GetType()))
System\Windows\Data\BindingExpressionBase.cs (4)
134Type type = parent.GetType(); 936target.GetType().FullName, dp.Name, AvTrace.GetHashCodeHelper(target)), 1319undoManager.OpenedUnit.GetType() != typeof(System.Windows.Documents.TextParentUndoUnit)) 2185if (converter != null && converter.CanConvertFrom(value.GetType()))
System\Windows\Data\BindingGroup.cs (1)
573TraceData.BindingGroupWrongProperty(name, context.GetType().FullName));
System\Windows\Data\CollectionView.cs (2)
67if (this.GetType() == typeof(CollectionView)) 1498Type collectionType = SourceCollection.GetType();
System\Windows\Data\MultiBinding.cs (2)
56throw new ArgumentException(SR.Format(SR.ChildHasWrongType, this.GetType().Name, "BindingBase", value.GetType().FullName), nameof(value));
System\Windows\Data\MultiBindingExpression.cs (3)
526Converter.GetType().Name, 554traceParameters: new object[] { Converter.GetType().Name, count, values.Length, TraceData.DescribeTarget(target, TargetProperty) }); 584Converter.GetType().Name,
System\Windows\Data\ObjectDataProvider.cs (2)
158Debug.Assert((_objectInstance == null) ? (_objectType == null) : (_objectType == _objectInstance.GetType())); 353SetObjectType(value?.GetType());
System\Windows\Data\PriorityBinding.cs (2)
53throw new ArgumentException(SR.Format(SR.ChildHasWrongType, this.GetType().Name, "BindingBase", value.GetType().FullName), nameof(value));
System\Windows\Data\XmlNamespaceMapping.cs (6)
46throw new InvalidOperationException(SR.Format(SR.PropertyIsInitializeOnly, "Prefix", this.GetType().Name)); 48throw new InvalidOperationException(SR.Format(SR.PropertyIsImmutable, "Prefix", this.GetType().Name)); 65throw new InvalidOperationException(SR.Format(SR.PropertyIsInitializeOnly, "Uri", this.GetType().Name)); 67throw new InvalidOperationException(SR.Format(SR.PropertyIsImmutable, "Uri", this.GetType().Name)); 137throw new InvalidOperationException(SR.Format(SR.PropertyMustHaveValue, "Prefix", this.GetType().Name)); 141throw new InvalidOperationException(SR.Format(SR.PropertyMustHaveValue, "Uri", this.GetType().Name));
System\Windows\Data\XmlNamespaceMappingCollection.cs (1)
50throw new ArgumentException(SR.Format(SR.RequiresXmlNamespaceMapping, value.GetType().FullName), nameof(value));
System\Windows\DataTemplate.cs (1)
192throw new ArgumentException(SR.Format(SR.TemplateTargetTypeMismatch, "ContentPresenter", templatedParent.GetType().Name));
System\Windows\DataTrigger.cs (1)
78value.GetType().Name));
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (2)
373if (result.Requester.GetType() == typeof(StaticResourceExtension)) 423if (result.Requester.GetType() == typeof(StaticResourceExtension))
System\Windows\Documents\DocumentSequence.cs (1)
101throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(DocumentReference)), nameof(value));
System\Windows\Documents\DocumentStructures\SemanticBasicElement.cs (9)
69throw new ArgumentException(SR.Format(SR.DocumentStructureUnexpectedParameterType4, value.GetType(), 114throw new ArgumentException(SR.Format(SR.DocumentStructureUnexpectedParameterType1, value.GetType(), 152throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(NamedElement)), nameof(value)); 201throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(ListItemStructure)), nameof(value)); 243throw new ArgumentException(SR.Format(SR.DocumentStructureUnexpectedParameterType4, value.GetType(), 296throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(TableRowGroupStructure)), nameof(value)); 338throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(TableRowStructure)), nameof(value)); 381throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(TableCellStructure)), nameof(value)); 425throw new ArgumentException(SR.Format(SR.DocumentStructureUnexpectedParameterType4, value.GetType(),
System\Windows\Documents\DocumentStructures\StoryFragments.cs (2)
46throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(StoryFragment)), nameof(value)); 106throw new ArgumentException(SR.Format(SR.DocumentStructureUnexpectedParameterType6, value.GetType(),
System\Windows\Documents\FixedDocument.cs (1)
135throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(PageContent)), nameof(value));
System\Windows\Documents\FixedLineResult.cs (2)
44if (o.GetType() != typeof(FixedLineResult)) 46throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, o.GetType(), typeof(FixedLineResult)), nameof(o));
System\Windows\Documents\FixedNode.cs (2)
149if (o.GetType() != typeof(FixedNode)) 151throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, o.GetType(), typeof(FixedNode)), nameof(o));
System\Windows\Documents\FixedPage.cs (1)
187throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(UIElement)), nameof(value));
System\Windows\Documents\FixedSOMContainer.cs (1)
37throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, comparedObj.GetType(), typeof(FixedSOMContainer)), nameof(comparedObj));
System\Windows\Documents\FixedSOMGroup.cs (1)
39throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, comparedObj.GetType(), typeof(FixedSOMGroup)), nameof(comparedObj));
System\Windows\Documents\FixedSOMSemanticBox.cs (1)
94throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, o.GetType(), typeof(FixedSOMSemanticBox)), nameof(o));
System\Windows\Documents\FixedTextPointer.cs (1)
532return e.IsTextElement ? e.Type : ((ITextContainer)_flowPosition.TextContainer).Parent.GetType();
System\Windows\Documents\FlowDocument.cs (3)
1627if (!TextSchema.IsValidChildOfContainer(/*parentType:*/_typeofThis, /*childType:*/value.GetType())) 1629throw new ArgumentException(SR.Format(SR.TextSchema_ChildTypeIsInvalid, _typeofThis.Name, value.GetType().Name)); 1635throw new ArgumentException(SR.Format(SR.TextSchema_TheChildElementBelongsToAnotherTreeAlready, value.GetType().Name));
System\Windows\Documents\FlowNode.cs (3)
89if (o == null || this.GetType() != o.GetType()) 113throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, o.GetType(), typeof(FlowNode)), nameof(o));
System\Windows\Documents\FlowPosition.cs (1)
69throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, o.GetType(), typeof(FlowPosition)), nameof(o));
System\Windows\Documents\InlineCollection.cs (4)
165if (!TextSchema.IsValidChildOfContainer(this.Parent.GetType(), child.GetType())) 167throw new InvalidOperationException(SR.Format(SR.TextSchema_ChildTypeIsInvalid, this.Parent.GetType().Name, child.GetType().Name));
System\Windows\Documents\PageContent.cs (2)
173throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(FixedPage)), nameof(value)); 610throw new ApplicationException(SR.Format(SR.PageContentUnsupportedPageType, o.GetType()));
System\Windows\Documents\Serialization\SerializerDescriptor.cs (1)
92Type factoryType = factoryInstance.GetType();
System\Windows\Documents\Span.cs (2)
116throw new InvalidOperationException(SR.Format(SR.TextSchema_CannotSplitElement, nonMergeableAncestor.GetType().Name)); 120throw new InvalidOperationException(SR.Format(SR.TextSchema_CannotSplitElement, nonMergeableAncestor.GetType().Name));
System\Windows\Documents\Speller.cs (1)
844Document = {start.TextContainer.Parent.GetType().Name}
System\Windows\Documents\Table.cs (1)
67throw (new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(TableRowGroup)), nameof(value)));
System\Windows\Documents\TableCell.cs (1)
88throw new InvalidOperationException(SR.Format(SR.TableInvalidParentNodeType, newParent.GetType().ToString()));
System\Windows\Documents\TableRow.cs (2)
65throw (new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(TableCell)), nameof(value))); 89throw new InvalidOperationException(SR.Format(SR.TableInvalidParentNodeType, newParent.GetType().ToString()));
System\Windows\Documents\TableRowGroup.cs (2)
67throw (new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(TableRow)), nameof(value))); 289throw new InvalidOperationException(SR.Format(SR.TableInvalidParentNodeType, newParent.GetType().ToString()));
System\Windows\Documents\TextElement.cs (12)
789Type valueType = value.GetType(); 808throw new ArgumentException(SR.Format(SR.TextSchema_ThisInlineUIContainerHasAChildUIElementAlready, this.GetType().Name, ((InlineUIContainer)this).Child.GetType().Name, value.GetType().Name)); 820throw new ArgumentException(SR.Format(SR.TextSchema_ThisBlockUIContainerHasAChildUIElementAlready, this.GetType().Name, ((BlockUIContainer)this).Child.GetType().Name, value.GetType().Name)); 836throw new ArgumentException(SR.Format(SR.TextSchema_ChildTypeIsInvalid, this.GetType().Name, value.GetType().Name)); 843throw new ArgumentException(SR.Format(SR.TextSchema_ChildTypeIsInvalid, this.GetType().Name, value.GetType().Name)); 883throw new InvalidOperationException(SR.Format(SR.TextSchema_TextIsNotAllowed, this.GetType().Name));
System\Windows\Documents\TextElementCollection.cs (6)
248throw new InvalidOperationException(SR.Format(SR.TextElementCollection_PreviousSiblingDoesNotBelongToThisCollection, previousSibling.GetType().Name)); 253throw new ArgumentException(SR.Format(SR.TextSchema_TheChildElementBelongsToAnotherTreeAlready, this.GetType().Name)); 287throw new InvalidOperationException(SR.Format(SR.TextElementCollection_NextSiblingDoesNotBelongToThisCollection, nextSibling.GetType().Name)); 292throw new ArgumentException(SR.Format(SR.TextSchema_TheChildElementBelongsToAnotherTreeAlready, this.GetType().Name)); 463throw new ArgumentException(SR.Format(SR.TextSchema_TheChildElementBelongsToAnotherTreeAlready, this.GetType().Name)); 599Type elementType = array.GetType().GetElementType();
System\Windows\Documents\TextPointer.cs (8)
1419Type containerType = this.TextContainer.Parent.GetType(); 1431throw new InvalidOperationException(SR.Format(SR.TextSchema_CannotSplitElement, ancestor.GetType().Name)); 1613TextSchema.IsFormattingType(position.GetAdjacentElement(LogicalDirection.Backward).GetType())) 1723while (ancestor != null && TextSchema.IsMergeableInline(ancestor.GetType())) 2420return element?.GetType(); 3540bool isValidChild = TextSchema.ValidateChild(position, /*childType*/inline.GetType(), false /* throwIfIllegalChild */, true /* throwIfIllegalHyperlinkDescendent */); 3567Invariant.Assert(TextSchema.IsValidChild(position, /*childType*/inline.GetType())); 3618return element?.GetType();
System\Windows\Documents\TextRange.cs (1)
801throw new ArgumentException(SR.Format(SR.TextEditorTypeOfParameterIsNotAppropriateForFormattingProperty, value == null ? "null" : value.GetType().Name, formattingProperty.Name), nameof(value));
System\Windows\Documents\TextRangeBase.cs (2)
1826while (outerAnchoredBlock != null && !typeof(AnchoredBlock).IsAssignableFrom(outerAnchoredBlock.GetType())) 1868while (outerAnchoredBlock != null && !typeof(AnchoredBlock).IsAssignableFrom(outerAnchoredBlock.GetType()))
System\Windows\Documents\TextRangeEdit.cs (32)
30TextElement newElement = (TextElement)Activator.CreateInstance(element.GetType()); 55Invariant.Assert(splitPosition.Parent != null && TextSchema.IsMergeableInline(splitPosition.Parent.GetType())); 171while (inline != null && inline.IsEmpty && !TextSchema.IsFormattingType(inline.GetType())) 184(inline.GetType() == typeof(Run) || inline.GetType() == typeof(Span)) && 195((inline.NextInline != null && TextSchema.IsFormattingType(inline.NextInline.GetType())) || 196(inline.PreviousInline != null && TextSchema.IsFormattingType(inline.PreviousInline.GetType())))) 263TextSchema.IsMergeableInline(position.Parent.GetType())) 268TextSchema.IsMergeableInline(position.Parent.GetType())) 282if (TextSchema.IsFormattingType(firstInline.GetType()) && firstInline.TextRange.IsEmpty) 287else if (TextSchema.IsFormattingType(secondInline.GetType()) && secondInline.TextRange.IsEmpty) 292else if (TextSchema.IsKnownType(firstInline.GetType()) && TextSchema.IsKnownType(secondInline.GetType()) && 294TextSchema.IsMergeableInline(firstInline.GetType()) && TextSchema.IsMergeableInline(secondInline.GetType()) 327TextSchema.IsMergeableInline(inline.Parent.GetType()) && 328TextSchema.IsKnownType(inline.Parent.GetType()) && 431else if (parent is Span && TextSchema.IsKnownType(parent.GetType())) 591Invariant.Assert(position.TextContainer.Parent == null || TextSchema.IsValidChildOfContainer(position.TextContainer.Parent.GetType(), typeof(Paragraph))); 789if (TextSchema.IsParagraphOrBlockUIContainer(block.GetType())) 1278TextSchema.IsMergeableInline(position.Parent.GetType())) 1283TextSchema.IsMergeableInline(position.Parent.GetType())) 1298TextSchema.IsMergeableInline(previousPosition.GetAdjacentElement(LogicalDirection.Backward).GetType())) 1307TextSchema.IsMergeableInline(nextPosition.GetAdjacentElement(LogicalDirection.Forward).GetType())) 1443if (parent is Inline || TextSchema.AllowsParagraphMerging(parent.GetType())) 1765while (splitPosition.Parent != null && TextSchema.IsMergeableInline(splitPosition.Parent.GetType()) && splitPosition.Parent != limitingAncestor && 2021if (TextSchema.IsMergeableInline(topmostSpan.GetType()) && TextSchema.IsKnownType(topmostSpan.GetType()) && !HasWriteableLocalPropertyValues(topmostSpan)) 2036parent != null && TextSchema.IsMergeableInline(parent.GetType()); 2118TextSchema.IsFormattingType(start.Parent.GetType())) // look for Run/Span elements 2266if (!TextSchema.IsMergeableInline(parent.GetType())) 2277if (!TextSchema.IsMergeableInline(parent.GetType()))
System\Windows\Documents\TextRangeEditLists.cs (4)
79Invariant.Assert(TextSchema.AllowsParagraphMerging(parentBlock.GetType())); 109Invariant.Assert(TextSchema.AllowsParagraphMerging(previousBlock.GetType())); 637if (!TextSchema.AllowsParagraphMerging(position.Parent.GetType())) 657if (!TextSchema.AllowsParagraphMerging(position.Parent.GetType()))
System\Windows\Documents\TextRangeEditTables.cs (1)
633if (ancestor is List || ancestor is Inline && !TextSchema.IsMergeableInline(ancestor.GetType()))
System\Windows\Documents\TextRangeSerialization.cs (11)
236TextElementEditingBehaviorAttribute att = (TextElementEditingBehaviorAttribute)Attribute.GetCustomAttribute(nextElement.GetType(), typeof(TextElementEditingBehaviorAttribute)); 616string complexPropertyName = $"{table.GetType().Name}.Columns"; 1114Type elementTypeStandardized = TextSchema.GetStandardElementType(element.GetType(), reduceElement); 1414TextSchema.IsFormattingType(positionBeforeParagraph.Parent.GetType())) 1419TextSchema.AllowsParagraphMerging(positionBeforeParagraph.Parent.GetType())) 1515Invariant.Assert(itemType.IsAssignableFrom(start.GetAdjacentElement(LogicalDirection.Forward).GetType()), 1517Invariant.Assert(itemType.IsAssignableFrom(end.GetAdjacentElement(LogicalDirection.Backward).GetType()), 1524Invariant.Assert(!(backwardFromStart == TextPointerContext.ElementEnd) || itemType.IsAssignableFrom(start.GetAdjacentElement(LogicalDirection.Backward).GetType()), 1527Invariant.Assert(!(forwardFromEnd == TextPointerContext.ElementStart) || itemType.IsAssignableFrom(end.GetAdjacentElement(LogicalDirection.Forward).GetType()), 1572if (TextSchema.IsBlock(propertyBag.GetType())) 1621else if (targetType.IsAssignableFrom(element.GetType()))
System\Windows\Documents\TextSchema.cs (13)
109bool isValidChild = IsValidChild(parent.GetType(), child.GetType()); 113throw new InvalidOperationException(SR.Format(SR.TextSchema_ChildTypeIsInvalid, parent.GetType().Name, child.GetType().Name)); 140bool isValidChild = IsValidChild(parent.GetType(), childType); 144throw new InvalidOperationException(SR.Format(SR.TextSchema_ChildTypeIsInvalid, parent.GetType().Name, childType.Name)); 163return (leftElement == null || IsValidSibling(leftElement.GetType(), childType)) && 164(rightElement == null || IsValidSibling(rightElement.GetType(), childType)); 172bool isValidChild = IsValidChild(parent.GetType(), childType); 176throw new InvalidOperationException(SR.Format(SR.TextSchema_ChildTypeIsInvalid, parent.GetType().Name, childType.Name)); 618if (value1.GetType() != value2.GetType()) 897throw new InvalidOperationException(SR.Format(SR.TextSchema_IllegalHyperlinkChild, nextElement.GetType()));
System\windows\Documents\TextSelection.cs (1)
1470TextElementEditingBehaviorAttribute att = (TextElementEditingBehaviorAttribute)Attribute.GetCustomAttribute(element.GetType(), typeof(TextElementEditingBehaviorAttribute));
System\Windows\Documents\TextStore.cs (1)
4815for (Type t = o.GetType(); !isWPFControl && t != null; t = t.BaseType)
System\Windows\Documents\TextTreeDeleteContentUndoUnit.cs (2)
275container = new ElementContentContainer(elementNode.TextElement.GetType(), 461base(table.GetType(), localValues, table.Resources, childContainer)
System\Windows\Documents\TextTreeExtractElementUndoUnit.cs (1)
26_type = elementNode.TextElement.GetType();
System\Windows\Documents\ValidationHelper.cs (4)
105if (!TextSchema.IsValidChild(/*position:*/position, /*childType:*/child.GetType())) 107throw new ArgumentException(SR.Format(SR.TextSchema_ChildTypeIsInvalid, position.Parent.GetType().Name, child.GetType().Name)); 115throw new ArgumentException(SR.Format(SR.TextSchema_TheChildElementBelongsToAnotherTreeAlready, child.GetType().Name));
System\Windows\EventSetter.cs (1)
101if (_handler.GetType() != _event.HandlerType)
System\Windows\EventSetterHandlerConverter.cs (1)
58if (typeDescriptorContext.GetType() != s_ServiceProviderContextType)
System\Windows\EventTrigger.cs (1)
57throw new ArgumentException(SR.Format(SR.EventTriggerBadAction, value.GetType().Name));
System\Windows\FrameworkContentElement.cs (3)
509object implicitValue = FrameworkElement.FindImplicitStyleResource(this, this.GetType(), out source); 576string TypeAndName = $"[{GetType().Name}]{dp.Name}"; 700PerfService.GetPerfElementID(this), GetType().Name, GetValue(dp));
System\Windows\FrameworkElement.cs (3)
1867object implicitValue = FrameworkElement.FindImplicitStyleResource(this, this.GetType(), out source); 1983string TypeAndName = string.Create(CultureInfo.InvariantCulture, $"[{GetType().Name}]{dp.Name}({base.GetHashCode()})"); 2072PerfService.GetPerfElementID(this), GetType().Name, GetValue(dp));
System\Windows\FrameworkElementFactory.cs (7)
222throw new ArgumentException(SR.Format(SR.ReadOnlyPropertyNotAllowed, dp.Name, GetType().Name)); 308if (handler.GetType() != routedEvent.HandlerType) 344if (handler.GetType() != routedEvent.HandlerType) 651parent.GetType().Name)); 906parent.GetType().Name)); 952frameworkObject.DO.GetType().Name)); 1112parent.GetType().Name));
System\Windows\FrameworkTemplate.cs (2)
1122throw new InvalidOperationException(SR.Format(SR.TemplateMustBeFE, new object[] { rootObject.GetType().FullName })); 1136rootObject.GetType(), feResult != null, feResult, fceResult);
System\Windows\Input\Command\CommandValueSerializer.cs (4)
75throw new InvalidOperationException(SR.Format(SR.ValueSerializerContextUnavailable, this.GetType().Name )); 82throw new InvalidOperationException(SR.Format(SR.TypeValueSerializerUnavailable, this.GetType().Name )); 132throw new InvalidOperationException(SR.Format(SR.ValueSerializerContextUnavailable, this.GetType().Name )); 139throw new InvalidOperationException(SR.Format(SR.TypeValueSerializerUnavailable, this.GetType().Name ));
System\Windows\Interop\ActiveXHost.cs (1)
662throw new TargetInvocationException(SR.Format(SR.AXNohWnd, GetType().Name), e);
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
1132Type rootType = _root.GetType();
System\Windows\Markup\BamlReader.cs (1)
1075TypeConverter converter = TypeDescriptor.GetConverter(value.GetType());
System\Windows\Markup\BamlRecordReader.cs (23)
1000flags = GetFlagsFromType(element.GetType()); 1283short elementId = BamlMapTable.GetKnownTypeIdFromType(parent.GetType()); 1589paramInfo.ParameterType != param.GetType()) 1601converter.GetType(), 1623if (!paramInfo.ParameterType.IsAssignableFrom(param.GetType())) 1655converter.GetType(), 2664ThrowExceptionWithLine(SR.Format(SR.ParserCannotSetValue, element.GetType().FullName, propertyDefinition.Name, valueType.Name), e); 2906ThrowExceptionWithLine(SR.Format(SR.ParserCannotSetValue, element.GetType().FullName, propertyDefinition.AttributeInfo.Name, attribValue), e); 3037expectedType = CurrentContext.ObjectData.GetType(); 3378element.GetType().ToString(), holder.PropertyDefinition.Name), e); 3477parent.GetType().FullName, 3721ThrowExceptionWithLine(SR.Format(SR.ParserCannotSetValue, currentTarget.GetType().FullName, attribInfo.Name, o), e); 3747o.GetType().FullName); 3766if (genericType != o.GetType()) 3859ThrowExceptionWithLine(SR.Format(SR.ParserCannotSetValue, parentObject.GetType().FullName, memberInfo.Name, o), e); 4753ThrowException( nameof(SR.ParserCannotAddAnyChildren2), typeName, currentObject.GetType().FullName ); 4771ThrowException( nameof(SR.ParserCannotAddAnyChildren2), typeName, currentObject.GetType().FullName ); 4792return parent.GetType(); 4853elementType = element?.GetType(); 4995value.GetType().Name, 4996container.GetType().Name), 5088currentParentType = currentParent.GetType(); 5741Type currentParentType = currentParent.GetType();
System\Windows\Markup\BamlRecords.cs (2)
4696|| (KnownTypes.Types[(int)KnownElements.DependencyProperty].IsAssignableFrom(propertyMember.GetType())), 4738KnownTypes.Types[(int)KnownElements.DependencyProperty].IsAssignableFrom(PropertyMember.GetType( )) )
System\Windows\Markup\Primitives\ElementMarkupObject.cs (6)
48get { return _instance.GetType(); } 234if (!TryGetShouldSerializeMethod(new ShouldSerializeKey(instance.GetType(), pd.Name), out shouldSerializeMethod)) 236Type instanceType = instance.GetType(); 482(!PropertyIsAttached(PropertyDescriptor) && PropertyType == value.GetType() && 684Type type = value.GetType(); 932string typeName = typeSerializer.ConvertToString(enumValue.GetType(), context);
System\Windows\Markup\Primitives\MarkupWriter.cs (2)
693throw new InvalidOperationException(SR.Format(SR.UnserializableKeyValue, property.Value.GetType().FullName)); 1033Type tagType = property.Value.GetType();
System\Windows\Markup\XamlTypeMapper.cs (2)
588else if (typeConvert.GetType() == typeof(TypeConverter)) 617if(!propType.IsAssignableFrom(obj.GetType()))
System\Windows\Media\Animation\Generated\ThicknessAnimation.cs (2)
316this.GetType(), 327this.GetType(),
System\Windows\Media\Animation\Storyboard.cs (11)
277SR.Format(SR.Storyboard_NameNotFound, targetName, nameScopeUsed.GetType().ToString())); 319SR.Format(SR.Storyboard_NameNotFound, targetName, nameScope.GetType().ToString())); 328SR.Format(SR.Storyboard_NameNotFound, targetName, fe.GetType().ToString())); 337SR.Format(SR.Storyboard_NameNotFound, targetName, fce.GetType().ToString())); 445throw new InvalidOperationException(SR.Format(SR.Storyboard_NoTarget, currentTimeline.GetType().ToString() )); 453throw new InvalidOperationException(SR.Format(SR.Storyboard_TargetPropertyRequired, currentTimeline.GetType().ToString() )); 575$"Internal error - clockMappings table contains an unexpected object {((mappedObject == null) ? "" : mappedObject.GetType().ToString())}"); 616$"Internal error - clockMappings table contains unexpected object of type{value.GetType()}"); 724throw new InvalidOperationException(SR.Format(SR.Storyboard_PropertyPathFrozenCheckFailed, AccessorName(path, i-1), path.Path, intermediateFreezable.GetType().ToString() )); 796throw new InvalidOperationException(SR.Format(SR.Storyboard_AnimationMismatch, animationClock.Timeline.GetType(), targetProperty.Name, targetProperty.PropertyType)); 945throw new InvalidOperationException(SR.Format(SR.Storyboard_ComplexPathNotSupported, targetObject.GetType().ToString()));
System\Windows\Navigation\Journal.cs (1)
464Debug.Assert(je.GetType().IsSerializable);
System\Windows\Navigation\NavigationService.cs (3)
1416_bp != null ? _bp.GetType().ToString() : "null")); 3224Type type = ccs.GetType(); 3897Debug.Fail($"Unhandled scenario: PageFunction returning to {parentEntry.GetType().Name}");
System\Windows\PropertyPath.cs (3)
561(accessor != null) ? accessor.GetType().FullName : "null")); 639accessor = SystemCoreHelper.NewDynamicPropertyAccessor(item.GetType(), propertyName); 727args[i].type = value.GetType();
System\Windows\PropertyPathConverter.cs (3)
102throw new ArgumentException(SR.Format(SR.CannotConvertType, source.GetType().FullName, typeof(PropertyPath))); 139throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(PropertyPath)), nameof(value)); 225type = pathPart.GetType();
System\Windows\ResourceDictionary.cs (1)
544valueType = value.GetType();
System\Windows\Setter.cs (2)
68throw new ArgumentException(SR.Format(SR.ReadOnlyPropertyNotAllowed, property.Name, GetType().Name)); 113value.GetType().Name));
System\Windows\Standard\Utilities.cs (2)
227DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(property, component.GetType()); 240DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(property, component.GetType());
System\Windows\Standard\Verify.cs (1)
279foreach (var ifaceType in parameter.GetType().GetInterfaces())
System\Windows\StaticResourceExtension.cs (2)
198throw new InvalidOperationException(SR.Format(SR.MarkupExtensionNoContext, GetType().Name, "IXamlSchemaContextProvider")); 204throw new InvalidOperationException(SR.Format(SR.MarkupExtensionNoContext, GetType().Name, "IAmbientProvider"));
System\Windows\Style.cs (4)
394throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(SetterBase)), nameof(value)); 466Type elementType = element.GetType(); 650"Unsupported SetterBase subclass in style triggers ({0})", setterBase.GetType().ToString()); 786throw new InvalidOperationException(SR.Format(SR.UnsupportedTriggerInStyle, trigger.GetType().Name));
System\Windows\StyleHelper.cs (14)
982throw new InvalidOperationException(SR.Format(SR.UnsupportedTriggerInTemplate, triggerBase.GetType().Name)); 999throw new InvalidOperationException(SR.Format(SR.UnsupportedTriggerInTemplate, triggerBase.GetType().Name)); 1596throw new InvalidOperationException(SR.Format(SR.CrossThreadAccessOfUnshareableFreezable, freezable.GetType().FullName)); 1827$"Style.InstantiateSubTree for {container.GetType().Name} {label}"); 1867$"Style.InstantiateSubTree for {container.GetType().Name} {label}"); 2073if( walkNode.GetType() == container.GetType() ) 2080SR.Format(SR.TemplateCircularReferenceFound, name, walkNode.GetType())); 2334throw new InvalidOperationException(SR.Format(SR.MustBeFrameworkDerived, d.GetType())); 4341$"Internal data structure error: The FrugalMap [Style/Template].PropertyTriggersWithActions is expected to hold a single TriggerBase or a List<T> of them. An object of type {candidateTrigger.GetType()} is not expected. Where did this object come from?"); 5052$"FrugalMap for holding List<TriggerBase> is holding an instance of unexpected type {existing.GetType()}"); 5098$"HybridDictionary for holding List<TriggerBase> is holding an instance of unexpected type {existing.GetType()}"); 5271$"Internal data structure error: The HybridDictionary [Style/Template].DataTriggersWithActions is expected to hold a single TriggerBase or a List<T> of them. An object of type {candidateTrigger.GetType()} is not expected. Where did this object come from?"); 5880Type stateType = state?.GetType();
System\Windows\SystemResources.cs (1)
1778return _value?.GetType();
System\Windows\TemplateContent.cs (5)
691if (staticResource.GetType() == typeof(StaticResourceExtension)) 697else if (staticResource.GetType() == typeof(StaticResourceHolder)) 842Type typeofValue = xamlReader.Value.GetType(); 974if (xamlReader.Value != null && typeof(StaticResourceExtension).IsAssignableFrom(xamlReader.Value.GetType())) 1068if (value != null && !IsTypeShareable(value.GetType()))
System\Windows\TemplateKey.cs (6)
50throw new InvalidOperationException(SR.Format(SR.PropertyMustHaveValue, "DataType", this.GetType().Name)); 69throw new InvalidOperationException(SR.Format(SR.PropertyIsInitializeOnly, "DataType", this.GetType().Name)); 71throw new InvalidOperationException(SR.Format(SR.PropertyIsImmutable, "DataType", this.GetType().Name)); 119? string.Create(TypeConverterHelper.InvariantEnglishUS, $"{this.GetType().Name}({DataType})") 120: string.Create(TypeConverterHelper.InvariantEnglishUS, $"{this.GetType().Name}(null)"); 163result = new ArgumentException(SR.Format(SR.MustBeTypeOrString, dataType.GetType().Name), argName);
System\Windows\ThemeDictionaryExtension.cs (1)
74throw new InvalidOperationException(SR.Format(SR.MarkupExtensionNoContext, GetType().Name, "IProvideValueTarget" ));
System\Windows\ThicknessConverter.cs (1)
124throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, value.GetType(), typeof(Thickness)), nameof(value));
System\Windows\Trigger.cs (2)
80value.GetType().Name)); 181throw new ArgumentException(SR.Format(SR.UnexpectedParameterType, o.GetType(), typeof(Setter)), nameof(o));
System\Windows\TriggerBase.cs (1)
300throw new InvalidOperationException(SR.Format(SR.VisualTriggerSettersIncludeUnsupportedSetterType, setters[i].GetType().Name));
PresentationFramework-SystemData (6)
SystemDataExtension.cs (6)
76s_DataTablePropertyDescriptorType = pdc["Table1"].GetType(); 79s_DataRelationPropertyDescriptorType = pdc["IDRelation"].GetType(); 82Type pdType = pd.GetType(); 126if (pd.GetType() == s_DataTablePropertyDescriptorType) 135else if (pd.GetType() == s_DataRelationPropertyDescriptorType) 151if (useFollowParent && pd.GetType() == s_DataRelationPropertyDescriptorType)
PresentationFramework-SystemXmlLinq (6)
SystemXmlLinqExtension.cs (6)
23s_XElementElementsPropertyDescriptorType = pdc["Elements"].GetType(); 24s_XElementDescendantsPropertyDescriptorType = pdc["Descendants"].GetType(); 25s_XElementAttributePropertyDescriptorType = pdc["Attribute"].GetType(); 26s_XElementElementPropertyDescriptorType = pdc["Element"].GetType(); 47Type pdType = pd.GetType(); 61Type pdType = pd.GetType();
PresentationUI (6)
MS\Internal\Documents\Application\ChainOfDependencies.cs (2)
80member.GetType(), 113member.GetType(),
MS\Internal\Documents\Application\ChainOfResponsibility.cs (4)
70member.GetType().Name, 71subject.GetType().Name); 80member.GetType().Name, 81subject.GetType().Name);
ReachFramework (69)
AlphaFlattener\BrushProxy.cs (3)
385str += _brush.GetType(); 675Debug.Fail("IsOpaque(" + _brush.GetType() + ") not handled"); 771Debug.Fail("IsTransparent not handled " + _brush.GetType());
AlphaFlattener\Primitive.cs (1)
536Console.WriteLine("Drawing of type '" + d.GetType() + "' not handled.");
AlphaFlattener\PrimitiveList.cs (1)
90string typ = p.GetType().ToString();
AlphaFlattener\Utility.cs (1)
920Type typ = segment.GetType();
Packaging\XpsFixedDocumentReaderWriter.cs (1)
314if (!value.GetType().Equals(typeof(PrintTicket)))
Packaging\XpsFixedDocumentSequenceReaderWriter.cs (1)
242if (!value.GetType().Equals(typeof(PrintTicket)))
Packaging\XpsFixedPageReaderWriter.cs (1)
511if (!value.GetType().Equals(typeof(PrintTicket)))
Packaging\XpsInterleavingPolicy.cs (3)
282if (!_flushOrderItems.ContainsKey(node.GetType()) || 584FlushItem xOrder = (FlushItem)_orderTable[x.Node.GetType()]; 585FlushItem yOrder = (FlushItem)_orderTable[y.Node.GetType()];
PrintSystemExceptions\PrintSystemException.cs (3)
801committedAttributes = (Collection<String>)(info.GetValue("CommittedAttributes", committedAttributes.GetType())); 802failedAttributes = (Collection<String>)(info.GetValue("FailedAttributes", failedAttributes.GetType())); 803printObjectName = (String)(info.GetValue("ObjectName", printObjectName.GetType()));
Serialization\ColorTypeConverter.cs (1)
106if (!IsSupportedType(value.GetType()))
Serialization\FontTypeConverter.cs (1)
104if (!IsSupportedType(value.GetType()))
Serialization\ImageSourceTypeConverter.cs (1)
110if (!IsSupportedType(value.GetType()))
Serialization\Manager\MetroSerializationManager.cs (3)
153return TypeDescriptor.GetConverter(serializedObject.GetType()); 699Type type = serializableObject.GetType(); 758Type type = serializableObject.GetType();
Serialization\Manager\NGCSerializationManager.cs (2)
656Type serializedObjectType = serializedObject.GetType(); 689Type serializedObjectType = serializedObject.GetType();
Serialization\Manager\NGCSerializationManagerAsync.cs (6)
147if(objectOnStack.GetType() == 155else if(typeof(System.Windows.Xps.Serialization.NGCSerializerContext).IsAssignableFrom(objectOnStack.GetType())) 259if(objectOnStack.GetType() == 267else if(typeof(System.Windows.Xps.Serialization.NGCSerializerContext).IsAssignableFrom(objectOnStack.GetType())) 905Type serializedObjectType = serializedObject.GetType(); 966Type serializedObjectType = serializedObject.GetType();
Serialization\Manager\ReachFixedPageSerializer.cs (1)
152String xmlnsForType = SerializationManager.GetXmlNSForType(serializableObjectContext.TargetObject.GetType());
Serialization\Manager\ReachFixedPageSerializerAsync.cs (1)
177String xmlnsForType = SerializationManager.GetXmlNSForType(serializableObjectContext.TargetObject.GetType());
Serialization\Manager\ReachObjectContext.cs (1)
185serializableObjectContext.Name = serializableObjectContext.TargetObject.GetType().Name;
Serialization\Manager\ReachSerializableProperties.cs (2)
428Type valueType = Value.GetType(); 773Type valueType = Value.GetType();
Serialization\Manager\ReachSerializationUtils.cs (10)
303if((_serializedObject.GetType() == typeof(System.Windows.Documents.FixedDocument)) || 304(typeof(System.Windows.Documents.DocumentPaginator).IsAssignableFrom(_serializedObject.GetType()) 305&& (_serializedObject.GetType() != typeof(System.Windows.Documents.FixedDocumentSequence)))) 312else if(_serializedObject.GetType() == typeof(System.Windows.Documents.FixedPage)) 337else if(typeof(System.Windows.Media.Visual).IsAssignableFrom(_serializedObject.GetType())) 355if((_serializedObject.GetType() == typeof(System.Windows.Documents.FixedDocument)) || 356(typeof(System.Windows.Documents.DocumentPaginator).IsAssignableFrom(_serializedObject.GetType()) 357&& (_serializedObject.GetType() != typeof(System.Windows.Documents.FixedDocumentSequence)))) 361else if(_serializedObject.GetType() == typeof(System.Windows.Documents.FixedPage)) 366else if(typeof(System.Windows.Media.Visual).IsAssignableFrom(_serializedObject.GetType()))
Serialization\Manager\XpsOMFixedPageSerializer.cs (1)
142String xmlnsForType = SerializationManager.GetXmlNSForType(serializableObjectContext.TargetObject.GetType());
Serialization\Manager\XpsOMSerializationManager.cs (5)
72serializedObject.GetType().ToString().Contains("FixedDocumentPaginator")) 78serializedObject.GetType().ToString().Contains("FixedDocumentSequencePaginator")) 209if (typeof(BitmapSource).IsAssignableFrom(serializedObject.GetType())) 213else if (typeof(GlyphRun).IsAssignableFrom(serializedObject.GetType())) 217else if (typeof(Color).IsAssignableFrom(serializedObject.GetType()))
Serialization\Manager\XpsOMSerializationManagerAsync.cs (4)
117if (objectOnStack.GetType() == 125else if (typeof(System.Windows.Xps.Serialization.ReachSerializerContext).IsAssignableFrom(objectOnStack.GetType())) 214if (objectOnStack.GetType() == 222else if (typeof(System.Windows.Xps.Serialization.ReachSerializerContext).IsAssignableFrom(objectOnStack.GetType()))
Serialization\Manager\XpsSerializationManager.cs (8)
102serializedObject.GetType().ToString().Contains( "FixedDocumentPaginator") ) 108serializedObject.GetType().ToString().Contains( "FixedDocumentSequencePaginator") ) 364if (typeof(BitmapSource).IsAssignableFrom(serializedObject.GetType())) 368else if (typeof(GlyphRun).IsAssignableFrom(serializedObject.GetType())) 372else if (typeof(Color).IsAssignableFrom(serializedObject.GetType())) 748TypeSerializableDependencyProperties[serializableObject.GetType()]; 799TypeNoneSerializableClrProperties[serializableObject.GetType()]; 1051Type serializedObjectType = serializedObject.GetType();
Serialization\Manager\XpsSerializationManagerAsync.cs (4)
134if(objectOnStack.GetType() == 142else if(typeof(System.Windows.Xps.Serialization.ReachSerializerContext).IsAssignableFrom(objectOnStack.GetType())) 242if(objectOnStack.GetType() == 250else if(typeof(System.Windows.Xps.Serialization.ReachSerializerContext).IsAssignableFrom(objectOnStack.GetType()))
Serialization\VisualSerializer.cs (1)
821WriteBrushHeader(brush.GetType().ToString(), brush);
Serialization\VisualTreeFlattener.cs (2)
430_dcf.Comment(visual.GetType().ToString()); 747Console.WriteLine("Drawing of type '" + d.GetType() + "' not handled.");
Replay (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Roslyn.Diagnostics.Analyzers (7)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
40throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (1)
68throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IUtf8StringOperationWrapper.cs (1)
39throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (1)
55var type = analyzerConfigOptions.GetType();
Roslyn.VisualStudio.Next.UnitTests (4)
Options\VisualStudioSettingsOptionPersisterTests.cs (1)
104=> (bool)array.GetType().GetMethod("get_IsDefault").Invoke(array, [])!;
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (3)
171[.. analyzerReference.GetAnalyzers(project.Language).Where(a => a.GetType() == analyzerType)], 207var analyzers = analyzerReference.GetAnalyzers(project.Language).Where(a => a.GetType() == analyzerType).ToImmutableArray(); 244[.. analyzerReference.GetAnalyzers(project.Language).Where(a => a.GetType() == analyzerType)],
SemanticSearch.BuildTask (1)
src\Dependencies\Contracts\ExceptionUtilities.cs (1)
21string output = string.Format("Unexpected value '{0}' of type '{1}'", o, (o != null) ? o.GetType().FullName : "<unknown>");
Shared (7)
Data.Validation\LengthAttribute.cs (2)
140throw new InvalidOperationException($"{nameof(LengthAttribute)} is not supported for fields of type {value.GetType()} (see field {validationContext.GetDisplayName()})"); 150private static PropertyInfo? GetCountProperty(object value) => value.GetType().GetRuntimeProperty("Count");
JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (3)
32converter.GetType().Assembly == typeof(JsonConverter).Assembly; 74Type converterType = nullableConverter.GetType(); 101Type converterType = enumConverter.GetType();
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (1)
30/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
StringSplit\StringRange.cs (1)
73Throw.ArgumentException(nameof(obj), $"Provided value must be of type {typeof(StringRange)}, but was of type {obj.GetType()}.");
StaticFilesAuth (1)
Startup.cs (1)
61throw new InvalidOperationException($"Unknown resource type '{context.Resource.GetType()}'");
System.CodeDom (13)
Microsoft\CSharp\CSharpCodeGenerator.cs (3)
613throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e)); 750throw new ArgumentException(SR.Format(SR.InvalidPrimitiveType, e.Value.GetType()), nameof(e)); 1234throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e));
System\CodeDom\Compiler\CodeGenerator.cs (3)
608throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e)); 938throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e)); 1426throw new ArgumentException(SR.Format(SR.InvalidPrimitiveType, e.Value.GetType()), nameof(e));
System\CodeDom\Compiler\CodeValidator.cs (7)
59throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e)); 94throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e)); 455throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e)); 649string message = SR.Format(SR.InvalidTypeName, typeName, propertyName, e.GetType().FullName); 658string message = SR.Format(SR.InvalidLanguageIdentifier, identifier, propertyName, e.GetType().FullName); 768throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e)); 938throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e));
System.Collections.Immutable (2)
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (1)
117if (sequence.GetType() == typeof(T[]))
Validation\Requires.cs (1)
145throw new ObjectDisposedException(disposed!.GetType().FullName);
System.ComponentModel.Annotations (12)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
151(value != null ? value.GetType().ToString() : "null"),
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (2)
43Type valueType = value.GetType(); 69Debug.Assert(valueType == value.GetType(), "The valueType should equal the Type of the value");
System\ComponentModel\DataAnnotations\LengthAttribute.cs (1)
67throw new InvalidCastException(SR.Format(SR.LengthAttribute_InvalidValueType, value.GetType()));
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (2)
84throw new InvalidCastException(SR.Format(SR.LengthAttribute_InvalidValueType, value.GetType())); 127PropertyInfo? property = value.GetType().GetRuntimeProperty("Count");
System\ComponentModel\DataAnnotations\MinLengthAttribute.cs (1)
67throw new InvalidCastException(SR.Format(SR.LengthAttribute_InvalidValueType, value.GetType()));
System\ComponentModel\DataAnnotations\RangeAttribute.cs (3)
202Type operandType = minimum.GetType(); 239conversion = value => value.GetType() == type 245conversion = value => value.GetType() == type ? value : converter.ConvertFrom(value);
System\ComponentModel\DataAnnotations\ValidationContext.cs (1)
157public Type ObjectType => ObjectInstance.GetType();
System\ComponentModel\DataAnnotations\Validator.cs (1)
519var properties = TypeDescriptor.GetProperties(instance.GetType());
System.ComponentModel.Composition (36)
Microsoft\Internal\Collections\CollectionServices.CollectionOfObject.cs (1)
27if (typeof(IList).IsAssignableFrom(collectionObject.GetType()))
Microsoft\Internal\GenerationServices.cs (6)
85Type valueType = value.GetType(); 91valueType = rawValue.GetType(); 156SR.Format(SR.InvalidMetadataValue, value.GetType().FullName)); 222if (ReflectionServices.TryGetGenericInterfaceType(enumerable.GetType(), GenerationServices.s_iEnumerableTypeofT, out Type? closedType)) 252ilGenerator.Emit(OpCodes.Box, value!.GetType()); 269return value.GetType().IsValueType;
System\ComponentModel\Composition\AttributedModel\AttributedModelDiscovery.cs (2)
41ReflectionComposablePartDefinition definition = AttributedModelDiscovery.CreatePartDefinition(attributedPart.GetType(), PartCreationPolicyAttribute.Shared, true, (ICompositionElement?)null); 52var mappedType = reflectionContext.MapType(IntrospectionExtensions.GetTypeInfo(attributedPart.GetType()));
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (1)
269if (exportAttribute.GetType() == CompositionServices.InheritedExportAttributeType)
System\ComponentModel\Composition\AttributedModelServices.cs (1)
49throw ExceptionBuilder.CreateReflectionModelInvalidPartDefinition(nameof(partDefinition), partDefinition.GetType());
System\ComponentModel\Composition\ExceptionBuilder.cs (1)
32return new ObjectDisposedException(instance.GetType().ToString());
System\ComponentModel\Composition\Hosting\ApplicationCatalog.cs (1)
174$"{GetType().Name} (Path=\"{AppDomain.CurrentDomain.BaseDirectory}\") (PrivateProbingPath=\"{AppDomain.CurrentDomain.RelativeSearchPath}\")"; // NOLOC
System\ComponentModel\Composition\Hosting\AssemblyCatalog.cs (1)
541$"{GetType().Name} (Assembly=\"{Assembly.FullName}\")"; // NOLOC
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (1)
398throw new ObjectDisposedException(GetType().Name);
System\ComponentModel\Composition\Hosting\CompositionServices.cs (4)
281Type attrType = attr.GetType(); 308if (value != null && !IsValidAttributeType(value.GetType())) 310throw ExceptionBuilder.CreateDiscoveryException(SR.Discovery_MetadataContainsValueWithInvalidType, pi.GetDisplayName(), value.GetType().GetDisplayName()); 385itemType = item.GetType();
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (1)
725$"{GetType().Name} (Path=\"{_path}\")"; // NOLOC
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (1)
361GetType().Name,
System\ComponentModel\Composition\MetadataViewGenerator.cs (2)
158if ((defaultAttribute.Value != null) && (defaultAttribute.Value.GetType().IsValueType)) 160IL.Emit(OpCodes.Box, defaultAttribute.Value.GetType());
System\ComponentModel\Composition\ReflectionModel\ImportingMember.cs (3)
198collection!.GetType().FullName), 228collection.GetType().FullName), 245collection.GetType().FullName),
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (10)
24throw ExceptionBuilder.CreateReflectionModelInvalidPartDefinition(nameof(partDefinition), partDefinition.GetType()); 37throw ExceptionBuilder.CreateReflectionModelInvalidPartDefinition(nameof(partDefinition), partDefinition.GetType()); 51SR.Format(SR.ReflectionModel_InvalidExportDefinition, exportDefinition.GetType()), 66SR.Format(SR.ReflectionModel_InvalidMemberImportDefinition, importDefinition.GetType()), 81SR.Format(SR.ReflectionModel_InvalidParameterImportDefinition, importDefinition.GetType()), 97SR.Format(SR.ReflectionModel_InvalidImportDefinition, importDefinition.GetType()), 119SR.Format(SR.ReflectionModel_InvalidImportDefinition, importDefinition.GetType()), 310throw ExceptionBuilder.CreateReflectionModelInvalidPartDefinition(nameof(partDefinition), partDefinition.GetType()); 420SR.Format(SR.ReflectionModel_InvalidExportDefinition, export.GetType())); 446SR.Format(SR.ReflectionModel_InvalidMemberImportDefinition, import.GetType()));
System.ComponentModel.Composition.Registration (1)
System\ComponentModel\Composition\Registration\PartBuilder.cs (1)
212Type attrType = attr.GetType();
System.ComponentModel.Primitives (6)
System\ComponentModel\Component.cs (2)
127return GetType().FullName!; 130return s.Name + " [" + GetType().FullName + "]";
System\ComponentModel\Design\Serialization\DesignerSerializerAttribute.cs (1)
77_typeId = GetType().FullName + baseType;
System\ComponentModel\DesignerAttribute.cs (1)
108_typeId = GetType().FullName + baseType;
System\ComponentModel\DesignerCategoryAttribute.cs (1)
67public override object TypeId => GetType().FullName + Category;
System\ComponentModel\EditorAttribute.cs (1)
91_typeId = GetType().FullName + baseType;
System.ComponentModel.TypeConverter (104)
System\ComponentModel\ArrayConverter.cs (2)
22return SR.Format(SR.UsingResourceKeys() ? "{0} Array" : SR.Array, value.GetType().Name); 47Type arrayType = value.GetType();
System\ComponentModel\AttributeCollection.cs (2)
176Type aType = attribute.GetType(); 212Attribute? attr = this[attribute.GetType()];
System\ComponentModel\ComponentResourceManager.cs (2)
70ApplyResources(value, value.GetType(), objectName, culture); 85Type typeFromValue = value.GetType();
System\ComponentModel\Design\DesignerOptionService.cs (2)
478public override Type ComponentType => _option.GetType(); 482public override Type PropertyType => _option.GetType();
System\ComponentModel\Design\Serialization\RootDesignerSerializerAttribute.cs (1)
88_typeId = string.Concat(GetType().FullName, baseType);
System\ComponentModel\Design\ServiceContainer.cs (2)
83if (!(serviceInstance is ServiceCreatorCallback) && !serviceInstance.GetType().IsCOMObject && !serviceType.IsInstanceOfType(serviceInstance)) 193if (service != null && !service.GetType().IsCOMObject && !serviceType!.IsInstanceOfType(service))
System\ComponentModel\LicenseException.cs (1)
33public LicenseException(Type? type, object? instance) : this(type, null, SR.Format(SR.LicExceptionTypeAndInstance, type?.FullName, instance?.GetType().FullName))
System\ComponentModel\LicenseManager.cs (1)
104Type providerType = provider.GetType();
System\ComponentModel\LicenseProviderAttribute.cs (1)
84return GetType().FullName + typeName;
System\ComponentModel\MarshalByValueComponent.cs (2)
165return s.Name + " [" + GetType().FullName + "]"; 167return GetType().FullName;
System\ComponentModel\MaskedTextProvider.cs (2)
461if (GetType() == typeof(MaskedTextProvider)) 483clonedProvider = (Activator.CreateInstance(GetType(), parameters) as MaskedTextProvider)!;
System\ComponentModel\MemberDescriptor.cs (2)
254if (obj.GetType() != GetType())
System\ComponentModel\NullableConverter.cs (1)
60if (value == null || value.GetType() == UnderlyingType)
System\ComponentModel\ProvidePropertyAttribute.cs (1)
64public override object TypeId => GetType().FullName + PropertyName;
System\ComponentModel\ReflectEventDescriptor.cs (1)
193if (EventType != value.GetType())
System\ComponentModel\ReflectPropertyDescriptor.cs (6)
202if (_defaultValue != null && PropertyType.IsEnum && PropertyType.GetEnumUnderlyingType() == _defaultValue.GetType()) 302bool storedAsUnderlyingType = defaultValue != null && PropertyType.IsEnum && PropertyType.GetEnumUnderlyingType() == defaultValue.GetType(); 903Debug.WriteLine($"[{Name}]: GetValue({component?.GetType().Name ?? "(null)"})"); 931name ??= component.GetType().FullName; 1080Debug.WriteLine($"[{Name}]: SetValue({component?.GetType().Name ?? "(null)"}, {value?.GetType().Name ?? "(null)"})");
System\ComponentModel\ReflectTypeDescriptionProvider.cs (8)
263argTypes[idx] = arg.GetType(); 491return GetClassName(instance.GetType()); 510return GetConverter(instance.GetType(), instance); 536return GetEditor(instance.GetType(), instance, editorBaseType); 563Type componentType = instance.GetType(); 814return GetPropertyOwner(instance.GetType(), instance); 1254Type providerType = provider.GetType(); 1627return (converter.GetType() != typeof(TypeConverter));
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (1)
376Debug.Fail($"Editor {editor.GetType().FullName} is not an instance of {editorBaseType.FullName} but it is in that base types table.");
System\ComponentModel\RefreshEventArgs.cs (1)
18TypeChanged = componentChanged?.GetType();
System\ComponentModel\ToolboxItemFilterAttribute.cs (1)
81public override object TypeId => _typeId ??= GetType().FullName + FilterString;
System\ComponentModel\TypeConverter.cs (5)
194string? valueTypeName = value == null ? (SR.UsingResourceKeys() ? "(null)" : SR.Null) : value.GetType().FullName; 195throw new NotSupportedException(SR.Format(SR.ConvertFromException, GetType().Name, valueTypeName)); 204string? valueTypeName = value == null ? (SR.UsingResourceKeys() ? "(null)" : SR.Null) : value.GetType().FullName; 205throw new NotSupportedException(SR.Format(SR.ConvertToException, GetType().Name, valueTypeName, destinationType.FullName)); 315if (value == null || CanConvertFrom(context, value.GetType()))
System\ComponentModel\TypeDescriptionProvider.cs (3)
196return GetReflectionType(instance.GetType(), instance); 270return GetTypeDescriptor(instance.GetType(), instance); 334return GetTypeDescriptorFromRegisteredType(instance.GetType(), instance);
System\ComponentModel\TypeDescriptor.cs (56)
1742Type type = instance.GetType(); 1853Type keyType = key as Type ?? key.GetType(); 2320Type type = component.GetType(); 2734Attribute? memberAttribute = member.Attributes[attribute.GetType()]; 2789throw new ArgumentException(SR.Format(SR.ConvertToException, nameof(objectType), instance.GetType()), nameof(instance)); 3297Type type = instance.GetType(); 3446if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3448if (attrs == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetAttributes")); 3469if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3470string? name = desc.GetClassName() ?? _instance.GetType().FullName; 3491if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3512if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3514if (converter == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetConverter")); 3530return rp.GetConverterFromRegisteredType(_instance.GetType(), _instance); 3534if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3536if (converter == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetConverter")); 3557if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3577if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3599if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3619if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3621if (events == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetEvents")); 3640if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptorFromRegisteredType")); 3642if (events == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetEventsFromRegisteredType")); 3667if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3669if (evts == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetEvents")); 3689if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3691if (properties == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetProperties")); 3710if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3712if (properties == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetProperties")); 3737if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3739if (properties == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetProperties")); 3761if (desc == null) throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetExtendedTypeDescriptor")); 3809throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 3812throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetAttributes")); 3836throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 3861throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 3887throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 3890throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetConverter")); 3914throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 3917throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetConverterFromRegisteredType")); 3942throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 3968throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 3996throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 4021throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 4024throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetEvents")); 4048throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptorFromRegisteredType")); 4051throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetEventsFromRegisteredType")); 4076throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 4079throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetEvents")); 4104throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 4108throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetProperties")); 4132throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 4137throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetPropertiesFromRegisteredType")); 4162throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor")); 4165throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetProperties")); 4189throw new InvalidOperationException(SR.Format(SR.TypeDescriptorProviderError, _node.Provider.GetType().FullName, "GetTypeDescriptor"));
System.Composition.Convention (1)
System\Composition\Convention\PartConventionBuilder.cs (1)
409Type attrType = attr.GetType();
System.Composition.TypedParts (5)
System\Composition\CompositionContextExtensions.cs (2)
51var objType = objectWithLooseImports.GetType(); 72var importsSatisfiedMethods = objectWithLooseImports.GetType().GetRuntimeMethods().Where(m =>
System\Composition\TypedParts\ContractHelpers.cs (1)
66var attrType = attr.GetType();
System\Composition\TypedParts\Discovery\TypeInspector.cs (2)
112var valueType = ema.Value?.GetType() ?? typeof(object); 150var attrType = attribute.GetType();
System.Configuration.ConfigurationManager (31)
System\Configuration\ApplicationSettingsBase.cs (4)
403SettingChangingEventArgs e = new SettingChangingEventArgs(propertyName, this.GetType().FullName, SettingsKey, value, false); 507settingsProperty.Attributes[attribute.GetType()] = attribute; 544Type type = GetType(); 643_init.Attributes.Add(attr.GetType(), attr);
System\Configuration\ConfigurationConverterBase.cs (1)
22if ((value != null) && (value.GetType() != expected))
System\Configuration\ConfigurationElement.cs (10)
193if (PropertiesFromType(GetType(), out result)) 459if (elem.GetType() != GetType()) elem.SetLocked(); 677(compareTo.GetType() != GetType()) || 823if ((s_perTypeValidators != null) && s_perTypeValidators.TryGetValue(elem.GetType(), out ConfigurationValidatorBase value)) 868tw.WriteLine("Type: " + GetType().FullName); 870foreach (PropertyInfo pi in GetType().GetProperties()) 1762if ((validator != null) && !validator.CanValidate(elem.GetType())) 1765elem.GetType().Name));
System\Configuration\ConfigurationElementCollection.cs (2)
208if (compareTo == null || compareTo.GetType() != GetType())
System\Configuration\ConfigurationManager.cs (2)
56if ((section == null) || (section.GetType() != typeof(ConnectionStringsSection))) 210(s_configSystem.GetType() != typeof(ClientConfigurationSystem)))
System\Configuration\ConfigurationProperty.cs (1)
280if (!Converter.CanConvertFrom(value.GetType()))
System\Configuration\ConfigurationSection.cs (1)
55ConfigurationElement tempElement = CreateElement(GetType());
System\Configuration\ElementInformation.cs (1)
51public Type Type => _thisElement.GetType();
System\Configuration\MgmtConfigurationRecord.cs (3)
686string typeName = configSection.SectionInformation.Type ?? Host.GetConfigTypeName(configSection.GetType()); 705configSection.GetType(), typeof(ConfigurationSection), true), 840string typeName = configSectionGroup.Type ?? Host.GetConfigTypeName(configSectionGroup.GetType());
System\Configuration\SettingsPropertyValue.cs (2)
118if (value != null && !Property.PropertyType.IsAssignableFrom(value.GetType())) // is it the correct type 149if (value != null && !Property.PropertyType.IsAssignableFrom(value.GetType())) // is it the correct type
System\Configuration\ValidatorUtils.cs (1)
15if (value.GetType() != allowedType)
System\Diagnostics\FilterElement.cs (1)
23if (Type.GetType(TypeName) != filter.GetType() || InitDataChanged(filter))
System\Diagnostics\ListenerElementsCollection.cs (1)
335if (Type.GetType(className) != listener.GetType() || InitDataChanged(listener))
System\Diagnostics\TraceConfiguration.cs (1)
116Type currentType = traceSource.Switch.GetType();
System.Data.Common (161)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (4)
312return Argument(SR.Format(SR.ADP_CollectionRemoveInvalidObject, itemType.Name, collection.GetType().Name)); 328return InvalidCast(SR.Format(SR.ADP_CollectionInvalidType, collection.Name, itemType.Name, invalidValue.GetType().Name)); 398return Argument(SR.Format(SR.ADP_CollectionIsNotParent, parameterType.Name, collection.GetType().Name)); 402return Argument(SR.Format(SR.ADP_CollectionIsNotParent, parameterType.Name, collection.GetType().Name));
src\libraries\Common\src\System\Data\Common\DbConnectionPoolKey.cs (1)
44if (obj == null || obj.GetType() != typeof(DbConnectionPoolKey))
System\Data\ColumnTypeConverter.cs (1)
113if (value != null && value.GetType() == typeof(string))
System\Data\Common\AdapterUtil.Common.cs (2)
368return CollectionIndexInt32(index, collection.GetType(), collection.Count); 408return CollectionIndexInt32(index, collection.GetType(), collection.Count);
System\Data\Common\BigIntegerStorage.cs (11)
64if (value.GetType() == typeof(BigInteger)) { return (BigInteger)value; } 65else if (value.GetType() == typeof(string)) { return BigInteger.Parse((string)value, formatProvider); } 66else if (value.GetType() == typeof(long)) { return (long)value; } 67else if (value.GetType() == typeof(int)) { return (int)value; } 68else if (value.GetType() == typeof(short)) { return (short)value; } 69else if (value.GetType() == typeof(sbyte)) { return (sbyte)value; } 70else if (value.GetType() == typeof(ulong)) { return (ulong)value; } 71else if (value.GetType() == typeof(uint)) { return (uint)value; } 72else if (value.GetType() == typeof(ushort)) { return (ushort)value; } 73else if (value.GetType() == typeof(byte)) { return (byte)value; } 74else { throw ExceptionBuilder.ConvertFailed(value.GetType(), typeof(System.Numerics.BigInteger)); }
System\Data\Common\DataAdapter.cs (1)
207DataAdapter clone = (DataAdapter)Activator.CreateInstance(GetType())!;
System\Data\Common\DbConnectionStringBuilder.cs (9)
316if ((GetType() != connectionStringBuilder.GetType()) || (CurrentValues.Count != connectionStringBuilder.CurrentValues.Count)) 437GetType(); 481vtype = value.GetType(); 524GetType(), vtype, false, useAttributes!); 564Attribute? attr = property.Attributes[attribute.GetType()]; 593GetType(); 602GetType(); 647GetType();
System\Data\Common\DbConnectionStringCommon.cs (1)
21throw ADP.ConvertFailed(value.GetType(), typeof(string), e);
System\Data\Common\DbProviderFactories.cs (1)
129string factoryTypeAssemblyQualifiedName = factory.GetType().AssemblyQualifiedName!;
System\Data\Common\ObjectStorage.cs (9)
74if (value!.GetType() == valueNo1.GetType()) 127Families Family1 = GetFamily(valueNo1.GetType()); 128Families Family2 = GetFamily(valueNo2.GetType()); 246Type valType = value.GetType(); 477if (!IsTypeCustomType(value.GetType())) 482if (Type.GetTypeCode(value.GetType()) != TypeCode.Object) 497XmlSerializer serializerWithOutRootAttribute = ObjectStorage.GetXmlSerializer(value.GetType()); 513XmlSerializer serializerWithRootAttribute = ObjectStorage.GetXmlSerializer(value.GetType(), xmlAttrib);
System\Data\Common\SQLConvert.cs (17)
19Type valueType = value.GetType(); 37Type valueType = value.GetType(); 56Type valueType = value.GetType(); 79Type valueType = value.GetType(); 104Type valueType = value.GetType(); 137Type valueType = value.GetType(); 167Type valueType = value.GetType(); 198Type valueType = value.GetType(); 228Type valueType = value.GetType(); 246Type valueType = value.GetType(); 264Type valueType = value.GetType(); 282Type valueType = value.GetType(); 300Type valueType = value.GetType(); 318Type valueType = value.GetType(); 334Type valueType = value.GetType(); 409Type valueType = value.GetType(); 563Type valueType = value.GetType();
System\Data\Common\SQLTypes\SQLBinaryStorage.cs (1)
119Debug.Assert((value.GetType() == typeof(SqlBinary)), "wrong input type");
System\Data\Common\SQLTypes\SQlBooleanStorage.cs (1)
153Debug.Assert((value.GetType() == typeof(SqlBoolean)), "wrong input type");
System\Data\Common\SQLTypes\SQLBytesStorage.cs (1)
117Debug.Assert((value.GetType() == typeof(SqlBytes)), "wrong input type");
System\Data\Common\SQLTypes\SQLByteStorage.cs (1)
229Debug.Assert((value.GetType() == typeof(SqlByte)), "wrong input type");
System\Data\Common\SQLTypes\SQLCharsStorage.cs (1)
120Debug.Assert((value.GetType() == typeof(SqlChars)), "wrong input type");
System\Data\Common\SQLTypes\SQLDateTimeStorage.cs (1)
155Debug.Assert((value.GetType() == typeof(SqlDateTime)), "wrong input type");
System\Data\Common\SQLTypes\SQLDecimalStorage.cs (1)
227Debug.Assert((value.GetType() == typeof(SqlDecimal)), "wrong input type");
System\Data\Common\SQLTypes\SQLDoubleStorage.cs (1)
228Debug.Assert((value.GetType() == typeof(SqlDouble)), "wrong input type");
System\Data\Common\SQLTypes\SQLGuidStorage.cs (1)
120Debug.Assert((value.GetType() == typeof(SqlGuid)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt16Storage.cs (1)
228Debug.Assert((value.GetType() == typeof(SqlInt16)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt32Storage.cs (1)
228Debug.Assert((value.GetType() == typeof(SqlInt32)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt64Storage.cs (1)
229Debug.Assert((value.GetType() == typeof(SqlInt64)), "wrong input type");
System\Data\Common\SQLTypes\SQLMoneyStorage.cs (1)
228Debug.Assert((value.GetType() == typeof(SqlMoney)), "wrong input type");
System\Data\Common\SQLTypes\SQLSingleStorage.cs (1)
226Debug.Assert((value.GetType() == typeof(SqlSingle)), "wrong input type");
System\Data\Common\SQLTypes\SQLStringStorage.cs (1)
181Debug.Assert((value.GetType() == typeof(SqlString)), "wrong input type");
System\Data\Common\SqlUDTStorage.cs (1)
216XmlSerializer serializerWithOutRootAttribute = ObjectStorage.GetXmlSerializer(value.GetType());
System\Data\Common\TimeSpanStorage.cs (1)
186Type typeofValue = value.GetType();
System\Data\DataColumn.cs (8)
537throw ExceptionBuilder.DefaultValueDataType(ColumnName, DefaultValue.GetType(), value, ex); 541throw ExceptionBuilder.DefaultValueDataType(ColumnName, DefaultValue.GetType(), value, ex); 691throw ExceptionBuilder.DefaultValueColumnDataType(ColumnName, newDefaultValue.GetType(), DataType, ex); 1484Type leftType = value.GetType(); 1485Type rightType = _storage!.Get(record1).GetType(); 1523DataColumn clone = (DataColumn)Activator.CreateInstance(GetType())!; 1631(DataStorage.IsTypeCustomType(value.GetType()) && !(value is Type)); 1964Debug.Assert(null != value && DataColumn.IsAutoIncrementType(value.GetType()) && !(value is BigInteger), "unexpected value for autoincrement");
System\Data\DataRowComparer.cs (5)
33return (a.Equals(b) || (a.GetType().IsArray && CompareArray((Array)a, b as Array))); 65if (a.GetType() == b.GetType() && (0 == index1) && (0 == index2)) 67switch (Type.GetTypeCode(a.GetType().GetElementType())) 192Type valueType = value.GetType();
System\Data\DataRowExtensions.cs (1)
192Type valueType = value.GetType();
System\Data\DataSet.cs (3)
1137return (DataSet)Activator.CreateInstance(GetType(), true)!; 2282if (root.ChildNodes.Count == 0 || ((root.ChildNodes.Count == 1) && root.FirstChild!.GetType() == typeof(System.Xml.XmlText))) 3524if (GetType() == typeof(DataSet))
System\Data\DataTable.cs (3)
1050_isTypedDataTable = (byte)((GetType() != typeof(DataTable)) ? 1 : 2); 2325protected virtual DataTable CreateInstance() => (DataTable)Activator.CreateInstance(GetType(), true)!; 6725if (GetType() == typeof(DataTable))
System\Data\DefaultValueTypeConverter.cs (1)
43if (value != null && value.GetType() == typeof(string))
System\Data\Filter\BinaryNode.cs (16)
242if (((vLeft.GetType() == typeof(SqlBoolean)) && ((vRight.GetType() == typeof(SqlBoolean)) || (vRight.GetType() == typeof(bool)))) || 243((vRight.GetType() == typeof(SqlBoolean)) && ((vLeft.GetType() == typeof(SqlBoolean)) || (vLeft.GetType() == typeof(bool))))) 278SetTypeMismatchError(op, vLeft.GetType(), vRight.GetType()); 301Type typeofLeft = vLeft.GetType(); 302Type typeofRight = vRight.GetType(); 1112resultType = DataStorage.GetStorageType(vLeft.GetType()); 1132SetTypeMismatchError(op, vLeft.GetType(), vRight.GetType()); 1545SetTypeMismatchError(_op, vLeft.GetType(), vRight.GetType()); 1568SetTypeMismatchError(_op, vLeft.GetType(), typeof(string));
System\Data\Filter\ExpressionParser.cs (3)
349if (nodebefore == null || nodebefore.GetType() != typeof(NameNode)) 415Debug.Assert(_topNode > 0 && NodePeek()!.GetType() == typeof(FunctionNode), "The function node should be created on '('"); 529if (before != null && before.GetType() == typeof(NameNode))
System\Data\Filter\FunctionNode.cs (13)
98if (_arguments[1].GetType() == typeof(NameNode)) 153if (argumentValues[i].GetType() != s_funcs[_info]._parameters[i]) 157if (s_funcs[_info]._parameters[i] == typeof(int) && ExpressionNode.IsInteger(DataStorage.GetStorageType(argumentValues[i].GetType()))) 163if ((typeof(string) != (argumentValues[i].GetType())) && (typeof(SqlString) != (argumentValues[i].GetType()))) 282Type nodeType = node.GetType(); 323storageType = DataStorage.GetStorageType(argumentValues[0].GetType()); 334storageType = DataStorage.GetStorageType(argumentValues[0].GetType()); 341_ => throw ExprException.DatatypeConversion(argumentValues[0].GetType(), typeof(bool)), 424Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid first argument {argumentValues[0].GetType().FullName} in {s_funcs[_info]._name}"); 425Debug.Assert(argumentValues[1] is int, $"Invalid second argument {argumentValues[1].GetType().FullName} in {s_funcs[_info]._name}"); 426Debug.Assert(argumentValues[2] is int, $"Invalid third argument {argumentValues[2].GetType().FullName} in {s_funcs[_info]._name}"); 488storageType = DataStorage.GetStorageType(argumentValues[0].GetType());
System\Data\Filter\UnaryNode.cs (2)
61storageType = DataStorage.GetStorageType(vl.GetType()); 70storageType = DataStorage.GetStorageType(vl.GetType());
System\Data\Merger.cs (2)
480SR.Format(SR.DataMerge_MissingConstraint, src.GetType().FullName, src.ConstraintName), 506SR.Format(SR.DataMerge_MissingConstraint, src.GetType().FullName, src.ConstraintName),
System\Data\PrimaryKeyTypeConverter.cs (1)
28Array.Empty<DataColumn>().GetType().Name :
System\Data\ProviderBase\SchemaMapping.cs (2)
702Type fieldType = chapterValue.GetType(); 1049Type fieldType = chapterValue.GetType();
System\Data\Select.cs (4)
662StorageType leftType = DataStorage.GetStorageType(vLeft.GetType()); 671StorageType rightType = DataStorage.GetStorageType(vRight.GetType()); 683BinaryNode.SetTypeMismatchError(expr._op, vLeft.GetType(), vRight.GetType());
System\Data\SQLTypes\SQLBinary.cs (1)
341throw ADP.WrongType(value!.GetType(), typeof(SqlBinary));
System\Data\SQLTypes\SQLBoolean.cs (1)
448throw ADP.WrongType(value!.GetType(), typeof(SqlBoolean));
System\Data\SQLTypes\SQLByte.cs (1)
457throw ADP.WrongType(value!.GetType(), typeof(SqlByte));
System\Data\SQLTypes\SQLDateTime.cs (1)
599throw ADP.WrongType(value!.GetType(), typeof(SqlDateTime));
System\Data\SQLTypes\SQLDecimal.cs (1)
3283throw ADP.WrongType(value!.GetType(), typeof(SqlDecimal));
System\Data\SQLTypes\SQLDouble.cs (1)
373throw ADP.WrongType(value!.GetType(), typeof(SqlDouble));
System\Data\SQLTypes\SQLGuid.cs (1)
264throw ADP.WrongType(value!.GetType(), typeof(SqlGuid));
System\Data\SQLTypes\SQLInt16.cs (1)
458throw ADP.WrongType(value!.GetType(), typeof(SqlInt16));
System\Data\SQLTypes\SQLInt32.cs (1)
473throw ADP.WrongType(value!.GetType(), typeof(SqlInt32));
System\Data\SQLTypes\SQLInt64.cs (1)
532throw ADP.WrongType(value!.GetType(), typeof(SqlInt64));
System\Data\SQLTypes\SQLMoney.cs (1)
527throw ADP.WrongType(value!.GetType(), typeof(SqlMoney));
System\Data\SQLTypes\SQLSingle.cs (1)
383throw ADP.WrongType(value!.GetType(), typeof(SqlSingle));
System\Data\SQLTypes\SQLString.cs (1)
848throw ADP.WrongType(value!.GetType(), typeof(SqlString));
System\Data\TypeLimiter.cs (1)
214throw new ObjectDisposedException(GetType().FullName);
System\Data\xmlsaver.cs (9)
1450if (col.GetType() != typeof(DataColumn)) 1872if (colTxt.GetType() != typeof(DataColumn)) 2583if (!col.IsCustomType || !DataColumn.IsValueCustomTypeInstance(columnValue) || (typeof(IXmlSerializable).IsAssignableFrom(columnValue.GetType()))) 2588Type valuesType = columnValue.GetType(); 2607if (!startElementSkipped && columnValue.GetType() != col.DataType) 2618if (columnValue.GetType() != col.DataType) 3017if (!col.IsCustomType || !DataColumn.IsValueCustomTypeInstance(value) || (typeof(IXmlSerializable).IsAssignableFrom(value.GetType()))) 3024Type valuesType = value.GetType(); 3051if (value.GetType() != col.DataType)
System.Data.Odbc (24)
Common\System\Data\Common\AdapterUtil.Odbc.cs (8)
302return DataAdapter(SR.GetString(SR.ADP_DeriveParametersNotSupported, value.GetType().Name, value.CommandType.ToString())); 395string message = SR.GetString(SR.ADP_ParameterConversionFailed, value.GetType().Name, destType.Name); 425return CollectionIndexInt32(index, collection.GetType(), collection.Count); 429return CollectionIndexString(parameterType, ADP.ParameterName, parameterName, collection.GetType()); 433return CollectionNullValue(parameter, collection.GetType(), parameterType); 437return CollectionInvalidType(collection.GetType(), parameterType, invalidValue); 445return InvalidOperation(SR.GetString(SR.ADP_ParallelTransactionsNotSupported, obj.GetType().Name)); 449return InvalidOperation(SR.GetString(SR.ADP_TransactionZombied, obj.GetType().Name));
Common\System\Data\Common\DbConnectionStringCommon.cs (4)
190throw ADP.ConvertFailed(value.GetType(), typeof(bool), e); 229throw ADP.ConvertFailed(value.GetType(), typeof(bool), e); 241throw ADP.ConvertFailed(value.GetType(), typeof(int), e); 253throw ADP.ConvertFailed(value.GetType(), typeof(string), e);
Common\System\Data\ProviderBase\DbBuffer.cs (1)
387ValidateCheck(offset, Marshal.SizeOf(structure.GetType()));
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (4)
312return Argument(SR.Format(SR.ADP_CollectionRemoveInvalidObject, itemType.Name, collection.GetType().Name)); 328return InvalidCast(SR.Format(SR.ADP_CollectionInvalidType, collection.Name, itemType.Name, invalidValue.GetType().Name)); 398return Argument(SR.Format(SR.ADP_CollectionIsNotParent, parameterType.Name, collection.GetType().Name)); 402return Argument(SR.Format(SR.ADP_CollectionIsNotParent, parameterType.Name, collection.GetType().Name));
src\libraries\Common\src\System\Data\Common\DbConnectionPoolKey.cs (1)
44if (obj == null || obj.GetType() != typeof(DbConnectionPoolKey))
System\Data\Odbc\OdbcDataReader.cs (1)
76throw new ObjectDisposedException(GetType().Name);
System\Data\Odbc\OdbcMetaDataFactory.cs (2)
464if (values[positionOfColumnType].GetType() == typeof(short)) 490if (values[positionOfProcedureType].GetType() == typeof(short))
System\Data\Odbc\OdbcParameter.cs (3)
976if ((typemap != _typemap) && (null != Value) && !Convert.IsDBNull(Value) && (Value.GetType() != _typemap!._type)) 992Type valueType = value.GetType(); 1027Type type = value.GetType();
System.Diagnostics.DiagnosticSource (8)
System\Diagnostics\DsesFilterAndTransform.cs (2)
441Type argType = args.GetType(); 705Type? objType = obj?.GetType();
System\Diagnostics\Metrics\AggregationManager.cs (2)
363Type aggregatorType = createAggregatorFunc.GetType().GenericTypeArguments[0]; 370Type type = instrument.GetType();
System\Diagnostics\Metrics\Meter.cs (1)
533if (instrument.GetType() == instrumentType && instrument.Unit == unit &&
System\Diagnostics\Metrics\MetricsEventSource.cs (3)
468beginInstrumentMeasurements: (i, state) => Parent.BeginInstrumentReporting(sessionId, i.Meter.Name, i.Meter.Version, i.Name, i.GetType().Name, i.Unit, i.Description, 470endInstrumentMeasurements: (i, state) => Parent.EndInstrumentReporting(sessionId, i.Meter.Name, i.Meter.Version, i.Name, i.GetType().Name, i.Unit, i.Description, 472instrumentPublished: (i, state) => Parent.InstrumentPublished(sessionId, i.Meter.Name, i.Meter.Version, i.Name, i.GetType().Name, i.Unit, i.Description,
System.Diagnostics.Process (1)
System\Diagnostics\Process.cs (1)
99if (GetType() == typeof(Process))
System.Diagnostics.TraceSource (1)
System\Diagnostics\TraceUtils.cs (1)
24throw new ArgumentException(SR.Format(SR.AttributeNotSupported, key, parent.GetType().FullName));
System.Drawing.Common (7)
System\Drawing\Font.cs (3)
261$"[{GetType().Name}: Name={FontFamily.Name}, Size={_fontSize}, Units={(int)_fontUnit}, GdiCharSet={_gdiCharSet}, GdiVerticalFont={_gdiVerticalFont}]"; 271Type type = logFont.GetType(); 629Type type = lf.GetType();
System\Drawing\Icon.cs (2)
185public IntPtr Handle => _handle.IsNull ? throw new ObjectDisposedException(GetType().Name) : (nint)_handle; 408throw new InvalidOperationException(SR.Format(SR.IllegalState, GetType().Name));
System\Drawing\Text\FontCollection.cs (1)
42bool installedFontCollection = GetType() == typeof(InstalledFontCollection);
System\Drawing\ToolboxBitmapAttribute.cs (1)
61component is not null ? GetImage(component.GetType(), large) : null;
System.Drawing.Common.Tests (23)
System\Drawing\IconConverterTests.cs (12)
39Assert.True(_icoConv.CanConvertFrom(null, _iconBytes.GetType()), "_iconBytes.GetType()"); 52Assert.True(_icoConvFrmTD.CanConvertFrom(null, _iconBytes.GetType()), "TD _iconBytes.GetType()"); 69Assert.True(_icoConv.CanConvertTo(null, _iconStr.GetType()), "_iconStr.GetType()"); 72Assert.True(_icoConv.CanConvertTo(null, _iconBytes.GetType()), "_iconBytes.GetType()"); 87Assert.True(_icoConvFrmTD.CanConvertTo(null, _iconStr.GetType()), "TD _iconStr.GetType()"); 90Assert.True(_icoConvFrmTD.CanConvertTo(null, _iconBytes.GetType()), "TD _iconBytes.GetType()"); 138byte[] newIconBytes = (byte[])_icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _iconBytes.GetType()); 141newIconBytes = (byte[])_icoConv.ConvertTo(_icon, _iconBytes.GetType()); 145Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _icon.GetType())); 155newIconBytes = (byte[])_icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _iconBytes.GetType()); 158newIconBytes = (byte[])_icoConvFrmTD.ConvertTo(_icon, _iconBytes.GetType()); 162Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _icon.GetType()));
System\Drawing\ImageConverterTests.cs (11)
63Assert.True(_imgConv.CanConvertFrom(null, _imageBytes.GetType()), "_imageBytes.GetType()"); 78Assert.True(_imgConvFrmTD.CanConvertFrom(null, _imageBytes.GetType()), "TD _imageBytes.GetType()"); 95Assert.True(_imgConv.CanConvertTo(null, _imageStr.GetType()), "_imageStr.GetType()"); 98Assert.True(_imgConv.CanConvertTo(null, _imageBytes.GetType()), "_imageBytes.GetType()"); 109Assert.True(_imgConvFrmTD.CanConvertTo(null, _imageStr.GetType()), "TD _imageStr.GetType()"); 112Assert.True(_imgConvFrmTD.CanConvertTo(null, _imageBytes.GetType()), "TD _imageBytes.GetType()"); 175byte[] newImageBytes = (byte[])_imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, _imageBytes.GetType()); 178newImageBytes = (byte[])_imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, _imageBytes.GetType()); 181newImageBytes = (byte[])_imgConvFrmTD.ConvertTo(_image, _imageBytes.GetType()); 198Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, _image.GetType())); 207Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, _image.GetType()));
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnWriter.Enumerated.cs (1)
37WriteEnumeratedValue(tag?.AsPrimitive() ?? Asn1Tag.Enumerated, value.GetType(), value);
System\Formats\Asn1\AsnWriter.NamedBitList.cs (1)
41WriteNamedBitList(tag, value.GetType(), value);
System.Formats.Nrbf (1)
System\Formats\Nrbf\NullsRecord.cs (1)
15public override TypeName TypeName => TypeName.Parse(GetType().Name.AsSpan());
System.IO.Compression (16)
System\IO\Compression\DeflateZLib\DeflateStream.cs (6)
279if (GetType() != typeof(DeflateStream)) 411if (GetType() != typeof(DeflateStream)) 512if (GetType() != typeof(DeflateStream)) 527if (GetType() != typeof(DeflateStream)) 750return GetType() == typeof(DeflateStream) ? 818if (GetType() != typeof(DeflateStream))
System\IO\Compression\GZipStream.cs (6)
100if (GetType() != typeof(GZipStream)) 128if (GetType() != typeof(GZipStream)) 144if (GetType() != typeof(GZipStream)) 182if (GetType() != typeof(GZipStream)) 207if (GetType() != typeof(GZipStream)) 229if (GetType() != typeof(GZipStream))
System\IO\Compression\ZipArchiveEntry.cs (1)
1431throw new ObjectDisposedException(GetType().ToString(), SR.HiddenStreamName);
System\IO\Compression\ZipCustomStreams.cs (3)
72throw new ObjectDisposedException(GetType().ToString(), SR.HiddenStreamName); 275throw new ObjectDisposedException(GetType().ToString(), SR.HiddenStreamName); 480throw new ObjectDisposedException(GetType().ToString(), SR.HiddenStreamName);
System.IO.IsolatedStorage (1)
System\IO\IsolatedStorage\IsolatedStorageFileStream.cs (1)
221GetType() != typeof(IsolatedStorageFileStream) ? base.DisposeAsync() :
System.IO.Pipelines (1)
System\IO\Pipelines\PipeAwaitable.cs (1)
132if (sc != null && sc.GetType() != typeof(SynchronizationContext))
System.Linq (2)
System\Linq\Enumerable.cs (2)
54if (source.GetType() == typeof(TSource[])) 58else if (source.GetType() == typeof(List<TSource>))
System.Linq.Expressions (25)
System\Dynamic\DynamicMetaObject.cs (2)
87return Value?.GetType(); 294throw System.Linq.Expressions.Error.InvalidMetaObjectCreated(ido.GetType());
System\Dynamic\DynamicMetaObjectBinder.cs (2)
103throw System.Linq.Expressions.Error.DynamicObjectResultNotAssignable(body.Type, target.Value.GetType(), this, expectedResult); 118throw System.Linq.Expressions.Error.DynamicBindingNeedsRestrictions(target.Value!.GetType(), this);
System\Dynamic\DynamicObject.cs (3)
588this.Value.GetType(), 589binder.GetType(), 816MemberInfo[] methods = Value.GetType().GetMember(method.Name, MemberTypes.Method, BindingFlags.Public | BindingFlags.Instance);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (2)
568EmitConstant(value, value.GetType()); 594Type siteType = site.GetType();
System\Linq\Expressions\ConstantExpression.cs (2)
33return Value.GetType(); 113Type valueType = value.GetType();
System\Linq\Expressions\DebugViewWriter.cs (1)
1129Out($".Extension<{node.GetType()}>");
System\Linq\Expressions\DynamicExpression.cs (1)
24Debug.Assert(delegateType.GetInvokeMethod().GetReturnType() == typeof(object) || GetType() != typeof(DynamicExpression));
System\Linq\Expressions\Error.cs (1)
1378return new ArgumentException(Strings.InvalidObjectType(value?.GetType() as object ?? "null", type), paramName);
System\Linq\Expressions\ExpressionStringBuilder.cs (3)
361else if (sValue == node.Value.GetType().ToString()) 783MethodInfo toString = node.GetType().GetMethod("ToString", Type.EmptyTypes)!; 793Out(node.NodeType == ExpressionType.Extension ? node.GetType().FullName : node.NodeType.ToString());
System\Linq\Expressions\Interpreter\Instruction.cs (1)
35o!.GetType();
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
121Type exceptionType = unwrappedException.GetType();
System\Linq\Expressions\Interpreter\TypeOperations.cs (2)
108frame.Push((object?)obj?.GetType() == type); 303Type valueType = value.GetType();
System\Linq\Expressions\MethodCallExpression.cs (1)
1363!(TypeUtils.IsSameOrSubclass(typeof(LambdaExpression), pType) && pType.IsAssignableFrom(arg.GetType())))
System\Linq\Expressions\TypeBinaryExpression.cs (1)
148return Utils.Constant(TypeOperand.GetNonNullableType() == ce.Value.GetType());
System\Runtime\CompilerServices\CallSiteHelpers.cs (2)
14private static readonly Type s_knownNonDynamicMethodType = typeof(object).GetMethod(nameof(ToString))!.GetType(); 32if (mb.Name == CallSite.CallSiteTargetMethodName && mb.GetType() != s_knownNonDynamicMethodType)
System.Linq.Queryable (2)
System\Linq\EnumerableRewriter.cs (1)
207Type t = GetPublicType(sq.Enumerable.GetType());
System\Linq\Queryable.cs (1)
38Type? enumType = TypeHelper.FindGenericType(typeof(IEnumerable<>), source.GetType());
System.Memory.Data (4)
System\BinaryData.cs (4)
85/// <param name="type">The type to use when serializing the data. If not specified, <see cref="object.GetType"/> will 91JsonSerializer.SerializeToUtf8Bytes(jsonSerializable, type ?? jsonSerializable?.GetType() ?? typeof(object), options), 104/// <param name="type">The type to use when serializing the data. If not specified, <see cref="object.GetType"/> will 108JsonSerializer.SerializeToUtf8Bytes(jsonSerializable, type ?? jsonSerializable?.GetType() ?? typeof(object), context),
System.Net.Http (36)
src\libraries\Common\src\System\Net\DebugSafeHandle.cs (1)
30_trace = "WARNING! GC-ed >>" + this.GetType().ToString() + "<< (should be explicitly closed) \r\n";
src\libraries\Common\src\System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs (1)
19_trace = "WARNING! GC-ed >>" + this.GetType().FullName + "<< (should be explicitly closed) \r\n";
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System\Net\Http\ByteArrayContent.cs (2)
49GetType() == typeof(ByteArrayContent) ? SerializeToStreamAsyncCore(stream, cancellationToken) : 68GetType() == typeof(ByteArrayContent) ? CreateMemoryStreamForByteArray() : // type check ensures we use possible derived type's CreateContentReadStreamAsync override
System\Net\Http\FormUrlEncodedContent.cs (2)
92GetType() == typeof(FormUrlEncodedContent) ? SerializeToStreamAsyncCore(stream, cancellationToken) : 96GetType() == typeof(FormUrlEncodedContent) ? CreateMemoryStreamForByteArray() : // type check ensures we use possible derived type's CreateContentReadStreamAsync override
System\Net\Http\Headers\HttpHeaders.cs (10)
455Debug.Assert(parsedValue.GetType() == value.GetType(), 471Debug.Assert(item.GetType() == value.GetType(), 533Debug.Assert(parsedValue.GetType() == value.GetType(), 545Debug.Assert(item.GetType() == value.GetType(), 565Debug.Assert(GetType() == sourceHeaders.GetType(), "Can only copy headers from an instance of the same type.");
System\Net\Http\Headers\NameValueHeaderValue.cs (1)
146if (GetType() != typeof(NameValueHeaderValue))
System\Net\Http\HttpContent.cs (1)
296throw new NotSupportedException(SR.Format(SR.net_http_missing_sync_implementation, GetType(), nameof(HttpContent), nameof(SerializeToStream)));
System\Net\Http\HttpMessageHandler.cs (1)
24throw new NotSupportedException(SR.Format(SR.net_http_missing_sync_implementation, GetType(), nameof(HttpMessageHandler), nameof(Send)));
System\Net\Http\HttpRequestMessage.cs (1)
163sb.Append(_content == null ? "<null>" : _content.GetType().ToString());
System\Net\Http\HttpResponseMessage.cs (1)
192sb.Append(_content == null ? "<null>" : _content.GetType().ToString());
System\Net\Http\MultipartContent.cs (2)
197GetType() == typeof(MultipartContent) ? SerializeToStreamAsyncCore(stream, context, cancellationToken) : 246GetType() == typeof(MultipartContent) ? CreateContentReadStreamAsyncCore(async: true, cancellationToken).AsTask() :
System\Net\Http\MultipartFormDataContent.cs (1)
69GetType() == typeof(MultipartFormDataContent) ? SerializeToStreamAsyncCore(stream, context, cancellationToken) :
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (1)
407if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, $"Exception from {_proxy.GetType().Name}.GetProxy({request.RequestUri}): {ex}");
System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs (1)
44Debug.Fail($"DrainAsync should not be called for this response stream: {GetType()}");
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (1)
588throw new NotSupportedException(SR.Format(SR.net_http_http2_sync_not_supported, GetType()));
System\Net\Http\StreamContent.cs (2)
62GetType() == typeof(StreamContent) ? SerializeToStreamAsyncCore(stream, cancellationToken) : 114GetType() == typeof(StreamContent) ? new ReadOnlyStream(_content) : // type check ensures we use possible derived type's CreateContentReadStreamAsync override
System\Net\Http\StringContent.cs (2)
108GetType() == typeof(StringContent) ? SerializeToStreamAsyncCore(stream, cancellationToken) : 112GetType() == typeof(StringContent) ? CreateMemoryStreamForByteArray() : // type check ensures we use possible derived type's CreateContentReadStreamAsync override
System.Net.Http.Json (3)
System\Net\Http\Json\JsonContent.cs (3)
28Debug.Assert(inputValue is null || jsonTypeInfo.Type.IsAssignableFrom(inputValue.GetType())); 167if (inputValue is not null && !inputType.IsAssignableFrom(inputValue.GetType())) 169throw new ArgumentException(SR.Format(SR.SerializeWrongType, inputType, inputValue.GetType()));
System.Net.HttpListener (5)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System.Net.Mail (7)
src\libraries\Common\src\System\Net\DebugSafeHandle.cs (1)
30_trace = "WARNING! GC-ed >>" + this.GetType().ToString() + "<< (should be explicitly closed) \r\n";
src\libraries\Common\src\System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs (1)
19_trace = "WARNING! GC-ed >>" + this.GetType().FullName + "<< (should be explicitly closed) \r\n";
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System.Net.NameResolution (6)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System\Net\NameResolutionTelemetry.cs (1)
139Debug.Assert(host is not null, $"Unknown hostNameOrAddress type: {hostNameOrAddress.GetType().Name}");
System.Net.Ping (2)
System\Net\NetworkInformation\Ping.cs (2)
39if (GetType() == typeof(Ping)) 102throw new ObjectDisposedException(GetType().FullName);
System.Net.Primitives (8)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System\Net\IPEndPoint.cs (3)
160throw new ArgumentException(SR.Format(SR.net_InvalidAddressFamily, socketAddress.Family.ToString(), GetType().FullName), nameof(socketAddress)); 166throw new ArgumentException(SR.Format(SR.net_InvalidSocketAddressSize, socketAddress.GetType().FullName, GetType().FullName), nameof(socketAddress));
System.Net.Quic (9)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System\Net\Quic\QuicConnection.cs (3)
385throw new ArgumentException(SR.Format(SR.net_quic_unsupported_endpoint_type, options.RemoteEndPoint.GetType()), nameof(options)); 685Exception exception = ExceptionDispatchInfo.SetCurrentStackTrace(_disposed ? new ObjectDisposedException(GetType().FullName) : ThrowHelper.GetOperationAbortedException()); 874_acceptQueue.Writer.TryComplete(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(GetType().FullName)));
System\Net\Quic\QuicListener.cs (1)
433_acceptQueue.Writer.TryComplete(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(GetType().FullName)));
System.Net.Requests (5)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System.Net.Security (8)
src\libraries\Common\src\System\Net\DebugSafeHandle.cs (1)
30_trace = "WARNING! GC-ed >>" + this.GetType().ToString() + "<< (should be explicitly closed) \r\n";
src\libraries\Common\src\System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs (1)
19_trace = "WARNING! GC-ed >>" + this.GetType().FullName + "<< (should be explicitly closed) \r\n";
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System\Net\Security\SslStream.Protocol.cs (1)
281if (certificate.GetType() == typeof(X509Certificate2))
System.Net.Sockets (12)
src\libraries\Common\src\System\Net\DebugSafeHandleMinusOneIsInvalid.cs (1)
19_trace = "WARNING! GC-ed >>" + this.GetType().FullName + "<< (should be explicitly closed) \r\n";
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System\Net\Sockets\NetworkStream.cs (2)
252if (GetType() != typeof(NetworkStream)) 324if (GetType() != typeof(NetworkStream))
System\Net\Sockets\Socket.Unix.cs (1)
156throw new ObjectDisposedException(GetType().FullName);
System\Net\Sockets\SocketAsyncContext.Unix.cs (1)
2297public static string IdOf(object o) => o == null ? "(null)" : $"{o.GetType().Name}#{o.GetHashCode():X2}";
System\Net\Sockets\SocketPal.Unix.cs (2)
1900throw new ArgumentException(SR.Format(SR.net_sockets_select, socket?.GetType().FullName ?? "null", typeof(Socket).FullName), nameof(socketList)); 2007throw new ArgumentException(SR.Format(SR.net_sockets_select, socket?.GetType().FullName ?? "null", typeof(Socket).FullName), nameof(socketList));
System.Net.WebClient (1)
System\Net\WebClient.cs (1)
60if (GetType() == typeof(WebClient))
System.Net.WebSockets (5)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (5)
112public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance; 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 143return $"{c.GetType().Name}({c.Count})"; 149return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})"; 161if (toString == null || toString == value.GetType().FullName)
System.Net.WebSockets.Client (2)
System\Net\WebSockets\ClientWebSocket.cs (2)
111throw new ObjectDisposedException(GetType().FullName); 141throw new ObjectDisposedException(GetType().FullName);
System.Numerics.Tensors (2)
System\ThrowHelper.cs (2)
34if ((array is not null) && (array.GetType().GetElementType() != typeof(T))) 42if ((array is not null) && !typeof(T).IsValueType && (array.GetType() != typeof(T[])))
System.Private.CoreLib (288)
src\libraries\System.Private.CoreLib\src\System\Array.cs (2)
1086if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 1116if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
src\libraries\System.Private.CoreLib\src\System\Attribute.cs (8)
26if (this.GetType() != obj.GetType()) 29Type thisType = this.GetType(); 57Type type = GetType(); 72if (fieldValue != null && !fieldValue.GetType().IsArray) 97Type thisValueType = thisValue.GetType(); 102if (!thisValueType.Equals(thatValue.GetType())) 137public virtual object TypeId => GetType();
src\libraries\System.Private.CoreLib\src\System\Buffer.cs (2)
23if (src.GetType() != typeof(byte[])) 34if (dst.GetType() != typeof(byte[]))
src\libraries\System.Private.CoreLib\src\System\CodeDom\Compiler\IndentedTextWriter.cs (1)
68GetType() != typeof(IndentedTextWriter) ? FlushAsync() :
src\libraries\System.Private.CoreLib\src\System\Collections\ArrayList.cs (1)
2564_isArrayList = (list.GetType() == typeof(ArrayList));
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Comparer.cs (12)
71obj != null && GetType() == obj.GetType(); 74GetType().GetHashCode(); 106obj != null && GetType() == obj.GetType(); 109GetType().GetHashCode(); 124obj != null && GetType() == obj.GetType(); 127GetType().GetHashCode(); 142obj != null && GetType() == obj.GetType(); 145GetType().GetHashCode();
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (2)
117if (enumerable.GetType() == typeof(Dictionary<TKey, TValue>)) 162else if (enumerable.GetType() == typeof(List<KeyValuePair<TKey, TValue>>))
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\EqualityComparer.cs (16)
137obj != null && GetType() == obj.GetType(); 140GetType().GetHashCode(); 177obj != null && GetType() == obj.GetType(); 180GetType().GetHashCode(); 206obj != null && GetType() == obj.GetType(); 209GetType().GetHashCode(); 227obj != null && GetType() == obj.GetType(); 230GetType().GetHashCode(); 260obj != null && GetType() == obj.GetType(); 263GetType().GetHashCode(); 318public override int GetHashCode() => GetType().GetHashCode();
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\Collection.cs (1)
209Type targetType = array.GetType().GetElementType()!;
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (1)
140Type targetType = array.GetType().GetElementType()!;
src\libraries\System.Private.CoreLib\src\System\Convert.cs (3)
174if (ReferenceEquals(value.GetType(), targetType)) 219throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, value.GetType().FullName, targetType.FullName)); 244if (value.GetType() == conversionType)
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (4)
87argTypes[i] = args[i]!.GetType(); 221if (argTypes[index] == null || !CanChangePrimitive(args[index]!.GetType(), pCls)) 259if (argTypes[j] == null || !CanChangePrimitive(args[j]?.GetType(), paramArrayType)) 467valueType = value.GetType();
src\libraries\System.Private.CoreLib\src\System\Diagnostics\CodeAnalysis\DynamicallyAccessedMembersAttribute.cs (1)
21/// <see cref="object.GetType"/> on instances of that class, interface, or struct.
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
416Type underlyingType = Enum.GetUnderlyingType(data.GetType());
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (6)
766Type myType = this.GetType(); 2123if ((arg != null && !pType.IsAssignableFrom(arg.GetType())) 2873m_rawManifest = CreateManifestAndDescriptors(this.GetType(), Name, this); 3166if (source?.GetType() == typeof(NativeRuntimeEventSource)) 4250if (eventSource.GetType() == typeof(NativeRuntimeEventSource)) 4268if (eventSource.GetType() == typeof(NativeRuntimeEventSource))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (1)
171if (eventData.EventSource.GetType() == typeof(NativeRuntimeEventSource))
src\libraries\System.Private.CoreLib\src\System\Enum.cs (18)
403if (GetType() != flag.GetType() && !GetType().IsEquivalentTo(flag.GetType())) 404throw new ArgumentException(SR.Format(SR.Argument_EnumTypeDoesNotMatch, flag.GetType(), GetType())); 1150Type valueType = value.GetType(); 1198if (this.GetType() != obj.GetType()) 1288if (GetType() != target.GetType()) 1289throw new ArgumentException(SR.Format(SR.Arg_EnumAndObjectMustBeSameType, target.GetType(), GetType())); 1356RuntimeType enumType = (RuntimeType)GetType(); 1404RuntimeType enumType = (RuntimeType)GetType(); 1631Type valueType = value.GetType(); 1689RuntimeType enumType = (RuntimeType)GetType(); 2211Type valueType = value.GetType();
src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
202public new Type GetType() => base.GetType();
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (2)
170_isInherited = GetType() != typeof(CultureInfo); 211_isInherited = GetType() != typeof(CultureInfo);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (1)
1168if (dtfi.Calendar.GetType() != typeof(GregorianCalendar))
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (2)
319if (provider.GetType() == typeof(CultureInfo) && ((CultureInfo)provider)._dateTimeInfo is { } info) 2120if (Calendar.GetType() != typeof(JapaneseCalendar))
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (1)
3990if (dtfi.Calendar.GetType() != typeof(GregorianCalendar))
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.cs (1)
95throw new TypeInitializationException(this.GetType().ToString(), e);
src\libraries\System.Private.CoreLib\src\System\Globalization\KoreanCalendar.cs (1)
51throw new TypeInitializationException(GetType().ToString(), e);
src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (1)
221if (provider.GetType() == typeof(CultureInfo) && ((CultureInfo)provider)._numInfo is { } info)
src\libraries\System.Private.CoreLib\src\System\Globalization\TaiwanCalendar.cs (1)
52throw new TypeInitializationException(GetType().ToString(), e);
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (1)
58_isMemoryStream = _stream.GetType() == typeof(MemoryStream);
src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (2)
87if (GetType() == typeof(BinaryWriter)) 386if (GetType() == typeof(BinaryWriter))
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (4)
347if (GetType() != typeof(MemoryStream)) 442if (GetType() != typeof(MemoryStream)) 477if (GetType() != typeof(MemoryStream)) 623if (GetType() != typeof(MemoryStream))
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\FileStreamHelpers.cs (1)
39=> fileStream.GetType() == typeof(FileStream)
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (3)
61ThrowHelper.ThrowObjectDisposedException_StreamClosed(GetType().Name); 95ThrowHelper.ThrowObjectDisposedException_StreamClosed(GetType().Name); 999ThrowHelper.ThrowObjectDisposedException_StreamClosed(destination.GetType().Name);
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (9)
361GetType() == typeof(StreamReader) ? ReadSpan(buffer) : 443if (GetType() != typeof(StreamReader)) 890if (GetType() != typeof(StreamReader)) 1018if (GetType() != typeof(StreamReader)) 1062if (GetType() != typeof(StreamReader)) 1078if (GetType() != typeof(StreamReader)) 1273if (GetType() != typeof(StreamReader)) 1289if (GetType() != typeof(StreamReader)) 1405void ThrowObjectDisposedException() => throw new ObjectDisposedException(GetType().Name, SR.ObjectDisposed_ReaderClosed);
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (27)
165Debug.Assert(GetType() == typeof(NullStreamWriter)); 245GetType() != typeof(StreamWriter) ? 252Debug.Assert(GetType() == typeof(StreamWriter)); 386if (GetType() == typeof(StreamWriter)) 488if (GetType() == typeof(StreamWriter)) 517if (GetType() == typeof(StreamWriter)) 529if (GetType() == typeof(StreamWriter)) 542if (GetType() == typeof(StreamWriter)) 555if (GetType() == typeof(StreamWriter)) 576if (GetType() == typeof(StreamWriter)) 588if (GetType() == typeof(StreamWriter)) 600if (GetType() == typeof(StreamWriter)) 613if (GetType() == typeof(StreamWriter)) 626if (GetType() == typeof(StreamWriter)) 644if (GetType() == typeof(StreamWriter)) 660if (GetType() != typeof(StreamWriter)) 708if (GetType() != typeof(StreamWriter)) 744if (GetType() != typeof(StreamWriter)) 760if (GetType() != typeof(StreamWriter)) 822if (GetType() != typeof(StreamWriter)) 842if (GetType() != typeof(StreamWriter)) 867if (GetType() != typeof(StreamWriter)) 896if (GetType() != typeof(StreamWriter)) 912if (GetType() != typeof(StreamWriter)) 933if (GetType() != typeof(StreamWriter)) 948if (GetType() != typeof(StreamWriter)) 1016void ThrowObjectDisposedException() => throw new ObjectDisposedException(GetType().Name, SR.ObjectDisposed_WriterClosed);
src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (1)
117if (GetType() != typeof(StringReader))
src\libraries\System.Private.CoreLib\src\System\IO\StringWriter.cs (6)
108if (GetType() != typeof(StringWriter)) 142if (GetType() != typeof(StringWriter)) 160if (GetType() != typeof(StringWriter)) 179if (GetType() != typeof(StringWriter)) 229if (GetType() != typeof(StringWriter)) 264if (GetType() != typeof(StringWriter))
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (2)
344if (GetType() == typeof(UnmanagedMemoryStream)) 612if (GetType() == typeof(UnmanagedMemoryStream))
src\libraries\System.Private.CoreLib\src\System\Memory.cs (4)
44if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 62if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 94if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 283if (typeof(T) == typeof(char) && tmpObject.GetType() == typeof(string))
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (3)
33if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 55if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 82if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
src\libraries\System.Private.CoreLib\src\System\Object.cs (1)
42return GetType().ToString();
src\libraries\System.Private.CoreLib\src\System\Random.cs (3)
33_impl = GetType() == typeof(Random) ? new XoshiroImpl() : new CompatDerivedImpl(this); 44_impl = GetType() == typeof(Random) ? new CompatSeedImpl(Seed) : new CompatDerivedImpl(this, Seed); 208if ((impl is null || impl.GetType() == typeof(XoshiroImpl)) &&
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
205if (typeof(T) == typeof(char) && tmpObject.GetType() == typeof(string))
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (1)
423else if (!ReferenceEquals(arg.GetType(), sigType))
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeTypedArgument.cs (1)
31_argumentType = value.GetType();
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (2)
375else if (!ReferenceEquals(value.GetType(), _fieldInfo.FieldType)) 486throw new ArgumentException(SR.Format(SR.Arg_FieldDeclTarget, fieldInfo.Name, fieldInfo.DeclaringType, target.GetType()));
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokeUtils.cs (1)
108Debug.Assert(dstObject.GetType() == dstType);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (3)
333Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT); 374else if (!ReferenceEquals(arg.GetType(), sigType)) 395ReferenceEquals(sigElementType, arg.GetType()))
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (2)
451Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT); 476else if (!ReferenceEquals(arg.GetType(), sigType))
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvokerCommon.cs (1)
99throw new TargetException(SR.Format(SR.RFLCT_Targ_ITargMismatch_WithType, method.DeclaringType, target.GetType()));
src\libraries\System.Private.CoreLib\src\System\Reflection\ReflectionContext.cs (1)
18return MapType(value.GetType().GetTypeInfo());
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (2)
87if (graph.GetType() != type) 88throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResType_SerBlobMismatch, type.FullName, graph.GetType().FullName));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (1)
93Type stateMachineType = stateMachine.GetType();
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (2)
233AsyncMethodBuilderCore.LogTraceOperationBegin(box, stateMachine.GetType()); 342Debug.Assert(m_stateObject is null or ExecutionContext, $"Expected {nameof(m_stateObject)} to be null or an ExecutionContext but was {(m_stateObject is object o ? o.GetType().ToString() : "(null)")}.");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (1)
518provider.GetType() != typeof(CultureInfo) && // optimization to avoid GetFormat in the majority case
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs (2)
37if (typeof(T[]) == array.GetType()) 54dest = Unsafe.As<T[]>(Array.CreateInstanceFromArrayType(array.GetType(), length));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\YieldAwaitable.cs (2)
86if (syncCtx != null && syncCtx.GetType() != typeof(SynchronizationContext)) 130if (syncCtx != null && syncCtx.GetType() != typeof(SynchronizationContext))
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
37Debug.Assert(typeof(T[]) == list._items.GetType(), "Implementation depends on List<T> always using a T[] and not U[] where U : T.");
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (1)
136if (target.GetType() == typeof(string))
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (2)
94return SizeOfHelper((RuntimeType)structure.GetType(), throwIfNotMarshalable: true); 101return SizeOfHelper((RuntimeType)structure.GetType(), throwIfNotMarshalable: true);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (2)
278(typeof(T) == typeof(char) && obj.GetType() == typeof(string)) 609if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeHandle.cs (1)
118Internal.Console.WriteLine($"{Environment.NewLine}*** #{count} {GetType()} (0x{handle.ToInt64():x}) finalized! Ctor stack:{Environment.NewLine}{_ctorStackTrace}{Environment.NewLine}");
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (2)
270public override string ToString() => $"\"{Name}\" {GetType()} #{_id}"; 407if (stream.GetType() == typeof(MemoryStream) && ((MemoryStream)stream).TryGetBuffer(out ArraySegment<byte> memoryStreamBuffer))
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (1)
149AddValue(name, value, value.GetType());
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (5)
102RuntimeType valueType = (RuntimeType)value.GetType(); 209RuntimeType valueType = (RuntimeType)value.GetType(); 822throw new ArgumentException(SR.Format(SR.Arg_ObjObjEx, value?.GetType(), this)); 893throw new ArgumentException(SR.Format(SR.Arg_ObjObjEx, value?.GetType(), this)); 913Debug.Assert(type.IsEquivalentTo(value.GetType()));
src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.T.cs (1)
54string display = $"{GetType().Name}, Count = {values.Length}";
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (1)
42if (children.GetType() == typeof(int[]))
src\libraries\System.Private.CoreLib\src\System\Span.cs (2)
46if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 75if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (1)
925if (values.GetType() == typeof(List<string?>)) // avoid accidentally bypassing a derived type's reimplementation of IEnumerable<T>
src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (1)
242throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, Encoding.EncodingName, _fallbackBuffer.GetType()));
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (3)
1099SR.Format(SR.Argument_EncodingConversionOverflowBytes, _codePage, EncoderFallback.GetType()), "bytes"); 1127SR.Format(SR.Argument_EncodingConversionOverflowChars, _codePage, DecoderFallback.GetType()), "chars"); 1439_encoder.Encoding.EncodingName, _encoder.Fallback!.GetType()));
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (1)
465ThrowHelper.ThrowObjectDisposedException_StreamClosed(GetType().Name);
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (3)
382throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback?.GetType())); 665throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback?.GetType())); 1740GetType() != typeof(UnicodeEncoding) ? new ReadOnlySpan<byte>(GetPreamble()) : // in case a derived UnicodeEncoding overrode GetPreamble
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (3)
375throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback?.GetType().ToString() ?? string.Empty)); 510throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback?.GetType())); 1132GetType() != typeof(UTF32Encoding) ? new ReadOnlySpan<byte>(GetPreamble()) : // in case a derived UTF32Encoding overrode GetPreamble
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (1)
873GetType() != typeof(UTF8Encoding) ? new ReadOnlySpan<byte>(GetPreamble()) : // in case a derived UTF8Encoding overrode GetPreamble
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (1)
105Debug.Assert(asyncLocalValueMap == Empty || asyncLocalValueMap.GetType() != typeof(EmptyAsyncLocalValueMap));
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (1)
309return Task.FromException(new ObjectDisposedException(GetType().FullName, SR.CancellationTokenSource_Disposed));
src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (2)
139if (userData.GetType() == typeof(object[])) 165if (userData.GetType() == typeof(object[]))
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
551if (m_pair.CompletionRequested) throw new InvalidOperationException(GetType().ToString());
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (1)
136sc.GetType() != typeof(SynchronizationContext))
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (3)
2502if (SynchronizationContext.Current is SynchronizationContext syncCtx && syncCtx.GetType() != typeof(SynchronizationContext)) 2575if (SynchronizationContext.Current is SynchronizationContext syncCtx && syncCtx.GetType() != typeof(SynchronizationContext)) 6722if (tasks.GetType() == typeof(List<TTask>))
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (1)
611if (ctx != null && ctx.GetType() != typeof(SynchronizationContext)) return false;
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (1)
132if (pinData is object[] objArray && objArray.GetType() == typeof(object[]))
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (2)
137throw new ArgumentException(SR.Format(SR.ArgumentException_ValueTupleIncorrectType, obj.GetType()), "other"); 458throw new ObjectDisposedException(instance?.GetType().FullName);
src\libraries\System.Private.CoreLib\src\System\Tuple.cs (8)
154throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, GetType()), nameof(other)); 274throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, GetType()), nameof(other)); 399throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, GetType()), nameof(other)); 534throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, GetType()), nameof(other)); 679throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, GetType()), nameof(other)); 834throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, GetType()), nameof(other)); 999throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, GetType()), nameof(other)); 1179throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, GetType()), nameof(other));
src\libraries\System.Private.CoreLib\src\System\Type.cs (4)
21public new Type GetType() => base.GetType(); 477return o.GetType().TypeHandle; 489cls[i] = args[i].GetType(); 602public virtual bool IsInstanceOfType([NotNullWhen(true)] object? o) => o != null && IsAssignableFrom(o.GetType());
src\libraries\System.Private.CoreLib\src\System\Type.Enum.cs (2)
28Type valueType = value.GetType(); 73Type valueType = value.GetType();
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (1)
30RuntimeType targetType = (RuntimeType)target.GetType();
src\libraries\System.Private.CoreLib\src\System\WeakReference.cs (1)
223Debug.Assert(this.GetType() != typeof(WeakReference));
src\System\Array.CoreCLR.cs (5)
59if (sourceArray.GetType() != destinationArray.GetType() && sourceArray.Rank != destinationArray.Rank) 81if (sourceArray.GetType() == destinationArray.GetType() 698RuntimeType arrayType = (RuntimeType)GetType();
src\System\Attribute.CoreCLR.cs (5)
257Type objType = objAttr[i]!.GetType(); 285Type objType = objAttr[i]!.GetType(); 351Type objType = objAttr[i].GetType(); 373Type attrType = attributes[i].GetType(); 401Type attrType = attributes[i].GetType();
src\System\Delegate.CoreCLR.cs (10)
48if (!BindToMethodName(target, (RuntimeType)target.GetType(), method, 83RuntimeMethodInfo invoke = (RuntimeMethodInfo)RuntimeType.GetMethodBase((RuntimeType)this.GetType(), method)!; 154return (_target != null ? RuntimeHelpers.GetHashCode(_target) * 33 : 0) + GetType().GetHashCode(); 156return GetType().GetHashCode(); 189for (currentType = _target!.GetType(); currentType != null; currentType = currentType.BaseType) 205|| _target.GetType().IsCOMObject 211MethodInfo invoke = this.GetType().GetMethod("Invoke")!; 244if (!d.BindToMethodName(target, (RuntimeType)target.GetType(), method, 444if (a.GetType() == b.GetType())
src\System\Enum.CoreCLR.cs (1)
116Debug.Assert(values!.GetType() == typeof(TStorage[]));
src\System\MulticastDelegate.CoreCLR.cs (1)
530RuntimeType reflectedType = (RuntimeType)GetType();
src\System\Reflection\Emit\CustomAttributeBuilder.cs (6)
112VerifyTypeAndPassedObjectType(paramTypes[i], constructorArg.GetType(), $"{nameof(constructorArgs)}[{i}]"); 173VerifyTypeAndPassedObjectType(propType, propertyValue.GetType(), $"{nameof(propertyValues)}[{i}]"); 225VerifyTypeAndPassedObjectType(fldType, fieldValue.GetType(), $"{nameof(fieldValues)}[{i}]"); 420throw new ArgumentException(SR.Format(SR.Argument_InvalidTypeForCA, value.GetType())); 488Type ot = value == null ? typeof(string) : value is Type ? typeof(Type) : value.GetType(); 503typename = value.GetType().ToString();
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
188Type type = value.GetType();
src\System\Reflection\RuntimeCustomAttributeData.cs (2)
399Type type = pca.GetType(); 1569type = (RuntimeType)value.GetType();
src\System\Runtime\CompilerServices\CastHelpers.cs (1)
457if (array.GetType() == typeof(object[]))
src\System\Runtime\InteropServices\DynamicInterfaceCastableHelpers.cs (2)
20throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, castable.GetType(), interfaceType)); 30throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, castable.GetType(), interfaceType));
src\System\RuntimeType.CoreCLR.cs (2)
3743RuntimeType srcType = pointer != null ? pointer.GetPointerType() : (RuntimeType)value.GetType(); 3879argsType[i] = arg.GetType();
src\System\StubHelpers.cs (6)
914Type elementType = pManagedHome.GetType().GetElementType()!; 1100int allocSize = Marshal.SizeOfHelper((RuntimeType)pManagedHome.GetType(), false); 1112layoutType = pManagedHome.GetType(); 1129if (pManagedHome.GetType().IsArray) 1146else if (pManagedHome.GetType().IsLayoutSequential || pManagedHome.GetType().IsExplicitLayout)
src\System\ValueType.cs (4)
34if (GetType() != obj.GetType()) 49FieldInfo[] thisFields = GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); 170return this.GetType().ToString();
System.Private.CoreLib.Generators (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
System.Private.DataContractSerialization (52)
System\Runtime\Serialization\CodeGenerator.cs (3)
187return var.GetType(); 696throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.CanOnlyStoreIntoArgOrLocGot0, DataContract.GetClrTypeFullName(var.GetType()))); 800Type valueType = o.GetType();
System\Runtime\Serialization\DataContract.cs (4)
171throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType))); 178throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType))); 185throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType))); 190throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
System\Runtime\Serialization\DataContractSerializer.cs (3)
374Type graphType = (graph == null) ? declaredType : graph.GetType(); 515return (graph == null) ? _rootType : graph.GetType(); 531objType = obj != null ? obj.GetType() : Globals.TypeOfObject;
System\Runtime\Serialization\ExtensionDataReader.cs (1)
635type = dataNode.Value.GetType();
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (2)
425return (graph == null) ? _rootType : graph.GetType(); 498Type graphType = (graph == null) ? declaredType : graph.GetType();
System\Runtime\Serialization\Json\JsonDataContract.cs (1)
223Type traditionalDataContractType = traditionalDataContract.GetType();
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (1)
81ReflectionJsonClassWriter.ReflectionWriteValue(jsonWriter, context, dictionaryValueType ?? value.GetType(), value, false, primitiveContractForParamType: null);
System\Runtime\Serialization\Json\XmlJsonWriter.cs (1)
1430else if (value.GetType().IsArray)
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (3)
316SR.Format(SR.JsonDuplicateMemberInInput, DataContract.GetClrTypeFullName(obj.GetType()), memberNames[memberIndex])); 337SR.JsonOneRequiredMemberNotFound, DataContract.GetClrTypeFullName(obj.GetType()), stringBuilder.ToString())); 342SR.JsonRequiredMembersNotFound, DataContract.GetClrTypeFullName(obj.GetType()), stringBuilder.ToString()));
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (5)
312DataContract dc = GetDataContract(dataNode.Value.GetType()); 322Type contractType = contract.GetType(); 325throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.XmlObjectAssignedToIncompatibleInterface, graph.GetType(), declaredType)); 330throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.CollectionAssignedToIncompatibleInterface, graph.GetType(), declaredType)); 339Type objType = obj.GetType();
System\Runtime\Serialization\PrimitiveDataContract.cs (2)
128Type thisType = GetType(); 129Type otherType = other.GetType();
System\Runtime\Serialization\ReflectionClassWriter.cs (4)
62ReflectionInternalSerialize(xmlWriter, context, memberValue, memberValue.GetType().TypeHandle.Equals(memberType.TypeHandle), writeXsiType, memberType); 77memberType = memberValue.GetType(); 102ReflectionInternalSerialize(xmlWriter, context, memberValue!, memberValue!.GetType().TypeHandle.Equals(memberType.TypeHandle), writeXsiType, memberType, originValueIsNullableOfT); 154Type type = obj.GetType();
System\Runtime\Serialization\ReflectionReader.cs (2)
441Type objType = obj.GetType(); 584Type collectionType = resultCollectionObject.GetType();
System\Runtime\Serialization\XmlObjectSerializer.cs (1)
465return graph?.GetType();
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (2)
367string oldType = (oldObj != null) ? DataContract.GetClrTypeFullName(oldObj.GetType()) : SR.UnknownNullType; 368string newType = (newObj != null) ? DataContract.GetClrTypeFullName(newObj.GetType()) : SR.UnknownNullType;
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (11)
100SerializeWithXsiType(xmlWriter, obj, obj.GetType().TypeHandle, null/*type*/, -1, declaredType.TypeHandle, declaredType); 109RuntimeTypeHandle objTypeHandle = obj.GetType().TypeHandle; 383throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.CannotSerializeObjectWithCycles, DataContract.GetClrTypeFullName(obj.GetType()))); 446return obj.GetType().TypeHandle.Equals(memberType.TypeHandle); 499throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.UnknownXmlType, DataContract.GetClrTypeFullName(obj.GetType()))); 517Type objType = obj.GetType(); 606throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ResolveTypeReturnedFalse, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType))); 616throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType))); 621throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType))); 731InternalSerialize(xmlWriter, o, false /*isDeclaredType*/, false /*writeXsiType*/, -1, o.GetType().TypeHandle); 748Type declaredType = (dataNode.DataContractName == null) ? o.GetType() : Globals.TypeOfObject;
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (1)
223RuntimeTypeHandle objTypeHandle = isDeclaredType ? declaredTypeHandle : obj.GetType().TypeHandle;
System\Runtime\Serialization\XmlSerializableWriter.cs (3)
27throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.IXmlSerializableMissingEndElements, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType())))); 56throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.IXmlSerializableWritePastSubTree, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType())))); 64throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.IXmlSerializableWritePastSubTree, (_obj == null ? string.Empty : DataContract.GetClrTypeFullName(_obj.GetType()))));
System\Runtime\Serialization\XmlWriterDelegator.cs (1)
279WriteAnyType(value, value.GetType());
System\Xml\XmlBaseWriter.cs (1)
1225else if (value.GetType().IsArray)
System.Private.Uri (7)
System\Uri.cs (2)
1600throw new InvalidOperationException(SR.Format(SR.net_uri_UserDrivenParsing, GetType())); 2636throw new UriFormatException(SR.Format(SR.net_uri_PortOutOfRange, _syntax.GetType(), portStr));
System\UriExt.cs (1)
445throw new InvalidOperationException(SR.Format(SR.net_uri_UserDrivenParsing, this.GetType()));
System\UriScheme.cs (3)
74throw new InvalidOperationException(SR.Format(SR.net_uri_UserDrivenParsing, uri._syntax.GetType())); 101throw new InvalidOperationException(SR.Format(SR.net_uri_UserDrivenParsing, this.GetType())); 144throw new InvalidOperationException(SR.Format(SR.net_uri_UserDrivenParsing, this.GetType()));
System\UriSyntax.cs (1)
232Type type = this.GetType();
System.Private.Windows.Core (15)
System\DisposalTracking.cs (1)
57throw new InvalidOperationException($"Did not dispose `{GetFriendlyTypeName(GetType())}`. Originating stack:\n{_originatingStack}");
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (4)
294Type type = primitive.GetType(); 403Type type = list.GetType(); 506PrimitiveType primitiveType = array.GetType().GetElementType()!.GetPrimitiveType(); 679Type type = value.GetType();
System\Private\Windows\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (1)
35Type elementType = _arrayOfClassRecords.GetType();
System\Private\Windows\BinaryFormat\Deserializer\ClassRecordDeserializer.cs (1)
85Type type = value.GetType();
System\Private\Windows\BinaryFormat\Deserializer\ObjectRecordDeserializer.cs (1)
94|| (Deserializer.IncompleteObjects.Contains(valueRecord) && value.GetType().IsValueType));
System\Private\Windows\BinaryFormat\Deserializer\PendingSerializationInfo.cs (1)
32Type type = @object.GetType();
System\Private\Windows\BinaryFormat\Deserializer\SerializationInfoValueUpdater.cs (1)
24_info.UpdateValue(_name, newValue, newValue.GetType());
System\Private\Windows\BinaryFormat\Serializer\MemberPrimitiveTyped.cs (1)
33PrimitiveType primitiveType = value.GetType().GetPrimitiveType();
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (1)
288_ when format == DataFormatNames.Serializable || data is ISerializable || data.GetType().IsSerializable
System\Private\Windows\Ole\DataStore.cs (1)
112SetData(data.GetType(), data);
System\Value.cs (1)
52type = _object.GetType();
Windows\Win32\System\Com\ComHelpers.cs (1)
109Debug.WriteLine($"Did not find IUnknown for {@object.GetType().Name}. {ex.Message}");
System.Private.Windows.Core.Tests (31)
System\Private\Windows\Nrbf\BinaryFormatterHelpers.cs (1)
46selector.AddSurrogate(@object.GetType(), context, surrogate);
System\Value\StoringBoolean.cs (2)
165Assert.Equal(typeof(bool), o.GetType()); 171Assert.Equal(typeof(bool), o.GetType());
System\Value\StoringByte.cs (2)
136Assert.Equal(typeof(byte), o.GetType()); 142Assert.Equal(typeof(byte), o.GetType());
System\Value\StoringChar.cs (2)
136Assert.Equal(typeof(char), o.GetType()); 142Assert.Equal(typeof(char), o.GetType());
System\Value\StoringDateTime.cs (2)
88Assert.Equal(typeof(DateTime), o.GetType()); 94Assert.Equal(typeof(DateTime), o.GetType());
System\Value\StoringDateTimeOffset.cs (2)
88Assert.Equal(typeof(DateTimeOffset), o.GetType()); 94Assert.Equal(typeof(DateTimeOffset), o.GetType());
System\Value\StoringDecimal.cs (2)
86Assert.Equal(typeof(decimal), o.GetType()); 92Assert.Equal(typeof(decimal), o.GetType());
System\Value\StoringDouble.cs (2)
140Assert.Equal(typeof(double), o.GetType()); 146Assert.Equal(typeof(double), o.GetType());
System\Value\StoringFloat.cs (2)
140Assert.Equal(typeof(float), o.GetType()); 146Assert.Equal(typeof(float), o.GetType());
System\Value\StoringInt.cs (2)
136Assert.Equal(typeof(int), o.GetType()); 142Assert.Equal(typeof(int), o.GetType());
System\Value\StoringLong.cs (2)
137Assert.Equal(typeof(long), o.GetType()); 143Assert.Equal(typeof(long), o.GetType());
System\Value\StoringSByte.cs (2)
112Assert.Equal(typeof(sbyte), o.GetType()); 118Assert.Equal(typeof(sbyte), o.GetType());
System\Value\StoringShort.cs (2)
137Assert.Equal(typeof(short), o.GetType()); 143Assert.Equal(typeof(short), o.GetType());
System\Value\StoringUInt.cs (2)
136Assert.Equal(typeof(uint), o.GetType()); 142Assert.Equal(typeof(uint), o.GetType());
System\Value\StoringUlong.cs (2)
136Assert.Equal(typeof(ulong), o.GetType()); 142Assert.Equal(typeof(ulong), o.GetType());
System\Value\StoringUShort.cs (2)
136Assert.Equal(typeof(ushort), o.GetType()); 142Assert.Equal(typeof(ushort), o.GetType());
System.Private.Windows.Core.TestUtilities (9)
DebuggerAttributes.cs (6)
26DebuggerAttributeInfo info = ValidateDebuggerTypeProxyProperties(obj.GetType(), obj); 35return ValidateDebuggerTypeProxyProperties(obj.GetType(), obj); 84public static Type GetProxyType(object obj) => GetProxyType(obj.GetType()); 116Type objType = obj.GetType(); 204for (Type t = obj.GetType(); t is not null; t = t.GetTypeInfo().BaseType) 217for (Type t = obj.GetType(); t is not null; t = t.GetTypeInfo().BaseType)
TestAccessor.cs (1)
118args.Select(a => a!.GetType()).ToArray(),
TestAccessors.cs (1)
57typeof(TestAccessor<>).MakeGenericType(instanceOrType.GetType()),
XUnit\CommonMemberDataAttribute.cs (1)
34throw new ArgumentException($"Property {MemberName} on {MemberType ?? testMethod.DeclaringType} yielded an item that is not an object[], but {item.GetType().Name}");
System.Private.Xml (172)
System\Xml\Core\XmlReaderSettings.cs (1)
400throw new XmlException(SR.Xml_ReadOnlyProperty, $"{GetType().Name}.{propertyName}");
System\Xml\Core\XmlWriterSettings.cs (1)
494throw new XmlException(SR.Xml_ReadOnlyProperty, $"{GetType().Name}.{propertyName}");
System\Xml\Dom\XmlDocument.cs (1)
156if (imp.NameTable.GetType() == typeof(NameTable))
System\Xml\Dom\XmlElement.cs (2)
430if (GetType() == typeof(XmlElement)) 462if (e != null && e.GetType() == typeof(XmlElement))
System\Xml\Dom\XmlLoader.cs (1)
27if (reader.GetType() == typeof(System.Xml.XmlTextReader))
System\Xml\Resolvers\XmlPreloadedResolver.cs (1)
66Assembly asm = GetType().Assembly;
System\Xml\Schema\DataTypeImplementation.cs (3)
431Type derivedType = this.GetType(); 432Type baseType = datatype.GetType(); 583if (value.GetType() != this.ValueType)
System\Xml\Schema\Inference\Infer.cs (3)
971if (((XmlSchemaSequence)ct.Particle).Items[lastUsedSeqItem].GetType() != typeof(XmlSchemaElement)) 1038if (ct.Particle!.GetType() == typeof(XmlSchemaSequence)) 1054if (xss.Items[0].GetType() == typeof(XmlSchemaChoice))
System\Xml\Schema\Preprocessor.cs (1)
350Type returnType = obj.GetType();
System\Xml\Schema\XmlSchemaDataType.cs (1)
174Type t = value.GetType();
System\Xml\Schema\XmlValueConverter.cs (49)
514throw CreateInvalidClrMappingException(value.GetType(), destinationType); 906Type sourceType = value.GetType(); 931Type sourceType = value.GetType(); 956Type sourceType = value.GetType(); 996Type sourceType = value.GetType(); 1078Type sourceType = value.GetType(); 1124Type sourceType = value.GetType(); 1172Type sourceType = value.GetType(); 1216Type sourceType = value.GetType(); 1245Type sourceType = value.GetType(); 1294Type sourceType = value.GetType(); 1358Type sourceType = value.GetType(); 1398Type sourceType = value.GetType(); 1477Type sourceType = value.GetType(); 1526Type sourceType = value.GetType(); 1574Type sourceType = value.GetType(); 1638Type sourceType = value.GetType(); 1684Type sourceType = value.GetType(); 1723Type sourceType = value.GetType(); 1804Type sourceType = value.GetType(); 1920Type sourceType = value.GetType(); 1952Type sourceType = value.GetType(); 1983Type sourceType = value.GetType(); 2036Type sourceType = value.GetType(); 2058Type sourceType = value.GetType(); 2080Type sourceType = value.GetType(); 2101Type sourceType = value.GetType(); 2123Type sourceType = value.GetType(); 2145Type sourceType = value.GetType(); 2167Type sourceType = value.GetType(); 2189Type sourceType = value.GetType(); 2237Type sourceType = value.GetType(); 2364Type sourceType = value.GetType(); 2464Type sourceType = value.GetType(); 2486Type sourceType = value.GetType(); 2548Type sourceType = value.GetType(); 2564Type sourceType = value.GetType(); 2579Type sourceType = value.GetType(); 2595Type sourceType = value.GetType(); 2611Type sourceType = value.GetType(); 2627Type sourceType = value.GetType(); 2643Type sourceType = value.GetType(); 2659Type sourceType = value.GetType(); 2754Type sourceType = value.GetType(); 2834Type sourceType = value.GetType(); 2880if (!(value is IEnumerable) || value.GetType() == StringType || value.GetType() == ByteArrayType) 2945Type sourceType = value.GetType(); 3177Type sourceType = value.GetType();
System\Xml\Serialization\CodeGenerator.cs (2)
168return var.GetType(); 770Type valueType = o.GetType();
System\Xml\Serialization\Compilation.cs (2)
623_methods[mapping.Key!].readMethod = GetMethodFromType(reader.GetType(), methodName); 650_methods[mapping.Key!].writeMethod = GetMethodFromType(writer.GetType(), methodName);
System\Xml\Serialization\ImportContext.cs (5)
74string key = $"{item.GetType().Name}:{qname}"; 94Warnings.Add(SR.Format(SR.XmlMismatchSchemaObjects, item.GetType().Name, qname.Name, qname.Namespace)); 107if (o1.GetType() != o2.GetType()) 261Type t = item.GetType();
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (7)
432Type = refObj.GetType(), 603Type type = o.GetType(); 612MemberInfo memberInfo = ReflectionXmlSerializationHelper.GetEffectiveSetInfo(o.GetType(), memberName); 647MethodInfo getSetMemberValueDelegateWithTypeMi = getSetMemberValueDelegateWithTypeGenericMi.MakeGenericMethod(o.GetType(), memberType); 1735MethodInfo? specifiedMethodInfo = o!.GetType().GetMethod($"set_{specifiedMemberName}"); 1804MemberInfo[] memberInfos = o!.GetType().GetMember(member.Mapping.Name); 2014if (memberType == value.GetType())
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (10)
230string choiceFullName = (enumUseReflection ? "" : choiceSource!.GetType().FullName + ".@") + choiceSource!.ToString(); 238if (o != null && !td.Type!.IsAssignableFrom(o!.GetType())) 251if (td.Type!.IsAssignableFrom(o!.GetType())) 595&& o.GetType() != mapping.TypeDesc!.Type) 665MethodInfo method = o!.GetType().GetMethod(methodInvoke, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)!; 697MethodInfo method = o!.GetType().GetMethod(methodInvoke, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)!; 730MemberInfo memberInfo = ReflectionXmlSerializationHelper.GetEffectiveGetInfo(o.GetType(), memberName); 737Type objType = o.GetType(); 983Type t = o.GetType(); 1384WritePotentiallyReferencingElement(null, null, p[i], p[i].GetType(), true, false);
System\Xml\Serialization\SchemaObjectWriter.cs (4)
37return string.Compare($"{f1.GetType().Name}:{f1.Value}", $"{f2.GetType().Name}:{f2.Value}", StringComparison.Ordinal); 336System.Type t = o.GetType(); 1054System.Type t = o.GetType();
System\Xml\Serialization\SoapReflectionImporter.cs (5)
750if (fieldTypeDesc != _typeScope.GetTypeDesc(a.SoapDefaultValue.GetType())) 751throw new InvalidOperationException(SR.Format(SR.XmlInvalidDefaultEnumValue, a.SoapDefaultValue.GetType().FullName, fieldTypeDesc.FullName)); 752string strValue = Enum.Format(a.SoapDefaultValue.GetType(), a.SoapDefaultValue, "G").Replace(",", " "); 753string numValue = Enum.Format(a.SoapDefaultValue.GetType(), a.SoapDefaultValue, "D"); 755throw new InvalidOperationException(SR.Format(SR.XmlInvalidDefaultValue, strValue, a.SoapDefaultValue.GetType().FullName));
System\Xml\Serialization\TypeExtensions.cs (1)
28Type sourceType = data.GetType();
System\Xml\Serialization\Xmlcustomformatter.cs (1)
40Type type = value.GetType();
System\Xml\Serialization\XmlReflectionImporter.cs (2)
2163throw new InvalidOperationException(SR.Format(SR.XmlInvalidDefaultValue, strValue, a.XmlDefaultValue.GetType().FullName)); 2202throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Bad accessor type " + accessor.GetType().FullName));
System\Xml\Serialization\XmlSchemaExporter.cs (4)
681throw new InvalidOperationException(SR.Format(SR.XmlInvalidContent, type.ContentModel.Content!.GetType().Name)); 876if (value.GetType() != typeof(string)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, SR.Format(SR.XmlInvalidDefaultValue, value, value.GetType().FullName))); 1074throw new InvalidOperationException(SR.Format(SR.XmlInvalidContent, type.ContentModel.Content!.GetType().Name));
System\Xml\Serialization\XmlSchemaImporter.cs (3)
364if (!(desiredMappingType.IsAssignableFrom(mapping.GetType()))) 365throw new InvalidOperationException(SR.Format(SR.XmlElementImportedTwice, element.Name, ns, mapping.GetType().Name, desiredMappingType.Name)); 422if (mapping != null && desiredMappingType.IsAssignableFrom(mapping.GetType()))
System\Xml\Serialization\XmlSchemas.cs (8)
233if (ret == null || !type.IsAssignableFrom(ret.GetType())) 395throw new InvalidOperationException(SR.Format(SR.XmlSchemaIncludeLocation, this.GetType().Name, external.SchemaLocation)); 530item = SR.Format(SR.XmlSchemaNamedItem, ns, o.GetType() == typeof(XmlSchemaSimpleType) ? "simpleType" : "complexType", ((XmlSchemaType)o).Name, null); 557string itemType = o is XmlSchemaImport ? "import" : o is XmlSchemaInclude ? "include" : o is XmlSchemaRedefine ? "redefine" : o.GetType().Name; 566item = SR.Format(SR.XmlSchemaNamedItem, ns, o.GetType().Name, null, details); 579XmlSerializer s = new XmlSerializer(o.GetType()); 603Type type = o.GetType(); 609if (item.GetType() == type && name == ItemName(item))
System\Xml\Serialization\XmlSerializationReader.cs (4)
1328return new InvalidCastException(SR.Format(SR.XmlInvalidCast, value.GetType().FullName, type.FullName)); 1330return new InvalidCastException(SR.Format(SR.XmlInvalidCastWithId, value.GetType().FullName, type.FullName, id)); 1547throw new InvalidOperationException(SR.Format(SR.XmlInvalidArrayRef, id, o.GetType().FullName, i.ToString(CultureInfo.InvariantCulture))); 1721Type currItemType = currItem.GetType();
System\Xml\Serialization\XmlSerializationReaderILGen.cs (1)
3620WriteSourceEnd(source, value == null ? typeof(object) : value.GetType());
System\Xml\Serialization\XmlSerializationWriter.cs (12)
264Type t = o.GetType(); 500if (_objectsInUse.ContainsKey(o)) throw new InvalidOperationException(SR.Format(SR.XmlCircularReference, o.GetType().FullName)); 658if (!_objectsInUse.ContainsKey(o)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "missing stack object of type " + o.GetType().FullName)); 782if (typeof(XmlAttribute).IsAssignableFrom(node.GetType())) 814return CreateUnknownTypeException(o.GetType()); 855return CreateInvalidAnyTypeException(o.GetType()); 1336Type t = o.GetType(); 1387Type t = o.GetType(); 2456if (defaultValue!.GetType() != typeof(string)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, name + " has invalid default type " + defaultValue.GetType().Name)); 4266Type type = value.GetType(); 4355Writer.Write(((DateTimeOffset)value).Offset.GetType().FullName);
System\Xml\Serialization\XmlSerializationWriterILGen.cs (4)
201if (defaultValue!.GetType() != typeof(string)) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, name + " has invalid default type " + defaultValue.GetType().Name)); 2126else if (value.GetType().IsPrimitive) 2134Type valueType = value.GetType();
System\Xml\XPath\Internal\BaseAxisQuery.cs (1)
116if (qyInput.GetType() != typeof(ContextQuery))
System\Xml\XPath\XPathNavigator.cs (1)
968if (n1.GetType().ToString() != "Microsoft.VisualStudio.Modeling.StoreNavigator")
System\Xml\Xsl\ListBase.cs (6)
136if (!IsCompatibleType(value!.GetType())) 145if (!IsCompatibleType(value!.GetType())) 159if (!IsCompatibleType(value!.GetType())) 167if (!IsCompatibleType(value!.GetType())) 175if (!IsCompatibleType(value!.GetType())) 183if (IsCompatibleType(value!.GetType()))
System\Xml\Xsl\QIL\QilTypeChecker.cs (2)
1002Type clrType = ((QilLiteral)node).Value!.GetType(); 1009Check(clrTypeClass.IsAssignableFrom(node.GetType()), node, $"Node must be instance of {clrTypeClass.Name}");
System\Xml\Xsl\QIL\WhitespaceRule.cs (1)
77Debug.Assert(this.GetType() == typeof(WhitespaceRule), "Serialization of WhitespaceRule subclasses is not implemented");
System\Xml\Xsl\Runtime\XmlQueryContext.cs (4)
200throw new XslTransformException(SR.XmlIl_CantResolveEntity, uriRelative, dataSource.GetType().ToString()); 247return new XmlExtensionFunction(name, namespaceUri, -1, instance.GetType(), XmlQueryRuntime.LateBoundFlags).CanBind(); 272XmlExtensionFunction extFunc = _extFuncsLate.Bind(name, namespaceUri, args.Length, instance.GetType(), XmlQueryRuntime.LateBoundFlags); 307if (xmlTypeFormalArg.TypeCode == XmlTypeCode.Item || !clrTypeFormalArg.IsAssignableFrom(objActualArgs[i].GetType()))
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (9)
480Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), 483Debug.Assert(destinationType == typeof(object) || !destinationType.IsAssignableFrom(value.GetType()), 558Debug.Assert(destinationType.IsAssignableFrom(value.GetType()), $"ChangeType from type {value.GetType().Name} to type {destinationType.Name} failed"); 582if (value.GetType() == typeof(DateTime)) 587if (value.GetType() != typeof(double)) 629Type sourceType = value.GetType(); 680Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), $"Xml type {xmlType} is not represented in ILGen as {value.GetType().Name}");
System\Xml\Xsl\Runtime\XsltFunctions.cs (1)
302Debug.Fail($"Unexpected type: {o.GetType()}");
System\Xml\Xsl\XmlQueryTypeFactory.cs (4)
1174if (type.GetType() == typeof(ItemType)) 1176else if (type.GetType() == typeof(ChoiceType)) 1178else if (type.GetType() == typeof(SequenceType)) 1182Debug.Fail($"Don't know how to serialize {type.GetType()}");
System\Xml\Xsl\Xslt\XsltLoader.cs (1)
222throw new XslLoadException(SR.Xslt_CannotLoadStylesheet, uri.ToString(), input == null ? "null" : input.GetType().ToString());
System\Xml\Xsl\XsltOld\NumberAction.cs (1)
372if (Type.GetTypeCode(value.GetType()) == TypeCode.Object)
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (2)
193MethodInfo? method = FindBestMethod(extension.GetType().GetMethods(bindingFlags), /*ignoreCase:*/true, /*publicOnly:*/false, name, argTypes); 204MethodInfo? method = FindBestMethod(extension.GetType().GetMethods(bindingFlags), /*ignoreCase:*/false, /*publicOnly:*/true, name, argTypes);
System.Private.Xml.Linq (5)
System\Xml\Linq\XHelper.cs (1)
15return o != null && type.IsAssignableFrom(o.GetType());
System\Xml\Linq\XObject.cs (2)
151if (annotations.GetType() == type) return annotations; 159if (obj.GetType() == type) return obj;
System\Xml\XPath\XNodeNavigator.cs (2)
875if (!(result is T)) throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedEvaluation, result.GetType())); 885if (!(r is T)) throw new InvalidOperationException(SR.Format(SR.InvalidOperation_UnexpectedEvaluation, r.GetType()));
System.Reflection.Context (5)
System\Reflection\Context\Custom\AttributeUtils.cs (2)
158Type attributeType = newAttribute.GetType(); 170declaredAttributes.FindIndex((obj) => obj.GetType() == attributeType) < 0))
System\Reflection\Context\CustomReflectionContext.Projector.cs (1)
140throw new InvalidOperationException(SR.Format(SR.InvalidOperation_InvalidMethodType, value.GetType()));
System\Reflection\Context\Projection\ProjectingType.cs (1)
165Type? objectType = _projector.ProjectType(o?.GetType());
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertySetter.cs (1)
50throw new ArgumentException(SR.Format(SR.Argument_ObjectArgumentMismatch, value.GetType(), ReturnType));
System.Reflection.Emit (1)
System\Reflection\Emit\ModuleBuilderImpl.cs (1)
892Type type = defaultValue.GetType();
System.Reflection.Metadata (20)
System\Reflection\Internal\Utilities\ExceptionUtilities.cs (2)
10if (value?.GetType().FullName != null) 12return new InvalidOperationException(SR.Format(SR.UnexpectedValue, value, value.GetType().FullName));
System\Reflection\Metadata\BlobBuilder.cs (1)
538throw new InvalidOperationException(SR.Format(SR.ReturnedBuilderSizeTooSmall, GetType(), nameof(AllocateChunk)));
System\Reflection\Metadata\BlobWriterImpl.cs (2)
156var type = value.GetType(); 229var type = value.GetType();
System\Reflection\Metadata\Internal\MetadataWriterUtilities.cs (15)
19Debug.Assert(!value.GetType().GetTypeInfo().IsEnum); 24if (value.GetType() == typeof(int)) 29if (value.GetType() == typeof(string)) 34if (value.GetType() == typeof(bool)) 39if (value.GetType() == typeof(char)) 44if (value.GetType() == typeof(byte)) 49if (value.GetType() == typeof(long)) 54if (value.GetType() == typeof(double)) 59if (value.GetType() == typeof(short)) 64if (value.GetType() == typeof(ushort)) 69if (value.GetType() == typeof(uint)) 74if (value.GetType() == typeof(sbyte)) 79if (value.GetType() == typeof(ulong)) 84if (value.GetType() == typeof(float)) 89throw new ArgumentException(SR.Format(SR.InvalidConstantValueOfType, value.GetType()), nameof(value));
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\CustomAttributes\RoCustomAttributeData.cs (1)
25public sealed override string ToString() => GetType().ToString(); // Does not match .NET Framework output - however, doing so can prematurely
System.Resources.Extensions (12)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
425Type type = value.GetType(); 584if (sw.Stream.GetType() == typeof(MemoryStream))
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
198throw new ArgumentException(SR.Format(SR.NotSupported_WrongResourceReader_Type, reader.GetType()), nameof(reader));
System\Resources\Extensions\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (1)
38Type elementType = _arrayOfClassRecords.GetType();
System\Resources\Extensions\BinaryFormat\Deserializer\ClassRecordDeserializer.cs (1)
86Type type = value.GetType();
System\Resources\Extensions\BinaryFormat\Deserializer\ObjectRecordDeserializer.cs (1)
93|| (Deserializer.IncompleteObjects.Contains(valueRecord) && value.GetType().IsValueType));
System\Resources\Extensions\BinaryFormat\Deserializer\PendingSerializationInfo.cs (1)
34Type type = @object.GetType();
System\Resources\Extensions\BinaryFormat\Deserializer\SerializationInfoValueUpdater.cs (1)
24_info.UpdateValue(_name, newValue, newValue.GetType());
System\Resources\Extensions\DeserializingResourceReader.cs (3)
147type = value.GetType(); 230if (value.GetType() != type) 231throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResType_SerBlobMismatch, type.FullName, value.GetType().FullName));
System\Resources\Extensions\PreserializedResourceWriter.cs (1)
100Debug.Assert(primitiveValue.GetType() == primitiveType);
System.Resources.Writer (2)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
425Type type = value.GetType(); 584if (sw.Stream.GetType() == typeof(MemoryStream))
System.Runtime.Caching (2)
System\Runtime\Caching\MemoryCache.cs (1)
822string cacheName = $"{this.GetType().FullName}({_name})";
System\Runtime\Caching\MemoryMonitor.cs (1)
85Dbg.Trace("MemoryCacheStats", this.GetType().Name + ".Update: last=" + pressure
System.Runtime.InteropServices (2)
System\Runtime\InteropServices\Marshalling\ComVariantMarshaller.cs (1)
103else if (managed is not null && StrategyBasedComWrappers.DefaultIUnknownInterfaceDetailsStrategy.GetComExposedTypeDetails(managed.GetType().TypeHandle) is not null)
System\Runtime\InteropServices\Marshalling\StrategyBasedComWrappers.cs (1)
79if (GetOrCreateInterfaceDetailsStrategy().GetComExposedTypeDetails(obj.GetType().TypeHandle) is { } details)
System.Runtime.Serialization.Formatters (12)
System\Runtime\Serialization\Formatter.cs (1)
98Type varType = data.GetType();
System\Runtime\Serialization\ObjectManager.cs (9)
187throw new SerializationException(SR.Format(SR.Serialization_NotCyclicallyReferenceableSurrogate, surrogate.GetType().FullName)); 446si.UpdateValue((string)fixupInfo, holderValue, holderValue.GetType()); 682obj.GetType() : 783Type t = obj.GetType(); 934throw new SerializationException(SR.Format(SR.Serialization_InvalidType, member.GetType())); 991SerializationEvents cache = SerializationEventsCache.GetSerializationEventsForType(obj.GetType()); 998SerializationEvents cache = SerializationEventsCache.GetSerializationEventsForType(obj.GetType()); 1006SerializationEvents cache = SerializationEventsCache.GetSerializationEventsForType(obj.GetType()); 1304(_surrogate == null || _surrogate.GetType() != typeof(SurrogateForCyclicalReference));
System\Runtime\Serialization\SerializationObjectManager.cs (2)
28SerializationEvents cache = SerializationEventsCache.GetSerializationEventsForType(obj.GetType()); 49SerializationEvents cache = SerializationEventsCache.GetSerializationEventsForType(obj.GetType());
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\CodeExporter.cs (1)
238throw ExceptionUtil.ThrowHelperError(new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, GetClrTypeFullName(dataContract.GetType()), GetClrTypeFullName(dataContract.UnderlyingType))));
System.Security.Cryptography (7)
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (1)
875$"Unexpected cipher characteristics by {cipher.GetType().FullName}, KeySize={cipher.KeySize}, BlockSize={cipher.BlockSize}");
System\Security\Cryptography\CryptoStream.cs (2)
198if (GetType() != typeof(CryptoStream)) 802return GetType() != typeof(CryptoStream) ?
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
661Debug.Fail($"Key was of no known type: {_key?.GetType().FullName ?? "null"}");
System\Security\Cryptography\X509Certificates\FindPal.cs (1)
166if (findValue.GetType() != typeof(T))
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
610return GetType().ToString();
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
1646Debug.Assert(rawSAN.GetType() == typeof(X509Extension));
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
304_ => throw new ArgumentException(SR.Format(SR.Sign1UnsupportedKey, key.GetType()), nameof(key))
System.Security.Cryptography.Pkcs (1)
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (1)
875$"Unexpected cipher characteristics by {cipher.GetType().FullName}, KeySize={cipher.KeySize}, BlockSize={cipher.BlockSize}");
System.Security.Cryptography.Xml (18)
System\Security\Cryptography\Xml\KeyInfo.cs (1)
141if (requestedObjectType.Equals(tempObj.GetType()))
System\Security\Cryptography\Xml\SignedXml.cs (1)
1100Type actualType = key.GetType();
System\Security\Cryptography\Xml\SignedXmlDebugLog.cs (15)
247return $"{key.GetType().Name}#{keyName}"; 257return $"{o.GetType().Name}#{o.GetHashCode():x8}"; 289canonicalizationTransform.GetType().Name); 300canonicalizationTransform.Resolver!.GetType(), 645signatureDescription.GetType().Name, 646hash.GetType().Name, 647asymmetricSignatureFormatter.GetType().Name); 670key.GetType().Name); 693string hashAlgorithmName = hashAlgorithm == null ? "null" : hashAlgorithm.GetType().Name; 829string hashAlgorithmName = hashAlgorithm == null ? "null" : hashAlgorithm.GetType().Name; 874signatureDescription.GetType().Name, 875hashAlgorithm.GetType().Name, 876asymmetricSignatureDeformatter.GetType().Name); 917mac.GetType().Name); 1044string hashAlgorithmName = hashAlgorithm == null ? "null" : hashAlgorithm.GetType().Name;
System\Security\Cryptography\Xml\TransformChain.cs (1)
67if (currentInput == null || transform.AcceptsType(currentInput.GetType()))
System.Security.Permissions (6)
System\Security\Permissions\PrincipalPermission.cs (6)
62return (perm != null) && (perm.GetType() == GetType()); 83throw new ArgumentException(SR.Format(SR.Argument_WrongType, GetType().FullName), nameof(target)); 126throw new ArgumentException(SR.Format(SR.Argument_WrongType, GetType().FullName), nameof(target)); 182throw new ArgumentException(SR.Format(SR.Argument_WrongType, GetType().FullName), nameof(other)); 256root.AddAttribute("class", typename + ", " + GetType().Module.Assembly.FullName.Replace('\"', '\''));
System.ServiceModel.Federation (4)
System\IdentityModel\Security\WrapperSecurityCommunicationObject.cs (2)
27return _innerCommunicationObject.GetType(); 32return _innerCommunicationObject.GetType();
System\Runtime\OperationWithTimeoutAsyncResult.cs (2)
132throw new InvalidOperationException(SR.Format(SR.AsyncResultCompletedTwice, GetType())); 339throw new InvalidOperationException(InternalSR.InvalidAsyncResultImplementation(result.GetType()));
System.ServiceModel.NetFramingBase (8)
System\ServiceModel\Channels\NetFramingTransportChannelFactory.cs (4)
195if (!s_connectionPoolRegistries.ContainsKey(GetType())) 199if (!s_connectionPoolRegistries.ContainsKey(GetType())) 201s_connectionPoolRegistries[GetType()] = new ConnectionPoolRegistry(); 206_connectionPoolRegistry = (ConnectionPoolRegistry)s_connectionPoolRegistries[GetType()];
System\ServiceModel\Channels\SslStreamSecurityUpgradeProvider.cs (3)
116throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("upgradeInitiator", SR.Format(SR.UnsupportedUpgradeInitiator, upgradeInitiator.GetType())); 121throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("kind", SR.Format(SR.StreamUpgradeUnsupportedChannelBindingKind, GetType(), kind)); 188SR.InvalidTokenProvided, _serverTokenProvider.GetType(), typeof(X509SecurityToken))));
System\ServiceModel\Channels\TransportSecurityHelpers.cs (1)
93SR.InvalidTokenProvided, tokenProvider.GetType(), typeof(T))));
System.ServiceModel.Primitives.Tests (16)
ServiceModel\ChannelFactoryTest.cs (12)
39Assert.True(typeof(IRequestChannel).GetTypeInfo().IsAssignableFrom(channel.GetType().GetTypeInfo()), 40String.Format("Channel type '{0}' was not assignable to '{1}'", channel.GetType(), typeof(IRequestChannel))); 43Assert.True(typeof(IRequestChannel).GetTypeInfo().IsAssignableFrom(channel2.GetType().GetTypeInfo()), 44String.Format("Channel type '{0}' was not assignable to '{1}'", channel2.GetType(), typeof(IRequestChannel))); 96Assert.True(typeof(IRequestChannel).GetTypeInfo().IsAssignableFrom(channel.GetType().GetTypeInfo()), 97String.Format("Channel type '{0}' was not assignable to '{1}'", channel.GetType(), typeof(IRequestChannel))); 100Assert.True(typeof(IRequestChannel).GetTypeInfo().IsAssignableFrom(channel2.GetType().GetTypeInfo()), 101String.Format("Channel type '{0}' was not assignable to '{1}'", channel2.GetType(), typeof(IRequestChannel))); 152Assert.True(typeof(IRequestChannel).GetTypeInfo().IsAssignableFrom(channel.GetType().GetTypeInfo()), 153String.Format("Channel type '{0}' was not assignable to '{1}'", channel.GetType(), typeof(IRequestChannel))); 196Assert.True(typeof(IWcfServiceGenerated).GetTypeInfo().IsAssignableFrom(channel.GetType().GetTypeInfo()), 197String.Format("Channel type '{0}' was not assignable to '{1}'", channel.GetType(), typeof(IRequestChannel)));
ServiceModel\DuplexChannelFactoryTest.cs (4)
229Assert.True(typeof(IWcfDuplexService).GetTypeInfo().IsAssignableFrom(channel.GetType().GetTypeInfo()), 230String.Format("Channel type '{0}' was not assignable to '{1}'", channel.GetType(), typeof(IDuplexChannel))); 233Assert.True(typeof(IWcfDuplexService).GetTypeInfo().IsAssignableFrom(channel2.GetType().GetTypeInfo()), 234String.Format("Channel type '{0}' was not assignable to '{1}'", channel2.GetType(), typeof(IDuplexChannel)));
System.ServiceModel.Syndication (17)
System\ServiceModel\Syndication\Atom10FeedFormatter.cs (1)
55FeedType = feedToWrite.GetType();
System\ServiceModel\Syndication\Atom10ItemFormatter.cs (1)
36ItemType = itemToWrite.GetType();
System\ServiceModel\Syndication\AtomPub10CategoriesDocumentFormatter.cs (2)
45_inlineDocumentType = documentToWrite.GetType(); 50_referencedDocumentType = documentToWrite.GetType();
System\ServiceModel\Syndication\AtomPub10ServiceDocumentFormatter.cs (1)
41_documentType = documentToWrite.GetType();
System\ServiceModel\Syndication\Rss20FeedFormatter.cs (1)
56FeedType = feedToWrite.GetType();
System\ServiceModel\Syndication\Rss20ItemFormatter.cs (1)
49ItemType = itemToWrite.GetType();
System\ServiceModel\Syndication\SyndicationElementExtension.cs (6)
64dataContractSerializer ??= new DataContractSerializer(dataContractExtension.GetType()); 75serializer ??= new XmlSerializer(xmlSerializerExtension.GetType()); 120if (_extensionData != null && typeof(TExtension).IsAssignableFrom(_extensionData.GetType())) 134if (_extensionData != null && typeof(TExtension).IsAssignableFrom(_extensionData.GetType())) 257XmlQualifiedName qName = dcExporter.GetRootElementName(_extensionData.GetType()); 273XmlTypeMapping typeMapping = importer.ImportTypeMapping(_extensionData.GetType());
System\ServiceModel\Syndication\SyndicationElementExtensionCollection.cs (2)
68dataContractSerializer ??= new DataContractSerializer(dataContractExtension.GetType()); 76serializer ??= new XmlSerializer(xmlSerializerExtension.GetType());
System\ServiceModel\Syndication\SyndicationFeedFormatter.cs (1)
54public override string ToString() => $"{GetType()}, SyndicationVersion={Version}";
System\ServiceModel\Syndication\SyndicationItemFormatter.cs (1)
34public override string ToString() => $"{GetType()}, SyndicationVersion={Version}";
System.ServiceModel.UnixDomainSocket (4)
System\ServiceModel\Channels\SocketConnection.cs (2)
479GetType().ToString(), SR.SocketConnectionDisposed), TransferOperation.Undefined)); 489GetType().ToString(), SR.SocketConnectionDisposed), TransferOperation.Undefined));
System\ServiceModel\Channels\UnixDomainSocketChannelFactory.cs (2)
119if (other.GetType().IsConstructedGenericType) 121if (other.GetType().GetGenericTypeDefinition() != typeof(UnixDomainSocketChannelFactory<>))
System.Text.Encoding.CodePages (5)
System\Text\DBCSCodePageEncoding.cs (2)
541throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, EncodingName, encoder.Fallback.GetType())); 657throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, EncodingName, encoder.Fallback.GetType()));
System\Text\EncodingByteBuffer.cs (1)
42throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, _encoder.Encoding.EncodingName, _encoder.Fallback.GetType()));
System\Text\EncodingNLS.cs (2)
338throw new ArgumentException(SR.Format(SR.Argument_EncodingConversionOverflowBytes, EncodingName, EncoderFallback.GetType()), "bytes"); 346throw new ArgumentException(SR.Format(SR.Argument_EncodingConversionOverflowChars, EncodingName, DecoderFallback.GetType()), "chars");
System.Text.Encodings.Web (2)
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (1)
477if (GetType() == typeof(OptimizedInboxTextEncoder)) { /* intentionally left blank */ }
System\Text\Encodings\Web\TextEncoderSettings.cs (1)
219if (GetType() == typeof(TextEncoderSettings))
System.Text.Json (18)
System\ReflectionExtensions.cs (1)
66if (attribute.GetType().FullName == fullName)
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (1)
53Type runtimeType = value.GetType();
System\Text\Json\Serialization\JsonConverter.cs (1)
20IsInternalConverter = GetType().Assembly == typeof(JsonConverter).Assembly;
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (2)
72Debug.Assert(value != null && Type!.IsAssignableFrom(value.GetType())); 83Type runtimeType = value.GetType();
System\Text\Json\Serialization\JsonConverterFactory.cs (2)
43ThrowHelper.ThrowInvalidOperationException_SerializerConverterFactoryReturnsNull(GetType()); 46ThrowHelper.ThrowInvalidOperationException_SerializerConverterFactoryReturnsJsonConverterFactorty(GetType());
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (2)
74Type runtimeType = value.GetType(); 126ThrowHelper.ThrowInvalidCastException_DeserializeUnableToAssignValue(typeOfValue: value.GetType(), declaredType: typeof(T));
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
532referenceId, value.GetType(), typeof(T));
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (1)
163Type runtimeType = rootValue.GetType();
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (1)
166ThrowHelper.ThrowInvalidOperationException_SerializationConverterNotCompatible(converter.GetType(), typeToConvert);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.cs (1)
118=> _modifiers is null or { Count: 0 } && GetType() == typeof(DefaultJsonTypeInfoResolver);
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (1)
220Type attributeType = attr.GetType();
System\Text\Json\ThrowHelper.Serialization.cs (4)
22throw new ArgumentException(SR.Format(SR.DeserializeWrongType, type, value.GetType())); 46throw new NotSupportedException(SR.Format(SR.DictionaryKeyTypeNotSupported, keyType, converter.GetType())); 394throw new InvalidOperationException(SR.Format(SR.ConverterCanConvertMultipleTypes, jsonConverter.GetType(), jsonConverter.Type, runtimePropertyType)); 945throw new InvalidOperationException(SR.Format(SR.PipeWriter_DoesNotImplementUnflushedBytes, pipeWriter.GetType().Name));
System.Text.Json.SourceGeneration (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexCompiler.cs (1)
6213Call(MakeUnsafeAs(list[index].GetType())); // provide JIT with details necessary to devirtualize calls on this instance
System.Text.RegularExpressions.Generator (1)
src\libraries\Common\src\System\ExceptionPolyfills.cs (1)
49throw new ObjectDisposedException(instance?.GetType().FullName);
System.Threading.Channels (1)
System\Threading\Channels\AsyncOperation.cs (1)
234if (sc != null && sc.GetType() != typeof(SynchronizationContext))
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\TimerAwaitable.cs (1)
114throw new ObjectDisposedException(GetType().FullName);
System.Threading.Tasks.Dataflow (1)
Internal\Common.cs (1)
125string blockName = block.GetType().Name;
System.Transactions.Local (23)
System\Transactions\EnlistmentState.cs (8)
59Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 65Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 71Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 77Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 83Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 89Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 95Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 101Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}");
System\Transactions\TransactionsEtwProvider.cs (1)
227public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance;
System\Transactions\TransactionState.cs (14)
185Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 299Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 311Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 323Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 335Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 347Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 359Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 371Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 383Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 395Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 411Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 417Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 423Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 2023serializationInfo.FullTypeName = serializableTx.GetType().FullName!;
System.Web.Services.Description (96)
System\Web\Services\Description\ServiceDescription.cs (7)
1149if (type.IsAssignableFrom(item.GetType())) 1164if (type.IsAssignableFrom(item.GetType())) 1404if (Count > 1 || (Count == 1 && value.GetType() == List[0].GetType())) 1414if (oldValue.GetType() != newValue.GetType()) 2085throw new ArgumentException(GetDuplicateMessage(value.GetType(), key), e.InnerException);
System\Web\Services\Description\ServiceDescriptionSerializer.cs (88)
26System.Type t = o.GetType(); 123System.Type t = o.GetType(); 186System.Type t = o.GetType(); 262System.Type t = o.GetType(); 292System.Type t = o.GetType(); 322System.Type t = o.GetType(); 352System.Type t = o.GetType(); 436System.Type t = o.GetType(); 521System.Type t = o.GetType(); 593System.Type t = o.GetType(); 640System.Type t = o.GetType(); 687System.Type t = o.GetType(); 777System.Type t = o.GetType(); 814System.Type t = o.GetType(); 882System.Type t = o.GetType(); 919System.Type t = o.GetType(); 966System.Type t = o.GetType(); 996System.Type t = o.GetType(); 1027System.Type t = o.GetType(); 1066System.Type t = o.GetType(); 1105System.Type t = o.GetType(); 1146System.Type t = o.GetType(); 1186System.Type t = o.GetType(); 1227System.Type t = o.GetType(); 1267System.Type t = o.GetType(); 1363System.Type t = o.GetType(); 1392System.Type t = o.GetType(); 1421System.Type t = o.GetType(); 1464System.Type t = o.GetType(); 1494System.Type t = o.GetType(); 1540System.Type t = o.GetType(); 1573System.Type t = o.GetType(); 1603System.Type t = o.GetType(); 1636System.Type t = o.GetType(); 1699System.Type t = o.GetType(); 1786System.Type t = o.GetType(); 1842System.Type t = o.GetType(); 1898System.Type t = o.GetType(); 1954System.Type t = o.GetType(); 2017System.Type t = o.GetType(); 2074System.Type t = o.GetType(); 2136System.Type t = o.GetType(); 2250System.Type t = o.GetType(); 2308System.Type t = o.GetType(); 2364System.Type t = o.GetType(); 2419System.Type t = o.GetType(); 2474System.Type t = o.GetType(); 2544System.Type t = o.GetType(); 2599System.Type t = o.GetType(); 2699System.Type t = o.GetType(); 2747System.Type t = o.GetType(); 2788System.Type t = o.GetType(); 2836System.Type t = o.GetType(); 2885System.Type t = o.GetType(); 2943System.Type t = o.GetType(); 2983System.Type t = o.GetType(); 3074System.Type t = o.GetType(); 3116System.Type t = o.GetType(); 3158System.Type t = o.GetType(); 3200System.Type t = o.GetType(); 3242System.Type t = o.GetType(); 3284System.Type t = o.GetType(); 3326System.Type t = o.GetType(); 3368System.Type t = o.GetType(); 3410System.Type t = o.GetType(); 3452System.Type t = o.GetType(); 3494System.Type t = o.GetType(); 3536System.Type t = o.GetType(); 3578System.Type t = o.GetType(); 3669System.Type t = o.GetType(); 3774System.Type t = o.GetType(); 3816System.Type t = o.GetType(); 3887System.Type t = o.GetType(); 3926System.Type t = o.GetType(); 3967System.Type t = o.GetType(); 4015System.Type t = o.GetType(); 4085System.Type t = o.GetType(); 4137System.Type t = o.GetType(); 4217System.Type t = o.GetType(); 4297System.Type t = o.GetType(); 4348System.Type t = o.GetType(); 4461System.Type t = o.GetType(); 4522System.Type t = o.GetType(); 4563System.Type t = o.GetType(); 4624System.Type t = o.GetType(); 4663System.Type t = o.GetType(); 4703System.Type t = o.GetType(); 4771System.Type t = o.GetType();
System\Web\Services\Diagnostics\TraceUtility.cs (1)
205sb.Append(o.GetType().FullName);
System.Windows.Controls.Ribbon (25)
Microsoft\Windows\Automation\Peers\RibbonAutomationPeer.cs (1)
39return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonContextMenuAutomationPeer.cs (1)
35return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonContextualTabGroupAutomationPeer.cs (1)
64return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonControlAutomationPeer.cs (1)
32return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonControlGroupAutomationPeer.cs (1)
40return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonGroupAutomationPeer.cs (1)
53return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonGroupHeaderAutomationPeer.cs (1)
45return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonMenuButtonAutomationPeer.cs (1)
84return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonMenuItemAutomationPeer.cs (1)
60return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonQuickAccessToolBarAutomationPeer.cs (1)
73return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonSeparatorAutomationPeer.cs (1)
39return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonTabAutomationPeer.cs (1)
58return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonTabHeaderAutomationPeer.cs (1)
35return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonTitleAutomationPeer.cs (1)
40return Owner.GetType().Name;
Microsoft\Windows\Automation\Peers\RibbonTwoLineTextAutomationPeer.cs (1)
40return Owner.GetType().Name;
Microsoft\Windows\Controls\Ribbon\RibbonApplicationMenu.cs (1)
241throw new InvalidOperationException(Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidApplicationMenuOrItemContainer, this.GetType().Name, itemContainer));
Microsoft\Windows\Controls\Ribbon\RibbonApplicationMenuItem.cs (1)
75throw new InvalidOperationException(Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidApplicationMenuOrItemContainer, this.GetType().Name, itemContainer));
Microsoft\Windows\Controls\Ribbon\RibbonApplicationSplitMenuItem.cs (1)
73throw new InvalidOperationException(Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidApplicationMenuOrItemContainer, this.GetType().Name, itemContainer));
Microsoft\Windows\Controls\Ribbon\RibbonContextMenu.cs (1)
529throw new InvalidOperationException(Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidMenuButtonOrItemContainer, this.GetType().Name, itemContainer));
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (3)
1875object clone = Activator.CreateInstance(original.GetType()); 1946return (FrameworkElement)Activator.CreateInstance(original.GetType()); 2019if (clone.GetType().IsInstanceOfType(original))
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (2)
557throw new InvalidOperationException(Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidMenuButtonOrItemContainer, this.GetType().Name, itemContainer)); 1469Debug.Assert(GetType().IsSubclassOf(type)); // RibbonMenuButton is a subclass of MenuBase
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (1)
519throw new InvalidOperationException(Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidMenuButtonOrItemContainer, this.GetType().Name, itemContainer));
System.Windows.Forms (234)
System\Resources\ResXDataNode.cs (4)
83Type valueType = (value is null) ? typeof(object) : value.GetType(); 238Type valueType = value?.GetType() ?? typeof(object); 560? GenerateObjectFromBinaryDataNodeInfo(_nodeInfo, typeResolver)?.GetType() 561: GenerateObjectFromDataNodeInfo(_nodeInfo, typeResolver)?.GetType();
System\Windows\Forms\Accessibility\AccessibleObject.cs (1)
315RuntimeTypeHandle type = GetType().TypeHandle;
System\Windows\Forms\ActiveX\AxHost.AxPropertyDescriptor.cs (1)
224if (PropertyType.IsEnum && value is not null && value.GetType() != PropertyType)
System\Windows\Forms\ActiveX\AxHost.cs (9)
192_axState[s_assignUniqueID] = !GetType().GUID.Equals(s_comctlImageCombo_Clsid); 1461throw new TargetInvocationException(string.Format(SR.AXNohWnd, GetType().Name), t); 1529throw new NotSupportedException(string.Format(SR.AXNohWnd, GetType().Name)); 1608throw new TargetInvocationException(string.Format(SR.AXNohWnd, GetType().Name), t); 2314throw new LicenseException(GetType(), this, SR.AXNoLicenseToUse); 2434TypeDescriptor.Refresh(GetType()); 2512TypeDescriptor.Refresh(GetType()); 2579PropertyInfo[] propInfos = GetType().GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance); 3832return o.GetType() == typeof(float)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (6)
735string streamName = _control.GetType().FullName!; 1011GetType().FullName!, 1091using BSTR bstrSource = new(_control.GetType().FullName!); 1168$"No type converter for property '{currentProperty.Name}' on class {_control.GetType().FullName}"); 1412if (GetDefaultEventsInterface(_control.GetType()) is { } eventInterface) 1552$"No type converter for property '{currentProperty.Name}' on class {_control.GetType().FullName}");
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (7)
247*pClsid = GetType().GUID; 260(USERCLASSTYPE)dwFormOfType == USERCLASSTYPE.USERCLASSTYPE_FULL ? GetType().FullName : GetType().Name); 361*pClassID = GetType().GUID; 376*pClassID = GetType().GUID; 402*pClassID = GetType().GUID; 448*pClassID = GetType().GUID;
System\Windows\Forms\ApplicationContext.cs (2)
35if (GetType() == typeof(ApplicationContext) || GetType() == Application.s_typeOfModalApplicationContext)
System\Windows\Forms\ComponentModel\COM2Interop\COM2ColorConverter.cs (1)
37Debug.Fail($"Don't know how to set type: {managedValue.GetType().Name}");
System\Windows\Forms\ComponentModel\COM2Interop\COM2Enum.cs (3)
95if (_values.Length > 0 && value.GetType() != _values[0].GetType()) 99value = Convert.ChangeType(value, _values[0].GetType(), CultureInfo.InvariantCulture);
System\Windows\Forms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (1)
158if (parameters.Length == 1 && parameters[0].ParameterType.IsAssignableFrom(value.GetType()))
System\Windows\Forms\ComponentModel\COM2Interop\Com2IPerPropertyBrowsingHandler.Com2IPerPropertyBrowsingEnum.cs (1)
110if (valueItems[i].GetType() != targetType)
System\Windows\Forms\ComponentModel\COM2Interop\COM2PictureConverter.cs (1)
116Debug.Fail($"Unknown Image type: {managedValue.GetType().Name}");
System\Windows\Forms\ComponentModel\COM2Interop\COM2Properties.cs (1)
170Debug.WriteLine($"Adding browsing handler type {handler.GetType().Name} to object.");
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (3)
655if (_lastValue is not null && _propertyType is not null && _propertyType.IsEnum && _lastValue.GetType().IsPrimitive) 701_ = value.GetType(); 725Type localConverterType = localConverter.GetType();
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyPageUITypeConverter.cs (2)
39if (instance is not null && !instance.GetType().IsArray) 66object[] objects = component.GetType().IsArray ? (object[])component : [component];
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (1)
791enumType = var.GetType();
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.cs (3)
104=> TypeDescriptor.GetEditor(component.GetType(), baseEditorType); 340Type type = propertyValue.GetType(); 342if (subConverter is not null && subConverter.GetType() != typeof(TypeConverter))
System\Windows\Forms\Control.ControlNativeWindow.cs (1)
76return _control.GetType().FullName!;
System\Windows\Forms\Control.ControlVersionInfo.cs (7)
33object[] attrs = _owner.GetType().Module.Assembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 50string? ns = _owner.GetType().Namespace; 80object[] attrs = _owner.GetType().Module.Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false); 97string? ns = _owner.GetType().Namespace; 128object[] attrs = _owner.GetType().Module.Assembly.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false); 163string path = _owner.GetType().Module.FullyQualifiedName; 172private bool OwnerIsInMemoryAssembly => _owner.GetType().Assembly.Location.Length == 0;
System\Windows\Forms\Control.cs (5)
3506Exception ex = new ObjectDisposedException(GetType().Name); 4654Exception ex = new ObjectDisposedException(GetType().Name); 9148Debug.WriteLineIf(CoreSwitches.PerfTrack.Enabled, $"RecreateHandle: {GetType().FullName} [Text={Text}]"); 10831if (this is TabControl || GetType() == typeof(Control)) 11190string type = GetType().AssemblyQualifiedName!;
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckableControlBaseAdapter.cs (1)
55Debug.Fail($"Unexpected control type '{Control.GetType().FullName}'");
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (1)
1469Type valueType = value.GetType();
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (6)
2594Type? editingCellInterface = dataGridViewCell.GetType().GetInterface("System.Windows.Forms.IDataGridViewEditingCell"); 2627Type? editingCellInterface = dataGridViewCell.GetType().GetInterface("System.Windows.Forms.IDataGridViewEditingCell"); 2658&& !_latestEditingControl.GetType().IsSubclassOf(editControlType)) 21896editingCellInterface = dataGridViewCell.GetType().GetInterface("System.Windows.Forms.IDataGridViewEditingCell"); 25295|| (dataGridViewCurrentCell.FormattedValueType is not null && dataGridViewCurrentCell.FormattedValueType.IsAssignableFrom(nullValue.GetType()))) 25361&& dataGridViewCurrentCell.ValueType.IsAssignableFrom(dgvcpe.Value.GetType()))
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (1)
714DataGridViewBand band = (DataGridViewBand)Activator.CreateInstance(GetType())!;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (1)
130Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (1)
188Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (5)
940DataGridViewCell dataGridViewCell = (DataGridViewCell)Activator.CreateInstance(GetType())!; 1118Type editingControlType = DataGridView.EditingControl.GetType(); 1612(formattedValue is null || !FormattedValueType.IsAssignableFrom(formattedValue.GetType()))) 1645(formattedValue is null || FormattedValueType is null || !FormattedValueType.IsAssignableFrom(formattedValue.GetType()))) 3730!FormattedValueType.IsAssignableFrom(formattedValue.GetType()))
System\Windows\Forms\Controls\DataGridView\DataGridViewCellConverter.cs (1)
30ConstructorInfo? ctor = cell.GetType().GetConstructor([]);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyleConverter.cs (1)
40ConstructorInfo? ctor = value.GetType().GetConstructor([]);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (3)
62if (value is null || !FormattedValueType.IsAssignableFrom(value.GetType())) 410Type thisType = GetType(); 1574Debug.Assert(formattedValue is null || FormattedValueType is null || FormattedValueType.IsAssignableFrom(formattedValue.GetType()));
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.DataGridViewCheckBoxCellAccessibleObject.cs (1)
155throw new InvalidOperationException(string.Format(SR.DataGridViewCellAccessibleObject_OwnerWrongType, Owner is null ? "null" : Owner.GetType().Name));
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (2)
161public Type? CellType => CellTemplate?.GetType(); 815DataGridViewColumn dataGridViewColumn = (DataGridViewColumn)Activator.CreateInstance(GetType())!;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnConverter.cs (2)
42ctor = dataGridViewColumn.GetType().GetConstructor([typeof(Type)]); 51ctor = dataGridViewColumn.GetType().GetConstructor([]);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (1)
98Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (2)
636Type thisType = GetType(); 913if (value is null || ((ValueType is not null && !ValueType.IsAssignableFrom(value.GetType())) && value != DBNull.Value))
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxColumn.cs (1)
496Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewElement.cs (20)
22if (GetType() == typeof(DataGridViewBand) || GetType() == typeof(DataGridViewColumn) || 23GetType() == typeof(DataGridViewButtonColumn) || GetType() == typeof(DataGridViewCheckBoxColumn) || 24GetType() == typeof(DataGridViewComboBoxColumn) || GetType() == typeof(DataGridViewImageColumn) || 25GetType() == typeof(DataGridViewLinkColumn) || GetType() == typeof(DataGridViewTextBoxColumn) || 26GetType() == typeof(DataGridViewRow) || GetType() == typeof(DataGridViewCell) || 27GetType() == typeof(DataGridViewButtonCell) || GetType() == typeof(DataGridViewCheckBoxCell) || 28GetType() == typeof(DataGridViewComboBoxCell) || GetType() == typeof(DataGridViewHeaderCell) || 29GetType() == typeof(DataGridViewColumnHeaderCell) || GetType() == typeof(DataGridViewTopLeftHeaderCell) || 30GetType() == typeof(DataGridViewRowHeaderCell) || GetType() == typeof(DataGridViewImageCell) || 31GetType() == typeof(DataGridViewLinkCell) || GetType() == typeof(DataGridViewTextBoxCell))
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
193Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
205Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (1)
239Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (1)
365Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkColumn.cs (1)
370Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
1044Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewRowConverter.cs (1)
29ConstructorInfo? ctor = row.GetType().GetConstructor([]);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (1)
54Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (1)
103Type thisType = GetType();
System\Windows\Forms\Controls\Labels\Label.cs (1)
968if (GetType() == typeof(Label))
System\Windows\Forms\Controls\ListView\ColumnHeader.cs (1)
430Type clonedType = GetType();
System\Windows\Forms\Controls\ListView\ListViewItem.cs (1)
901Type clonedType = GetType();
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (2)
446if (this.TryGetOwnerAs(out MonthCalendar? owner) && owner.GetType().BaseType is Type baseType) 448return $"{owner.GetType().Name}({baseType.Name})";
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (9)
960Type newType = newObject.GetType(); 1055Type objectType = currentObject.GetType(); 1691throw new ArgumentException(string.Format(SR.PropertyGridNoBitmap, tab.GetType().FullName)); 1696throw new ArgumentException(string.Format(SR.PropertyGridTabName, tab.GetType().FullName)); 2424if (!TypeDescriptorHelper.TryGetAttribute(e.Component.GetType(), out PropertyTabAttribute? tabAttribute)) 2471if (!TypeDescriptorHelper.TryGetAttribute(e.Component.GetType(), out PropertyTabAttribute? tabAttribute)) 3447if (TypeDescriptorHelper.TryGetAttribute(components.GetType(), out PropertyTabAttribute? tabAttribute)) 3642Debug.Assert(oldObject is not null && newObject is not null && oldObject.GetType() == newObject.GetType());
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.TabInfo.cs (1)
13public Type TabType => Tab.GetType();
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\AttributeTypeSorter.cs (1)
37Debug.Fail($"Attribute '{attribute.GetType().FullName}' does not have a typeid.");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (3)
739public virtual Type? PropertyType => PropertyValue?.GetType(); 1470public override int GetHashCode() => HashCode.Combine(PropertyLabel, PropertyType, GetType()); 2261public override string ToString() => $"{GetType().FullName} {PropertyLabel}";
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridToolTip.cs (1)
134Debug.Fail($"TTM_ADDTOOL failed for {control.GetType().Name}");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.cs (1)
116Type type = value.GetType();
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (6)
85|| (owner.GetType().IsValueType && owner.GetType() == entry.PropertyValue?.GetType())) 107Type ownerType = owner.GetType(); 367bool isValueType = owner?.GetType().IsValueType ?? false; 846string componentName = component.Site?.Name ?? component.GetType().Name;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (4)
2439if (value is not null && currentValue is not null && value.GetType() != currentValue.GetType() 2440&& entry.TypeConverter.CanConvertTo(entry, value.GetType())) 2442currentValue = entry.TypeConverter.ConvertTo(entry, CultureInfo.CurrentCulture, currentValue, value.GetType());
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.GridViewTextBox.GridViewTextBoxAccessibleObject.cs (1)
68UIA_PROPERTY_ID.UIA_ClassNamePropertyId when this.TryGetOwnerAs(out object? owner) => (VARIANT)owner.GetType().ToString(),
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (1)
168return component.Site?.Name ?? Target.GetType().Name;
System\Windows\Forms\Controls\TabControl\TabControl.ControlCollection.cs (1)
25throw new ArgumentException(string.Format(SR.TabControlInvalidTabPageType, value.GetType().Name));
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
487throw new ArgumentException(string.Format(SR.TabControlTabPageNotOnTabControl, value.GetType().FullName));
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (2)
1515_currentRendererType = _renderer.GetType(); 1529_currentRendererType = (_renderer is not null) ? _renderer.GetType() : typeof(Type);
System\Windows\Forms\Controls\ToolStrips\ToolStripContainer.ToolStripContainerTypedControlCollection.cs (2)
34Type controlType = value.GetType(); 37throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, string.Format(SR.TypedControlCollectionShouldBeOfTypes, _contentPanelType.Name, _panelType.Name)), value.GetType().Name);
System\Windows\Forms\Controls\ToolStrips\ToolStripCustomIComparer.cs (6)
15if (x.GetType() == y.GetType()) 20if (x.GetType().IsAssignableFrom(y.GetType())) 25if (y.GetType().IsAssignableFrom(x.GetType()))
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
796if (typeof(ToolStripDropDownItem).IsAssignableFrom(childItem.GetType()))
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (2)
237if ((typeof(ToolStripButton).IsAssignableFrom(e.Item.GetType()) 240|| (typeof(ToolStripMenuItem).IsAssignableFrom(e.Item.GetType())
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (7)
464CurrentRendererType = (value is null) ? s_defaultRendererType : value.GetType(); 620LoadSettings(targetForm, targetForm.GetType().FullName!); 643SaveSettings(sourceForm, sourceForm.GetType().FullName!); 1095&& (sourceToolStrip.GetType().IsAssignableFrom(targetToolStrip.GetType()) 1096|| targetToolStrip.GetType().IsAssignableFrom(sourceToolStrip.GetType())));
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (1)
52throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, string.Format(SR.TypedControlCollectionShouldBeOfType, nameof(ToolStrip))), control.GetType().Name);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowControlCollection.ToolStripPanelCellToControlEnumerator.cs (1)
29Debug.Assert(cell is not null, $"Expected ToolStripPanel cells only!!!{_arrayListEnumerator.Current.GetType()}");
System\Windows\Forms\Controls\ToolStrips\ToolStripRendererSwitcher.cs (1)
67_currentRendererType = (_renderer is not null) ? _renderer.GetType() : typeof(Type);
System\Windows\Forms\Controls\TreeView\TreeNode.cs (3)
1343Type clonedType = GetType(); 2085if (_userData is not null && _userData.GetType().IsSerializable) 2087si.AddValue("UserData", _userData, _userData.GetType());
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
479if (!Marshal.IsTypeVisibleFromCom(value.GetType()))
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (2)
946throw new TargetInvocationException(string.Format(SR.AXNohWnd, GetType().Name), t); 989throw new TargetInvocationException(string.Format(SR.AXNohWnd, GetType().Name), t);
System\Windows\Forms\DataBinding\Binding.cs (12)
481Type controlClass = BindableComponent.GetType(); 698(value is null ? _propInfo!.PropertyType : value.GetType()), 712if (e.Value is not null && (e.Value.GetType().IsSubclassOf(type) || e.Value.GetType() == type || e.Value is DBNull)) 718TypeConverter typeConverter = TypeDescriptor.GetConverter(value is not null ? value.GetType() : typeof(object)); 728if (ret is not null && (ret.GetType().IsSubclassOf(type) || ret.GetType() == type)) 786if (ret is not null && (ret.GetType().IsSubclassOf(type) || ret.GetType() == type)) 792TypeConverter typeConverter = TypeDescriptor.GetConverter(value is not null ? value.GetType() : typeof(object)); 802if (ret is not null && (ret.GetType().IsSubclassOf(type) || ret.GetType() == type))
System\Windows\Forms\DataBinding\BindingSource.cs (4)
689list ??= CreateBindingList(item.GetType()); 1220IList list = CreateBindingList(obj.GetType()); 1467SetList(CreateBindingList((value is null) ? typeof(object) : value.GetType()), true, true); 1472if (value is not null && !_itemType!.IsAssignableFrom(value.GetType()))
System\Windows\Forms\DataBinding\CurrencyManager.cs (3)
156finalType = tempList.GetType(); 167finalType ??= tempList.GetType(); 188throw new ArgumentException(string.Format(SR.ListManagerSetDataSource, tempList.GetType().FullName), nameof(dataSource));
System\Windows\Forms\DataBinding\ListBindingHelper.cs (4)
101type = list.GetType(); 220Type listType = (list is Type type) ? type : list.GetType(); 443return (instance is not null) ? instance.GetType() : typeof(object); 574Type targetType = enumerable.GetType();
System\Windows\Forms\DataBinding\PropertyManager.cs (1)
68internal override Type BindType => _dataSource!.GetType();
System\Windows\Forms\Design\PropertyTab.cs (2)
47GetType(), 48GetType().Name,
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (4)
294GetType(), 298GetType(), 343_expandImage = ScaleHelper.GetSmallIconResourceAsBitmap(GetType(), DownBitmapName, DeviceDpi); 344_collapseImage = ScaleHelper.GetSmallIconResourceAsBitmap(GetType(), UpBitmapName, DeviceDpi);
System\Windows\Forms\Form.cs (4)
6182Type? closestMatchingSourceType = FindClosestStockType(sourceToolStrip.GetType()); 6185Type? closestMatchingTargetType = FindClosestStockType(thisToolstrip.GetType()); 6188thisToolstrip.GetType().IsAssignableFrom(sourceToolStrip.GetType()))
System\Windows\Forms\Help\Help.cs (2)
173Debug.Fail($"Cannot handle HTML parameter of type: {htmlParam!.GetType()}"); 185else if (param.GetType() == typeof(int))
System\Windows\Forms\Internal\Formatter.cs (3)
138Type sourceType = value.GetType(); 339else if (value is not null && targetType.IsAssignableFrom(value.GetType())) 496Equals(value, NullData(value.GetType(), dataSourceNullValue));
System\Windows\Forms\Internal\TypedControlCollection.cs (2)
46if (!_typeOfControl.IsAssignableFrom(value.GetType())) 48throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, string.Format(SR.TypedControlCollectionShouldBeOfType, _typeOfControl.Name)), value.GetType().Name);
System\Windows\Forms\Internal\WinFormsUtils.cs (1)
167typeOfControl = c.GetType().ToString();
System\Windows\Forms\Layout\LayoutEngine.cs (1)
14throw new NotSupportedException(string.Format(SR.LayoutEngineUnsupportedType, obj.GetType()));
System\Windows\Forms\NativeWindow.cs (2)
468$"Handle created of type '{cp.ClassName}' with caption '{cp.Caption}' from NativeWindow of type '{GetType().FullName}'"); 503Debug.Fail($"Can't find a default window procedure for message {m} on class {GetType().Name}");
System\Windows\Forms\OLE\DataObjectExtensions.cs (1)
19dataObject.GetType().FullName));
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutStyle.cs (1)
80internal Type GetTypeWithConstructor() => this.GetType();
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutStyleCollection.cs (1)
143throw new ArgumentException(string.Format(SR.OnlyOneControl, style.GetType().Name), nameof(style));
System\Windows\Forms\Screen.cs (1)
345=> $"{GetType().Name}[Bounds={_bounds} WorkingArea={WorkingArea} Primary={_primary} DeviceName={_deviceName}";
System\Windows\Forms\Timer.cs (1)
220Caption = GetType().Name,
System\Windows\Forms\WindowsFormsSynchronizationContext.cs (1)
143if (currentContext is null || currentContext.GetType() == typeof(SynchronizationContext))
System.Windows.Forms.Analyzers.CSharp.Tests (2)
Generators\ApplicationConfigurationGenerator\ApplicationConfigurationGeneratorTests.cs (1)
223string input = await TestFileLoader.GetGeneratorTestCodeAsync($"{GetType().Name}.{testName}.cs").ConfigureAwait(false);
Generators\ApplicationConfigurationGenerator\ApplicationConfigurationInitializeBuilderTests.cs (1)
33string expected = await TestFileLoader.GetGeneratorTestCodeAsync($"{GetType().Name}.{expectedFileName}.cs");
System.Windows.Forms.Design (171)
System\ComponentModel\Design\BinaryEditor.cs (2)
66Debug.Fail($"No conversion from {value?.GetType().FullName ?? "null"} to byte[]"); 91Debug.Fail($"No conversion from byte[] to {value?.GetType().FullName ?? "null"}");
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
85Type type = item.Value.GetType();
System\ComponentModel\Design\CollectionEditor.cs (1)
165text = value.GetType().Name;
System\ComponentModel\Design\ComponentDesigner.ShadowPropertyCollection.cs (1)
62descriptor = TypeDescriptor.GetProperties(_designer.Component.GetType())[propertyName];
System\ComponentModel\Design\DesignerActionList.cs (2)
35MethodInfo[] methods = GetType().GetMethods(BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public); 52PropertyInfo[] properties = GetType().GetProperties(BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public);
System\ComponentModel\Design\DesignerActionMethodItem.cs (1)
116_methodInfo ??= _actionList?.GetType()?.GetMethod(MemberName, BindingFlags.Default | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
System\ComponentModel\Design\DesignerActionPanel.cs (3)
673list.GetType().FullName)); 864if (oldLine.GetType() == newLineInfo.LineType) 880Debug.Assert(newLine.GetType() == newLineInfo.LineType);
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
36public override string FocusId => $"METHOD:{_actionList!.GetType().FullName}.{_methodItem!.MemberName}";
System\ComponentModel\Design\DesignerActionPanel.PropertyLine.cs (2)
23public sealed override string FocusId => $"PROPERTY:{_actionList!.GetType().FullName}.{PropertyItem!.MemberName}"; 50Type valueType = newValue.GetType();
System\ComponentModel\Design\DesignerActionUI.cs (3)
340string.Format(SR.DesignerActionPanel_DefaultPanelTitle, behaviorWithPanelToRegen.RelatedComponent.GetType().Name), 708_designerActionHost.AccessibleName = string.Format(SR.DesignerActionPanel_DefaultPanelTitle, relatedComponent.GetType().Name); 709panel.AccessibleName = string.Format(SR.DesignerActionPanel_DefaultPanelTitle, relatedComponent.GetType().Name);
System\ComponentModel\Design\DesignerHost.cs (8)
194if (_rootComponent is not null && string.Equals(component.GetType().FullName, _rootComponentClassName, StringComparison.OrdinalIgnoreCase)) 198component.GetType().FullName, 250throw new InvalidOperationException(string.Format(SR.DesignerHostNoTopLevelDesigner, component.GetType().FullName)) 398if (string.Equals(reflectType.FullName, component.GetType().FullName, StringComparison.Ordinal)) 400reflectType = component.GetType(); 702helpService.RemoveContextAttribute("Keyword", $"Designer_{designer.GetType().FullName}"); 998string name = component.Site?.Name ?? component.GetType().Name; 1103helpService.AddContextAttribute("Keyword", $"Designer_{rootDesigner.GetType().FullName}", HelpKeywordType.F1Keyword);
System\ComponentModel\Design\InheritanceService.cs (1)
55AddInheritedComponents(component.GetType(), component, container);
System\ComponentModel\Design\MenuCommandService.cs (1)
212_verbSourceType = selectedComponent.GetType();
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (2)
59Debug.Fail($"No case for {data.GetType().Name}"); 510if (manager.TryGetSerializer(data._value.GetType(), out CodeDomSerializer? serializer))
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (1)
176Assembly a = obj.GetType().Assembly;
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (1)
798Debug.Assert(_rootSerializer is not null || _typeSerializer is not null, $"What are we saving right now? Base component has no serializer: {LoaderHost.RootComponent.GetType().FullName}");
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifiersInheritedExtenderProvider.cs (1)
79Type baseType = baseComponent.GetType();
System\ComponentModel\Design\Serialization\CodeDomSerializer.cs (2)
88throw new ArgumentException(string.Format(SR.SerializerBadElementTypes, codeObject.GetType().Name, supportedTypes)); 254throw new NotSupportedException(string.Format(SR.SerializerMemberTypeNotSerializable, member.GetType().FullName));
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (22)
112Type type = instance.GetType(); 131Error(manager, string.Format(SR.TypeNotFoundInTargetFramework, instance.GetType().FullName), SR.SerializerUndeclaredName); 507Error(manager, string.Format(SR.SerializerNoSuchEvent, targetObject.GetType().FullName, statement.Event.EventName), SR.SerializerNoSuchEvent); 574if (fieldType != rhs.GetType()) 600Error(manager, string.Format(SR.SerializerNoSuchField, lhs.GetType().FullName, fieldReferenceEx.FieldName), SR.SerializerNoSuchField); 743mi = target.GetType().GetMethod(methodRef.MethodName, paramTypes)!; 994Debug.Assert(o is IConvertible, $"Array size expression could not be resolved to IConvertible: {(o.GetType().Name)}"); 1165Debug.Fail($"Unrecognized expression type: {result.GetType().Name}"); 1242Error(manager, string.Format(SR.SerializerNoSuchEvent, targetObject.GetType().FullName, eventName), SR.SerializerNoSuchEvent); 1409result = Enum.ToObject(left.GetType(), result); 1557if (rhs is IConvertible ic && p.PropertyType != rhs.GetType()) 1628Error(manager, string.Format(SR.SerializerNoSuchProperty, lhs.GetType().FullName, propertyReferenceEx.PropertyName), SR.SerializerNoSuchProperty); 1757AttributeCollection typeAttributes = GetAttributesFromTypeHelper(manager, value.GetType()); 1827Type? t = value?.GetType(); 1981if (arg is not null && !parameters[i].ParameterType.IsAssignableFrom(arg.GetType())) 2025Debug.Fail($"Unrecognized reflection type in instance descriptor: {descriptor.MemberInfo.GetType().Name}"); 2032Type targetType = value.GetType(); 2109MemberCodeDomSerializer? memberSerializer = manager.GetSerializer<MemberCodeDomSerializer>(descriptor.GetType()); 2255MemberCodeDomSerializer? memberSerializer = manager.GetSerializer<MemberCodeDomSerializer>(propertyToSerialize.GetType()); 2411valueName = manager.GetName(value) ?? value.GetType().Name; 2420manager.ReportError(string.Format(SR.SerializerNoSerializerForComponent, value is null ? "(null)" : value.GetType().FullName)); 2539if (value is null || value.GetType().IsSerializable)
System\ComponentModel\Design\Serialization\CollectionCodeDomSerializer.cs (8)
43Debug.Fail($"Collection of type {modified.GetType().FullName} doesn't return an enumerator"); 167Type collectionType = context?.ExpressionType ?? collection.GetType(); 219Debug.Fail($"Collection serializer invoked for non-collection: {(value is null ? "(null)" : value.GetType().Name)}"); 373if (!serialized && originalCollection.GetType().IsSerializable) 442if (o is not null && o.GetType() != elementType) 534if (o is not null && !elementType.IsAssignableFrom(o.GetType()) && o.GetType().IsPrimitive) 613if (o is not null && !elementType.IsAssignableFrom(o.GetType()))
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (1)
70if (manager.TryGetSerializer(property.GetType(), out MemberCodeDomSerializer? memberSerializer) &&
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (4)
240if (instance is not null && ValidateRecycledTypes && instance.GetType() != type) 299types[index] = argArray[index]?.GetType(); 390: string.Join(", ", argArray.Select(o => o?.GetType().Name ?? "null")); 435if (_serializers.TryGetValue(objectType, out serializer) && !serializerType.IsAssignableFrom(serializer.GetType()))
System\ComponentModel\Design\Serialization\EnumCodeDomSerializer.cs (3)
51CodeTypeReferenceExpression enumType = new(enumValue.GetType()); 60TypeConverter enumConverter = new EnumConverter(enumValue.GetType()); 82expression = new CodeCastExpression(enumValue.GetType(), expression);
System\ComponentModel\Design\Serialization\PrimitiveCodeDomSerializer.cs (1)
29_ => new CodeCastExpression(new CodeTypeReference(value.GetType()), new CodePrimitiveExpression(value)),
System\ComponentModel\Design\Serialization\PropertyMemberCodeDomSerializer.cs (3)
60if (propertyValue is not null and not Type && (!propertyValue.GetType().IsValueType)) 139name ??= value.GetType().FullName; 143else if (manager.TryGetSerializer(propertyValue.GetType(), out CodeDomSerializer? serializer))
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.cs (2)
112throw new ArgumentException(string.Format(SR.SerializerBadElementTypes, codeObject.GetType().Name, supportedTypes)); 178Type castTo = value.GetType();
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.SerializationResourceManager.cs (4)
519if (value is not null && (!value.GetType().IsSerializable)) 521Debug.Fail($"Cannot save a non-serializable value into resources. Add serializable to {(value is null ? "(null)" : value.GetType().Name)}"); 604if (value is not null && (!value.GetType().IsSerializable)) 606Debug.Fail($"Cannot save a non-serializable value into resources. Add serializable to {(value is null ? "(null)" : value.GetType().Name)}");
System\ComponentModel\Design\Serialization\TypeCodeDomSerializer.cs (2)
265typeName = comp.GetType().FullName; 429docType.BaseTypes.Add(root.GetType());
System\ComponentModel\Design\UndoEngine.cs (1)
274componentName = obj is null ? "(null)" : obj.GetType().Name;
System\Drawing\Design\ImageEditor.cs (3)
82Type myClass = GetType(); 91&& editor.GetType() is Type editorClass 144if (editor is not null && editor.GetType() != typeof(ImageEditor))
System\Drawing\Design\ToolboxItem.cs (2)
376if (obj.GetType() != GetType())
System\Resources\Tools\StronglyTypedResourceBuilder.cs (1)
186Type type = (entry.Value is null) ? typeof(object) : entry.Value.GetType();
System\Windows\Forms\Design\BaseContextMenuStrip.cs (2)
284_itemType = c.GetType(); 304_image ??= ToolboxBitmapAttribute.GetImageFromResource(_comp!.GetType(), imageName: null, large: false);
System\Windows\Forms\Design\Behavior\DesignerActionBehavior.cs (1)
64dap.UpdateTasks(lists, [], string.Format(SR.DesignerActionPanel_DefaultPanelTitle, relatedComponent.GetType().Name), null);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
368name = _dragComponents[0].dragComponent.GetType().Name;
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (1)
242name = _resizeComponents[0].resizeControl.GetType().Name;
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionBehavior.cs (1)
200name = control.GetType().Name;
System\Windows\Forms\Design\CommandSet.cs (8)
2630if (lastComp is null || curComp.GetType() != lastComp.GetType()) 2669if (lastComp is null || curComp.GetType() != lastComp.GetType()) 2737if (lastComp is null || lastComp.GetType() != curComp.GetType()) 2768if (lastComp.GetType() != curComp.GetType())
System\Windows\Forms\Design\ComponentTray.cs (4)
958PropertyDescriptor loc = TypeDescriptor.GetProperties(receiver.GetType())["Location"]; 1544PropertyDescriptor loc = TypeDescriptor.GetProperties(receiver.GetType())["Location"]; 1941ds?.SetValue(GetType(), this); 1946name ??= component.GetType().Name;
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (4)
255string? componentTypeName = multiTargetHelper is null ? component.GetType().AssemblyQualifiedName : multiTargetHelper.GetAssemblyQualifiedName(component.GetType()); 275SerializeResourceInvariant(manager, $">>{name}.Type", multiTargetHelper is null ? control.GetType().AssemblyQualifiedName : multiTargetHelper.GetAssemblyQualifiedName(control.GetType()));
System\Windows\Forms\Design\ControlDesigner.cs (2)
930PropertyDescriptorCollection props = TypeDescriptor.GetProperties(component.GetType()); 2497typeName = owner.GetType().FullName;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (7)
339Type srcType = srcColumn.GetType(); 340Type destType = destColumn.GetType(); 420if (srcNullValue is not null && destNullValue is not null && srcNullValue.GetType() == destNullValue.GetType()) 877ComponentDesigner columnDesigner = DataGridViewAddColumnDialog.GetComponentDesignerForType(tr, _columnsPrivateCopy[i].GetType())!; 1362return item.DataGridViewColumn.GetType().Name; 1373if (item?.DataGridViewColumn.GetType() != type)
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.cs (1)
36_columnTypePicker.Start(windowsFormsEditorService, discoveryService!, item.DataGridViewColumn.GetType());
System\Windows\Forms\Design\DesignBindingPicker.cs (4)
1267bindingSourceName = ToolStripDesigner.NameFromText(bindingSourceName, bs.GetType(), _serviceProvider); 1271bindingSourceName += bs.GetType().Name; 1381return dataSource.GetType().Name; 1430if (dsType is not null && dsType.Equals(comp.GetType()))
System\Windows\Forms\Design\DesignerFrame.cs (3)
420Debug.Assert(_overlayList.IndexOf(control) == -1, $"Duplicate overlay in overlay service: {control.GetType().FullName}"); 438Debug.Assert(_overlayList.IndexOf(control) != -1, $"Control is not in overlay service: {control.GetType().FullName}"); 449Debug.Assert(_overlayList.IndexOf(control) == -1, $"Duplicate overlay in overlay service: {control.GetType().FullName}");
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (7)
81object? tlbRef = references.GetType().InvokeMember( 91object? axRef = references.GetType().InvokeMember( 162string? path = (string?)reference.GetType().InvokeMember("Path", BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance, null, reference, null, CultureInfo.InvariantCulture); 228string? name = ext.GetType().InvokeMember("Name", BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance, null, ext, null, CultureInfo.InvariantCulture)!.ToString(); 230object? project = ext.GetType().InvokeMember("ContainingProject", BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance, null, ext, null, CultureInfo.InvariantCulture); 233object? vsproject = project.GetType().InvokeMember("Object", BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance, null, project, null, CultureInfo.InvariantCulture); 236object? references = vsproject.GetType().InvokeMember("References", BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance, null, vsproject, null, CultureInfo.InvariantCulture);
System\Windows\Forms\Design\DocumentDesigner.cs (1)
664PropertyDescriptor backProp = TypeDescriptor.GetProperties(Component.GetType())["BackColor"];
System\Windows\Forms\Design\EventHandlerService.cs (1)
91_lastHandlerType = handler.GetType();
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
343name = _dragControls[0].GetType().Name;
System\Windows\Forms\Design\FormDocumentDesigner.cs (1)
322PropertyDescriptor windowStateProp = TypeDescriptor.GetProperties(component.GetType())["WindowState"];
System\Windows\Forms\Design\ImageCollectionEditor.cs (1)
56text = value.GetType().Name;
System\Windows\Forms\Design\ImageListImageEditor.cs (2)
47Type myClass = GetType(); 56&& editor.GetType() is Type editorClass
System\Windows\Forms\Design\ListViewItemCollectionEditor.cs (1)
47text = value.GetType().Name;
System\Windows\Forms\Design\ListViewSubItemCollectionEditor.cs (1)
66text = value.GetType().Name;
System\Windows\Forms\Design\MaskDescriptor.cs (1)
152return $"{GetType()}<Name={Name ?? "null"}, Mask={Mask ?? "null"}, ValidatingType={(ValidatingType is not null ? ValidatingType.ToString() : "null")}";
System\Windows\Forms\Design\NewItemsContextMenuStrip.cs (2)
46if (item is ItemTypeToolStripMenuItem toolItem && _currentItem is not null && toolItem.ItemType == _currentItem.GetType()) 58if (item is ItemTypeToolStripMenuItem toolItem && _currentItem is not null && toolItem.ItemType == _currentItem.GetType())
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (2)
47Debug.Assert(_components[i] is IComponent, $"Item {_components[i].GetType().Name} is not an IComponent"); 307SetData(data.GetType(), data);
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
2356string error = string.Format(SR.DesignerCantParentType, component.GetType().Name, Component.GetType().Name);
System\Windows\Forms\Design\SelectionUIService.cs (2)
273name = objects[0].GetType().Name; 297name = objects[0].GetType().Name;
System\Windows\Forms\Design\SplitContainerDesigner.cs (1)
232Debug.Assert(_splitContainer is not null, $"Component must be a non-null SplitContainer, it is a: {component.GetType().FullName}");
System\Windows\Forms\Design\TabControlDesigner.cs (1)
210Debug.Assert(control is not null, "Component must be a tab control, it is a: " + component.GetType().FullName);
System\Windows\Forms\Design\TableLayoutControlCollectionCodeDomSerializer.cs (1)
66if (serializedObj is not null && !typeof(Control).IsAssignableFrom(o.GetType()))
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
1401AttributeCollection attribs = TypeDescriptor.GetAttributes(Component.GetType());
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (2)
677itemType = item.GetType(); 887string className = "&" + selectedItem.GetType().Name;
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (1)
343Type toolType = component.GetType();
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
1888name = dragComponents[0].GetType().Name;
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (2)
378if (item is ItemTypeToolStripMenuItem toolItem && currentItem is not null && toolItem.ItemType == currentItem.GetType()) 411if (item is ItemTypeToolStripMenuItem toolItem && currentItem is not null && toolItem.ItemType == currentItem.GetType())
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (1)
396_menuItem.Text = (_dropDown is not null) ? _dropDown.GetType().Name : _menuItem.Name;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
663name = dragComponents[0].GetType().Name;
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (1)
302if (t != _currentItem.GetType())
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
2699name = dragComponents[0].GetType().Name;
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (1)
305Type toolType = component.GetType();
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
776designer.CommitEdit(_designer.Component.GetType(), text, commit, enterKeyPressed, tabKeyPressed);
System.Windows.Forms.Design.Tests (81)
EnsureEditorsTests.cs (2)
76Assert.Equal(expectedEditorType, editor.GetType()); 161Assert.Equal(expectedEditorType, editor.GetType());
System\ComponentModel\Design\ArrayEditorTests.cs (1)
151Assert.IsType(expected.GetType(), items);
System\ComponentModel\Design\CollectionEditorTests.cs (1)
775Assert.IsType(expected.GetType(), items);
System\ComponentModel\Design\DesignerHostTests.cs (2)
1668host.Container.Add(component, component.GetType().FullName); 1669Assert.Equal(component.GetType().FullName, host.RootComponentClassName);
System\ComponentModel\Design\DesignSurfaceTests.cs (2)
267Assert.Same(container, container.GetService(container.GetType())); 1533Assert.Same(surface.ServiceContainer, surface.GetService(surface.ServiceContainer.GetType()));
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (50)
139SerializationInfo info = new(store.GetType(), new FormatterConverter()); 242SerializationInfo info = new(store.GetType(), new FormatterConverter()); 344SerializationInfo info = new(store.GetType(), new FormatterConverter()); 389SerializationInfo info = new(store.GetType(), new FormatterConverter()); 440SerializationInfo info = new(store.GetType(), new FormatterConverter()); 486SerializationInfo info = new(store.GetType(), new FormatterConverter()); 530SerializationInfo info = new(store.GetType(), new FormatterConverter()); 579SerializationInfo info = new(store.GetType(), new FormatterConverter()); 649SerializationInfo info = new(store.GetType(), new FormatterConverter()); 668SerializationInfo info = new(store.GetType(), new FormatterConverter()); 721SerializationInfo info = new(store.GetType(), new FormatterConverter()); 732info = new SerializationInfo(store.GetType(), new FormatterConverter()); 758SerializationInfo info = new(store.GetType(), new FormatterConverter()); 771info = new SerializationInfo(store.GetType(), new FormatterConverter()); 806SerializationInfo info = new(store.GetType(), new FormatterConverter()); 820info = new SerializationInfo(store.GetType(), new FormatterConverter()); 866SerializationInfo info = new(store.GetType(), new FormatterConverter()); 879info = new SerializationInfo(store.GetType(), new FormatterConverter()); 929SerializationInfo info = new(store.GetType(), new FormatterConverter()); 940info = new SerializationInfo(store.GetType(), new FormatterConverter()); 966SerializationInfo info = new(store.GetType(), new FormatterConverter()); 979info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1014SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1028info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1074SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1087info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1139SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1150info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1161info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1189SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1202info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1215info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1252SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1266info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1280info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1328SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1341info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1354info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1418SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1429info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1440info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1468SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1481info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1494info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1531SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1545info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1559info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1607SerializationInfo info = new(store.GetType(), new FormatterConverter()); 1620info = new SerializationInfo(store.GetType(), new FormatterConverter()); 1633info = new SerializationInfo(store.GetType(), new FormatterConverter());
System\ComponentModel\Design\Serialization\DesignerSerializationManagerTests.cs (12)
422.Setup(p => p.GetSerializer(manager, null, objectType, mockDesignerSerializationProvider.Object.GetType())) 426Assert.Same(expected, iManager.GetSerializer(objectType, mockDesignerSerializationProvider.Object.GetType())); 427mockDesignerSerializationProvider.Verify(p => p.GetSerializer(manager, null, objectType, mockDesignerSerializationProvider.Object.GetType()), Times.Once()); 430Assert.Same(expected, iManager.GetSerializer(objectType, mockDesignerSerializationProvider.Object.GetType())); 431mockDesignerSerializationProvider.Verify(p => p.GetSerializer(manager, null, objectType, mockDesignerSerializationProvider.Object.GetType()), Times.Exactly(2)); 1844.Setup(p => p.GetSerializer(manager, null, typeof(int), mockDesignerSerializationProvider.Object.GetType())) 1848Assert.Same(serializer, iManager.GetSerializer(typeof(int), mockDesignerSerializationProvider.Object.GetType())); 1849mockDesignerSerializationProvider.Verify(p => p.GetSerializer(manager, null, typeof(int), mockDesignerSerializationProvider.Object.GetType()), Times.Once()); 1852Assert.Null(iManager.GetSerializer(typeof(int), mockDesignerSerializationProvider.Object.GetType())); 1853mockDesignerSerializationProvider.Verify(p => p.GetSerializer(manager, null, typeof(int), mockDesignerSerializationProvider.Object.GetType()), Times.Once()); 1857Assert.Null(iManager.GetSerializer(typeof(int), mockDesignerSerializationProvider.Object.GetType())); 1858mockDesignerSerializationProvider.Verify(p => p.GetSerializer(manager, null, typeof(int), mockDesignerSerializationProvider.Object.GetType()), Times.Once());
System\ComponentModel\Design\SiteNestedContainerTests.cs (2)
585container.Add(component, component.GetType().FullName); 586Assert.Equal(component.GetType().FullName, host.RootComponentClassName);
System\Resources\Tools\StronglyTypedResourceBuilderTests.cs (2)
608Assert.Equal(typeof(TypeConverter), converter.GetType()); 611Assert.Equal(typeof(AxHost.StateConverter), converter.GetType());
System\Windows\Forms\Design\AnchorEditorTests.cs (1)
90var item = (Control)anchorUI.GetType()
System\Windows\Forms\Design\ContentAlignmentEditorTests.cs (2)
27Type type = editor.GetType() 30var item = (Control)contentUI.GetType()
System\Windows\Forms\Design\ListBoxDesignerTests.cs (1)
126actionList[0]!.GetType().Name.Should().Be(nameof(ListControlUnboundActionList));
System\Windows\Forms\Design\ListViewGroupCollectionEditorTests.cs (1)
57result?.GetType().Should().Be(typeof(ListViewGroup));
System\Windows\Forms\Design\MaskDesignerDialogTests.cs (2)
85maskDescriptors.Should().ContainSingle(descriptor => descriptor.GetType() == descriptorType); 89maskDescriptors.Should().NotContain(descriptor => descriptor.GetType() == descriptorType);
System.Windows.Forms.Primitives (3)
System\Windows\Forms\Automation\UiaTextRange.cs (1)
702if (value?.GetType() is { } type && type.IsValueType && !type.IsPrimitive && !type.IsEnum)
Windows\Win32\PInvoke.CreateWindowEx.cs (1)
68Marshal.DestroyStructure(native, lpParam.GetType());
Windows\Win32\System\Ole\ClassPropertyDispatchAdapter.cs (1)
39_type = instance.GetType();
System.Windows.Forms.Primitives.TestUtilities (2)
Metafiles\Validators\EmfValidator.cs (2)
43$"\nValidator index {currentIndex}: {currentValidator!.GetType().Name} failed\n\n{emf.RecordsToString()}", 60$"{currentValidator.GetType().Name} did not receive expected records\n\n{emf.RecordsToString()}");
System.Windows.Forms.Tests (55)
misc\CollectionHelperTests.cs (4)
81Assert.Equal(typeof(KeyValuePair<string, string>), firstTargetItem.GetType()); 86Assert.Equal(typeof(KeyValuePair<string, string>), secondTargetItem.GetType()); 104Assert.Equal(typeof(DictionaryEntry), firstTargetItem.GetType()); 109Assert.Equal(typeof(DictionaryEntry), secondTargetItem.GetType());
System\Resources\ResXResourceReaderTests.cs (1)
33Assert.Equal(typeof(AxHost.State), value.GetType());
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (4)
1688control.GetType().GetProperty(nameof(Label.UseMnemonic)).SetValue(control, false); 1709control.GetType().GetProperty(nameof(Label.UseMnemonic)).SetValue(control, true); 1731control.GetType().GetProperty(nameof(Label.UseMnemonic)).SetValue(control, false); 1739control.GetType().GetProperty(nameof(Label.UseMnemonic)).SetValue(control, true);
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (1)
265Type type = dataGridView.AccessibilityObject.GetType();
System\Windows\Forms\AccessibleObjects\PropertyGridView.PropertyGridViewAccessibleObjectTests.cs (1)
207Type type = accessibleObject.GetType();
System\Windows\Forms\AccessibleObjects\ToolStripTextBox.ToolStripTextBoxControlAccessibleObjectTests.cs (2)
19Type type = toolStripTextBox.GetType().GetNestedType("ToolStripTextBoxControlAccessibleObject", BindingFlags.NonPublic); 30Type type = toolStripTextBox.GetType().GetNestedType("ToolStripTextBoxControlAccessibleObject", BindingFlags.NonPublic);
System\Windows\Forms\AxHost.PropertyBagStreamTests.cs (2)
72string name = value.GetType().FullName!; 75HRESULT hr = bag.Write(value.GetType().FullName!, variant); // CodeQL[SM02229] : Testing legacy feature. This is a safe use of VARIANT because the data is trusted and the types are controlled and validated.
System\Windows\Forms\BindingContextTests.cs (2)
976MethodInfo m = oldManager.Bindings.GetType().GetMethod("Add", BindingFlags.NonPublic | BindingFlags.Instance); 1004MethodInfo m = oldManager.Bindings.GetType().GetMethod("Add", BindingFlags.NonPublic | BindingFlags.Instance);
System\Windows\Forms\ClipboardTests.cs (11)
183dataObject.GetData(data.GetType()).Should().Be(data); 184Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); 196actual.GetData(data.GetType()).Should().Be(data); 197Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); 210dataObject.GetData(data.GetType()).Should().Be(data); 211Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); 225actual.GetData(data.GetType()).Should().Be(data); 226Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); 239dataObject.GetData(data.GetType()).Should().Be(data); 240Clipboard.ContainsData(data.GetType().FullName).Should().BeTrue(); 1057_formatToTypeName.Add(format, data!.GetType().AssemblyQualifiedName!);
System\Windows\Forms\ColumnHeaderConverterTests.cs (1)
100Assert.Equal(value.GetType().GetConstructor(parameterTypes), descriptor.MemberInfo);
System\Windows\Forms\DataGridViewButtonColumnTests.cs (2)
59_column.GetType().GetProperty("CellTemplate")!.SetValue(_column, null); 102_column.GetType().GetProperty("CellTemplate")!.SetValue(_column, null);
System\Windows\Forms\DataGridViewColumnTests.cs (3)
69Assert.Equal(cellTemplate?.GetType(), column.CellType); 511Assert.Same(value?.GetType(), column.CellType); 516Assert.Same(value?.GetType(), column.CellType);
System\Windows\Forms\DataObjectTests.cs (5)
1185string format = data1.GetType().FullName; 1205dataObject.GetData(data2.GetType().FullName, autoConvert: false).Should().Be(data2); 1206dataObject.GetData(data2.GetType().FullName, autoConvert: true).Should().Be(data2); 1210dataObject.GetDataPresent(data2.GetType().FullName, autoConvert: false).Should().BeTrue(); 1211dataObject.GetDataPresent(data2.GetType().FullName, autoConvert: true).Should().BeTrue();
System\Windows\Forms\HtmlDocumentTests.cs (1)
566Assert.True(domDocument.GetType().IsCOMObject);
System\Windows\Forms\HtmlElementTests.cs (1)
170Assert.True(domElement.GetType().IsCOMObject);
System\Windows\Forms\HtmlWindowTests.cs (1)
61domWindow.GetType().IsCOMObject.Should().BeTrue();
System\Windows\Forms\ListBindingHelperTests.cs (1)
204.Setup(p => p.GetTypeDescriptor(instance.GetType(), instance))
System\Windows\Forms\PropertyGridInternal\AccessibleObjects\PropertyDescriptorGridEntry.PropertyDescriptorGridEntryAccessibleObjectTests.cs (1)
33Assert.Equal(typeof(PropertyGridView.DropDownHolder.DropDownHolderAccessibleObject), firstChild.GetType());
System\Windows\Forms\PropertyGridInternal\AccessibleObjects\PropertyGridView.GridViewTextBox.GridViewTextBoxAccessibleObjectTests.cs (3)
44Assert.Equal("GridViewTextBoxAccessibleObject", editFieldAccessibleObject.GetType().Name); 69Assert.Equal("GridViewTextBoxAccessibleObject", editFieldAccessibleObject.GetType().Name); 79Assert.Equal("DropDownHolderAccessibleObject", dropDownHolderAccessibleObject.GetType().Name);
System\Windows\Forms\PropertyGridInternal\PropertyGridView.DropDownHolderTests.cs (1)
39Assert.Equal("DropDownHolderAccessibleObject", accessibleObject.GetType().Name);
System\Windows\Forms\PropertyGridInternal\PropertyGridView.GridViewListBoxTests.cs (1)
30Type gridViewListBoxAccessibleObjectType = gridViewListBoxAccessibleObject.GetType();
System\Windows\Forms\PropertyGridTests.cs (1)
4391Reflection.MemberInfo[] properties = component.GetType().GetMembers();
System\Windows\Forms\SpecialFolderEnumConverterTests.cs (2)
92TypeConverter converter = (TypeConverter)Activator.CreateInstance(descriptor.Converter.GetType(), new Type[] { typeof(CustomEnum) }); 99return (TypeConverter)Activator.CreateInstance(descriptor.Converter.GetType(), new Type[] { typeof(Environment.SpecialFolder) });
System\Windows\Forms\ToolStripComboBoxTests.cs (1)
377_toolStripComboBox.ToString().Should().Be($"{_toolStripComboBox.GetType().FullName}, Items.Count: 2");
ToolStripContainerTests.cs (2)
48PropertyInfo propertyInfo = _toolStripContainer.GetType().GetProperty(propertyName); 220PropertyInfo propertyInfo = _toolStripContainer.GetType().GetProperty(propertyName);
System.Windows.Forms.TestUtilities (1)
PropertyGridInternal\SubPropertyGrid.cs (1)
32string categoryName = SelectedObject!.GetType().GetProperty(propertyName)!
System.Windows.Forms.UI.IntegrationTests (3)
DataGridViewTests.cs (1)
67object? actual = toolTip.GetType().GetProperty("Activated")?.GetValue(toolTip);
Infra\ControlTestBase.cs (1)
49var type = testOutputHelper.GetType();
Infra\SendInput.cs (1)
64throw new ArgumentException($"Unexpected type encountered: {key.GetType()}", nameof(keys));
System.Xaml (55)
System\Windows\Markup\ArrayExtension.cs (1)
46Type = elements.GetType().GetElementType();
System\Windows\Markup\StaticExtension.cs (1)
84throw new ArgumentException(SR.Format(SR.MarkupExtensionNoContext, GetType().Name, nameof(IXamlTypeResolver)));
System\Windows\Markup\TypeExtension.cs (1)
71throw new InvalidOperationException(SR.Format(SR.MarkupExtensionNoContext, GetType().Name, nameof(IXamlTypeResolver)));
System\Windows\Markup\ValueSerializer.cs (5)
136if (converter.GetType() == typeof(DateTimeConverter2)) 244text = value.GetType().FullName; 247return new NotSupportedException(SR.Format(SR.ConvertToException, base.GetType().Name, text, destinationType.FullName)); 262text = value.GetType().FullName; 265return new NotSupportedException(SR.Format(SR.ConvertFromException, base.GetType().Name, text));
System\Xaml\InfosetObjects\XamlObjectWriter.cs (12)
304_context.CurrentInstance = inst ?? throw _context.WithLineInfo(new XamlObjectWriterException(SR.Format(SR.GetObjectNull, parentInstance.GetType(), parentProperty.Name))); 372XamlType rootType = GetXamlType(_rootObjectInstance.GetType()); 776XamlType valueXamlType = GetXamlType(value.GetType()); 788XamlType valueXamlType = GetXamlType(value.GetType()); 1088SchemaContext.GetType(), clrType)); 1198XamlType instType = GetXamlType(inst.GetType()); 1745ctx.CurrentType = GetXamlType(value.GetType()); 1809if (value is XAML3.MarkupExtension me && !Logic_WillParentCollectionAdd(ctx, value.GetType(), true)) 1823currentType = value is null ? collectionType.ItemType : GetXamlType(value.GetType()); 2237Type rootInstanceType = (curInstance is not null) ? curInstance.GetType() : ctx.CurrentType.UnderlyingType; 2268childThatHasUnresolvedChildren.GetType(), property, namesString))); 2637pendingAdd.ItemType = (item is not null) ? GetXamlType(item.GetType()) : null;
System\Xaml\Runtime\ClrObjectRuntime.cs (6)
190throw CreateException(SR.Format(SR.CanConvertFromFailed, typeof(T), converter.GetType()), ex); 207throw CreateException(SR.Format(SR.CanConvertToFailed, type, converter.GetType()), ex); 395if (genericIEnumerator.IsAssignableFrom(enumerator.GetType())) 521throw CreateException(SR.Format(SR.ProvideValue, me.GetType()), e); 662if (_ignoreCanConvert && value.GetType() == typeof(string)) 668if (typeConverter.CanConvertFrom(value.GetType()))
System\Xaml\Runtime\DynamicMethodRuntime.cs (1)
184Type targetType = target.GetType();
System\Xaml\Runtime\PartialTrustTolerantRuntime.cs (3)
438return xamlType.Invoker.GetType() == typeof(XamlTypeInvoker); 444return xamlMember.Invoker.GetType() == typeof(XamlMemberInvoker); 451return converter.GetType() == typeof(XamlValueConverter<TConverterBase>);
System\Xaml\Schema\BuiltInValueConverter.cs (2)
218s_Uri = new BuiltInValueConverter<TypeConverter>(stdConverter.GetType(), () => TypeDescriptor.GetConverter(typeof(Uri))); 236s_StringSerializer = new BuiltInValueConverter<ValueSerializer>(stringSerializer.GetType(), () => stringSerializer);
System\Xaml\Schema\XamlTypeInvoker.cs (2)
75itemType = _xamlType.SchemaContext.GetXamlType(item.GetType()); 109itemType = _xamlType.SchemaContext.GetXamlType(item.GetType());
System\Xaml\XamlObjectReader.cs (18)
51var context = new SerializerContext(schemaContext, this.settings) { RootType = instance?.GetType() }; 442actualKeyType = context.GetXamlType(entry.Key.GetType()); 476XamlType typeOfValue = context.GetXamlType(entry.Value.GetType()); 1292else if (!parameterInfo.ParameterType.IsAssignableFrom(argument.GetType())) 1294throw new XamlObjectReaderException(SR.Format(SR.ObjectReaderInstanceDescriptorIncompatibleArgumentTypes, argument.GetType(), parameterInfo.ParameterType)); 1432var valueType = value.GetType(); 1588AddFactoryMethodAndValidateArguments(value.GetType(), member, arguments, context, out methodParams); 1701throw new XamlObjectReaderException(SR.Format(SR.ObjectReaderNoDefaultConstructor, value.GetType())); 1704throw new XamlObjectReaderException(SR.Format(SR.ObjectReaderNoMatchingConstructor, value.GetType())); 1771var xamlType = context.LocalAssemblyAwareGetXamlType(Object.GetType()); 1809var type = context.LocalAssemblyAwareGetXamlType(value.GetType()); 1935XamlType valueType = context.GetXamlType(value.GetType()); 2024XamlType xamlType = context.LocalAssemblyAwareGetXamlType(value.GetType()); 2066var xamlType = context.LocalAssemblyAwareGetXamlType(originalValue.GetType()); 2518string ns = GetXamlType(obj.GetType()).PreferredXamlNamespace; 2643schemaContext.GetType(), clrType)); 2704XamlType valueXamlType = context.GetXamlType(value.GetType()); 2746XamlType type = GetXamlType(objectToName.GetType());
System\Xaml\XamlSchemaContext.cs (2)
1009typeof(object).Assembly.GetType().IsAssignableFrom(assembly.GetType());
System\Xaml\XamlType.cs (1)
1673Debug.Assert(GetType() != typeof(XamlType), "Default GetAllMembers logic should have already captured all writeable properties");
System.Xaml.Tests (9)
System\Xaml\XamlNodeListTests.cs (3)
578MethodInfo dispose = writer.GetType().GetMethod("Dispose", BindingFlags.Instance | BindingFlags.NonPublic)!; 593FieldInfo addDelegateField = writer.GetType().GetField("_addDelegate", BindingFlags.Instance | BindingFlags.NonPublic)!; 616FieldInfo addLineInfoDelegateField = writer.GetType().GetField("_addLineInfoDelegate", BindingFlags.Instance | BindingFlags.NonPublic)!;
System\Xaml\XamlNodeQueueTests.cs (3)
490MethodInfo dispose = writer.GetType().GetMethod("Dispose", BindingFlags.Instance | BindingFlags.NonPublic)!; 505FieldInfo addDelegateField = writer.GetType().GetField("_addDelegate", BindingFlags.Instance | BindingFlags.NonPublic)!; 528FieldInfo addLineInfoDelegateField = writer.GetType().GetField("_addLineInfoDelegate", BindingFlags.Instance | BindingFlags.NonPublic)!;
System\Xaml\XamlTypeTests.cs (3)
940MethodInfo underlyingGetter = member.GetType().GetMethod("LookupUnderlyingGetter", BindingFlags.Instance | BindingFlags.NonPublic)!; 946MethodInfo underlyingSetter = member.GetType().GetMethod("LookupUnderlyingSetter", BindingFlags.Instance | BindingFlags.NonPublic)!; 4631yield return new object?[] { new SubXamlType(typeof(string), new XamlSchemaContext()), new XamlValueConverter<ValueSerializer>(ValueSerializer.GetSerializerFor(typeof(string))!.GetType(), null) };
Templates.Blazor.Tests (1)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
54var assemblyPath = GetType().Assembly;
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
54var assemblyPath = GetType().Assembly;
Templates.Blazor.WebAssembly.Tests (1)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
54var assemblyPath = GetType().Assembly;
Templates.Mvc.Tests (1)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
54var assemblyPath = GetType().Assembly;
Templates.Tests (1)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
54var assemblyPath = GetType().Assembly;
Test.Utilities (7)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
40throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (1)
68throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IUtf8StringOperationWrapper.cs (1)
39throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (1)
55var type = analyzerConfigOptions.GetType();
Text.Analyzers (7)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (1)
212var syntaxTreeOptionsProviderTryGetDiagnosticValueMethod = syntaxTreeOptionsProvider?.GetType().GetRuntimeMethods().FirstOrDefault(m => m.Name == "TryGetDiagnosticValue");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
40throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (1)
68throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IUtf8StringOperationWrapper.cs (1)
39throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
40kind => underlyingType.GetTypeInfo().IsAssignableFrom(operation.GetType().GetTypeInfo()));
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerConfigOptionsProviderExtensions.cs (1)
20return analyzerConfigOptionsProvider.GetType().GetField("_treeDict", flags)?.GetValue(analyzerConfigOptionsProvider) is ImmutableDictionary<object, AnalyzerConfigOptions> perTreeOptionsMap
src\RoslynAnalyzers\Utilities\Compiler\Options\SyntaxTreeCategorizedAnalyzerConfigOptions.cs (1)
55var type = analyzerConfigOptions.GetType();
UIAutomationClient (4)
System\Windows\Automation\ItemContainerPattern.cs (1)
138|| (value != null && !expectedType.IsAssignableFrom(value.GetType()))))
System\Windows\Automation\PropertyCondition.cs (1)
136|| (val != null && !expectedType.IsAssignableFrom(val.GetType()))))
System\Windows\Automation\Text\TextRange.cs (2)
183if (value.GetType() != ai.Type) 185throw new ArgumentException(SR.Format(SR.TextAttributeValueWrongType, attribute, ai.Type.Name, value.GetType().Name), nameof(value));
UIAutomationClientSideProviders (119)
MS\Internal\AutomationProxies\CommonXSendMessage.cs (55)
408return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), item.cchTextMax); 415new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), 423return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), item64.cchTextMax); 437return XSend(hwnd, NativeMethods.LVM_SETITEMSTATE, new IntPtr(index), new IntPtr(&item), Marshal.SizeOf(item.GetType())); 443return XSend(hwnd, NativeMethods.LVM_SETITEMSTATE, new IntPtr(index), new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 449return XSend(hwnd, NativeMethods.LVM_SETITEMSTATE, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 465return XSend(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(pItem), Marshal.SizeOf(item.GetType()), XSendMessage.ErrorValue.NoCheck); 472bool result = XSend(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), XSendMessage.ErrorValue.NoCheck); 484bool result = XSend(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), XSendMessage.ErrorValue.NoCheck); 505new IntPtr(group.iGroupID), new IntPtr(&group), Marshal.SizeOf(group.GetType())); 512new IntPtr(group.iGroupID), new IntPtr(&group32), Marshal.SizeOf(group32.GetType())); 519new IntPtr(group.iGroupID), new IntPtr(&group64), Marshal.SizeOf(group64.GetType())); 538new IntPtr(group.iGroupID), new IntPtr(pGroup), Marshal.SizeOf(group.GetType())); 549new IntPtr(group.iGroupID), new IntPtr(&group32), Marshal.SizeOf(group32.GetType())); 560new IntPtr(group.iGroupID), new IntPtr(&group64), Marshal.SizeOf(group64.GetType())); 583new IntPtr(group.iGroupID), new IntPtr(pGroup), Marshal.SizeOf(group.GetType())); 594new IntPtr(group.iGroupID), new IntPtr(&group32), Marshal.SizeOf(group32.GetType())); 605new IntPtr(group.iGroupID), new IntPtr(&group64), Marshal.SizeOf(group64.GetType())); 630return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item.iGroupID), new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszHeader), item.cchHeader); 642return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item32.iGroupID), new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszHeader), item32.cchHeader); 654return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item64.iGroupID), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszHeader), item64.cchHeader); 689return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item.iGroupID), new IntPtr(&item), Marshal.SizeOf(item.GetType()), textAddress, size, true); 707return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item32.iGroupID), new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), textAddress, size, true); 725return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item64.iGroupID), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), textAddress, size, true); 751return XSend(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(pItem), Marshal.SizeOf(item.GetType())); 758bool result = XSend(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 771bool result = XSend(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 792return GetTextWithinStructure(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), item.cchTextMax); 799new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), 807return GetTextWithinStructure(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), item64.cchTextMax); 833return XSend(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(pItem), Marshal.SizeOf(item.GetType())); 840bool result = XSend(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 853bool result = XSend(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 874return GetTextWithinStructure(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), item.cchTextMax); 882Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), item32.cchTextMax, 889return GetTextWithinStructure(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), item64.cchTextMax); 915return XSend(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(pItem), Marshal.SizeOf(item.GetType())); 922bool result = XSend(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 935bool result = XSend(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 956return XSend(hwnd, NativeMethods.TVM_SETITEMW, IntPtr.Zero, new IntPtr(&item), Marshal.SizeOf(item.GetType())); 962return XSend(hwnd, NativeMethods.TVM_SETITEMW, IntPtr.Zero, new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 968return XSend(hwnd, NativeMethods.TVM_SETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 990Marshal.SizeOf(hitTestInfo.GetType()), XSendMessage.ErrorValue.Zero)) 999Marshal.SizeOf(hitTestInfo32.GetType()), XSendMessage.ErrorValue.Zero)) 1008Marshal.SizeOf(hitTestInfo64.GetType()), XSendMessage.ErrorValue.Zero)) 1027return GetTextWithinStructure(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), item.cchTextMax); 1035Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), item32.cchTextMax, 1042return GetTextWithinStructure(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), item64.cchTextMax); 1068return XSend(hwnd, NativeMethods.TB_GETBUTTON, new IntPtr(index), new IntPtr(pItem), Marshal.SizeOf(item.GetType()), ErrorValue.Zero); 1075bool result = XSend(hwnd, NativeMethods.TB_GETBUTTON, new IntPtr(index), new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), ErrorValue.Zero); 1088bool result = XSend(hwnd, NativeMethods.TB_GETBUTTON, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), ErrorValue.Zero); 1126Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), maxTextLength, true); 1134Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), maxTextLength, 1143Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), maxTextLength, true); 1171int cMem = Marshal.SizeOf(rectW32.GetType());
MS\Internal\AutomationProxies\Misc.cs (3)
1078gui.cbSize = Marshal.SizeOf(gui.GetType()); 1178ti.cbSize = Marshal.SizeOf(ti.GetType()); 1194ti.cbSize = Marshal.SizeOf(ti.GetType());
MS\Internal\AutomationProxies\WindowsEditBox.cs (1)
343throw new InvalidOperationException(SR.Format(SR.EditControlsHaveNoChildren, GetType().FullName));
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (5)
37throw new InvalidOperationException(SR.Format(SR.InvalidTextRangeOffset, GetType().FullName)); 1065throw new InvalidOperationException(SR.Format(SR.InvalidTextRangeOffset, GetType().FullName)); 1077throw new InvalidOperationException(SR.Format(SR.InvalidRangeEndpoint, GetType().FullName)); 1111throw new InvalidOperationException(SR.Format(SR.InvalidTextRangeOffset, GetType().FullName)); 1142throw new InvalidOperationException(SR.Format(SR.InvalidTextRangeOffset, GetType().FullName));
MS\Internal\AutomationProxies\WindowsHyperlink.cs (3)
211bGetItemResult = XSendMessage.XSend(_hwnd, NativeMethods.LM_HITTEST, IntPtr.Zero, new IntPtr(&HitTestInfo), Marshal.SizeOf(HitTestInfo.GetType())); 395return XSendMessage.XSend(_hwnd, NativeMethods.LM_SETITEM, IntPtr.Zero, new IntPtr(&linkItem), Marshal.SizeOf(linkItem.GetType())); 492bGetItemResult = XSendMessage.XSend(_hwnd, NativeMethods.LM_HITTEST, IntPtr.Zero, new IntPtr(&HitTestInfo), Marshal.SizeOf(HitTestInfo.GetType()));
MS\Internal\AutomationProxies\WindowsListView.cs (7)
1269if (XSendMessage.XSend(hwnd, NativeMethods.LVM_GETITEMRECT, new IntPtr(item), new IntPtr(location), Marshal.SizeOf(itemRectangle.GetType()))) 1420result = XSendMessage.XSendGetIndex(hwnd, NativeMethods.LVM_SUBITEMHITTEST, IntPtr.Zero, new IntPtr(&hitTestNative), Marshal.SizeOf(hitTestNative.GetType())); 1429result = XSendMessage.XSendGetIndex(hwnd, NativeMethods.LVM_SUBITEMHITTEST, IntPtr.Zero, new IntPtr(&hitTestNative), Marshal.SizeOf(hitTestNative.GetType())); 1493if (XSendMessage.XSend(hwnd, NativeMethods.LVM_GETSUBITEMRECT, new IntPtr(item), new IntPtr(location), Marshal.SizeOf(itemRectangle.GetType()))) 1664scrollBarInfo.cbSize = Marshal.SizeOf(scrollBarInfo.GetType()); 1675si.cbSize = Marshal.SizeOf (si.GetType ()); 1792if (XSendMessage.XSend(hwnd, NativeMethods.LVM_GETITEMPOSITION, new IntPtr(item), new IntPtr(location), Marshal.SizeOf(pt.GetType())))
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (1)
306XSendMessage.XSendGetIndex(_hwnd, NativeMethods.LVM_HITTEST, new IntPtr(-1), new IntPtr(&hitTestNative), Marshal.SizeOf(hitTestNative.GetType()));
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (3)
386while (XSendMessage.XSend (hwnd, NativeMethods.LVM_GETNEXTITEMINDEX, new IntPtr(&ii), flags, Marshal.SizeOf(ii.GetType()))) 703new IntPtr(_groupID), new IntPtr(&rect), Marshal.SizeOf(rect.GetType())); 814sbi.cbSize = Marshal.SizeOf(sbi.GetType());
MS\Internal\AutomationProxies\WindowsListViewGroupSubsetLink.cs (1)
77XSendMessage.XSend(_hwnd, NativeMethods.LVM_GETGROUPRECT, new IntPtr(0), new IntPtr(&rect), Marshal.SizeOf(rect.GetType()));
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
133if (XSendMessage.XSend(_hwnd, NativeMethods.LVM_GETITEMINDEXRECT, new IntPtr(&ii), new IntPtr(&itemRectangle), Marshal.SizeOf(ii.GetType()), Marshal.SizeOf(itemRectangle.GetType())))
MS\Internal\AutomationProxies\WindowsListViewScroll.cs (1)
56si.cbSize = Marshal.SizeOf (si.GetType ());
MS\Internal\AutomationProxies\WindowsMenu.cs (6)
504mbi.cbSize = Marshal.SizeOf(mbi.GetType()); 1886menuItemInfo.cbSize = Marshal.SizeOf(menuItemInfo.GetType()); 1901menuItemInfo.cbSize = Marshal.SizeOf (menuItemInfo.GetType ()); 1945menuItemInfo.cbSize = Marshal.SizeOf(menuItemInfo.GetType()); 2552menuItemInfo.cbSize = Marshal.SizeOf(menuItemInfo.GetType()); 2593int readSize = Marshal.SizeOf(msaaMenuInfo.GetType());
MS\Internal\AutomationProxies\WindowsRebar.cs (3)
206return XSendMessage.XSendGetIndex(_hwnd, NativeMethods.RB_HITTEST, IntPtr.Zero, new IntPtr(&rbHitTestInfo), Marshal.SizeOf(rbHitTestInfo.GetType())); 399if (!XSendMessage.XSend(hwnd, NativeMethods.RB_GETRECT, new IntPtr(item), new IntPtr(&rectW32), Marshal.SizeOf(rectW32.GetType()), XSendMessage.ErrorValue.Zero)) 435if (XSendMessage.XSend(_hwnd, NativeMethods.RB_GETBANDINFOA, new IntPtr(_item), new IntPtr(&rebarBandInfo), Marshal.SizeOf(rebarBandInfo.GetType()), XSendMessage.ErrorValue.Zero))
MS\Internal\AutomationProxies\WindowsRichEdit.cs (1)
260throw new InvalidOperationException(SR.Format(SR.RichEditTextPatternHasNoChildren, GetType().FullName));
MS\Internal\AutomationProxies\WindowsScroll.cs (6)
127sbi.cbSize = Marshal.SizeOf(sbi.GetType()); 143si.cbSize = Marshal.SizeOf (si.GetType ()); 195si.cbSize = Marshal.SizeOf (si.GetType ()); 250si.cbSize = Marshal.SizeOf (si.GetType ()); 291si.cbSize = Marshal.SizeOf(si.GetType ()); 367si.cbSize = Marshal.SizeOf (si.GetType ());
MS\Internal\AutomationProxies\WindowsScrollBar.cs (8)
135sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 431si.cbSize = Marshal.SizeOf (si.GetType ()); 445sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 519sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 572si.cbSize = Marshal.SizeOf (si.GetType ()); 625si.cbSize = Marshal.SizeOf (si.GetType ()); 711sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 726sbi.cbSize = Marshal.SizeOf(sbi.GetType());
MS\Internal\AutomationProxies\WindowsScrollBarBits.cs (3)
205si.cbSize = Marshal.SizeOf (si.GetType ()); 223sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 542si.cbSize = Marshal.SizeOf (si.GetType ());
MS\Internal\AutomationProxies\WindowsSlider.cs (2)
460XSendMessage.XSend(hwnd, NativeMethods.TBM_GETCHANNELRECT, IntPtr.Zero, new IntPtr(&rcChannel), Marshal.SizeOf(rcChannel.GetType()), XSendMessage.ErrorValue.NoCheck); 472XSendMessage.XSend(hwnd, NativeMethods.TBM_GETTHUMBRECT, IntPtr.Zero, new IntPtr(&rcThumb), Marshal.SizeOf(rcThumb.GetType()), XSendMessage.ErrorValue.NoCheck);
MS\Internal\AutomationProxies\WindowsSysHeader.cs (2)
161index = XSendMessage.XSendGetIndex(_hwnd, NativeMethods.HDM_HITTEST, IntPtr.Zero, new IntPtr(&HitTestInfo), Marshal.SizeOf(HitTestInfo.GetType())); 568result = XSendMessage.XSend(_hwnd, NativeMethods.HDM_GETITEMRECT, new IntPtr(index), new IntPtr(&rectW32), Marshal.SizeOf(rectW32.GetType()), XSendMessage.ErrorValue.Zero);
MS\Internal\AutomationProxies\WindowsTab.cs (3)
276index = XSendMessage.XSendGetIndex(_hwnd, NativeMethods.TCM_HITTEST, IntPtr.Zero, new IntPtr(&hti), Marshal.SizeOf(hti.GetType())); 653result = XSendMessage.XSend(hwnd, NativeMethods.TCM_GETITEMRECT, new IntPtr(count - 1), new IntPtr(&rectW32), Marshal.SizeOf(rectW32.GetType()), XSendMessage.ErrorValue.Zero); 1272if (!XSendMessage.XSend(_hwnd, NativeMethods.TCM_GETITEMRECT, new IntPtr(_item), new IntPtr(&rectW32), Marshal.SizeOf(rectW32.GetType()), XSendMessage.ErrorValue.Zero))
MS\Internal\AutomationProxies\WindowsTreeView.cs (3)
555if (!XSendMessage.XSend(hwnd, NativeMethods.TVM_GETITEMRECT, partialDisplay, rectangle, Marshal.SizeOf(rc.GetType()))) 935if (Marshal.SizeOf(_hItem.GetType()) > sizeof(int)) 1592int readSize = Marshal.SizeOf(ent.GetType());
VBCSCompiler (1)
src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (1)
53Logger.Log($"Received request {request.RequestId} of type {request.GetType()}");
VBCSCompiler.UnitTests (1)
NamedPipeTestUtil.cs (1)
41var listeningSocketProperty = sharedServer!.GetType()?.GetProperty("ListeningSocket", BindingFlags.NonPublic | BindingFlags.Instance);
WindowsBase.Tests (17)
System\Security\RightsManagement\ContentUserTests.cs (2)
98if (user?.GetType() == obj?.GetType())
System\Windows\DependencyObjectTests.cs (9)
1016DependencyProperty property = DependencyProperty.Register(nameof(DependencyObjectTests) + MethodBase.GetCurrentMethod()!.Name + customCoercedValue?.GetType().Name, typeof(string), typeof(DependencyObject), typeMetadata); 1185DependencyProperty property = DependencyProperty.Register(nameof(DependencyObjectTests) + MethodBase.GetCurrentMethod()!.Name + invalidValue?.GetType().Name, typeof(int), typeof(DependencyObject), typeMetadata); 1217DependencyProperty property = DependencyProperty.Register(nameof(DependencyObjectTests) + MethodBase.GetCurrentMethod()!.Name + invalidValue?.GetType().Name, typeof(int), typeof(DependencyObject), typeMetadata); 2403DependencyProperty property = DependencyProperty.Register(nameof(DependencyObjectTests) + MethodBase.GetCurrentMethod()!.Name + value?.GetType().Name, typeof(bool), typeof(DependencyObject)); 2414DependencyProperty property = DependencyProperty.Register(nameof(DependencyObjectTests) + MethodBase.GetCurrentMethod()!.Name + value?.GetType().Name, typeof(bool?), typeof(DependencyObject)); 2430DependencyProperty property = DependencyProperty.Register(nameof(DependencyObjectTests) + MethodBase.GetCurrentMethod()!.Name + value?.GetType().Name, typeof(string), typeof(DependencyObject)); 2827DependencyPropertyKey key = DependencyProperty.RegisterReadOnly(nameof(DependencyObjectTests) + MethodBase.GetCurrentMethod()!.Name + value?.GetType().Name, typeof(bool), typeof(DependencyObject), new PropertyMetadata()); 2838DependencyPropertyKey key = DependencyProperty.RegisterReadOnly(nameof(DependencyObjectTests) + MethodBase.GetCurrentMethod()!.Name + value?.GetType().Name, typeof(bool?), typeof(DependencyObject), new PropertyMetadata()); 2854DependencyPropertyKey key = DependencyProperty.RegisterReadOnly(nameof(DependencyObjectTests) + MethodBase.GetCurrentMethod()!.Name + value?.GetType().Name, typeof(string), typeof(DependencyObject), new PropertyMetadata());
System\Windows\FreezableTests.cs (6)
3419DependencyProperty property = DependencyProperty.Register(nameof(FreezableTests) + MethodBase.GetCurrentMethod()!.Name + customCoercedValue?.GetType().Name, typeof(string), typeof(DependencyObject), typeMetadata); 3588DependencyProperty property = DependencyProperty.Register(nameof(FreezableTests) + MethodBase.GetCurrentMethod()!.Name + invalidValue?.GetType().Name, typeof(int), typeof(DependencyObject), typeMetadata); 3620DependencyProperty property = DependencyProperty.Register(nameof(FreezableTests) + MethodBase.GetCurrentMethod()!.Name + invalidValue?.GetType().Name, typeof(int), typeof(DependencyObject), typeMetadata); 6817DependencyProperty property = DependencyProperty.Register(nameof(FreezableTests) + MethodBase.GetCurrentMethod()!.Name + value?.GetType().Name, typeof(bool), typeof(DependencyObject)); 6828DependencyProperty property = DependencyProperty.Register(nameof(FreezableTests) + MethodBase.GetCurrentMethod()!.Name + value?.GetType().Name, typeof(bool?), typeof(DependencyObject)); 6844DependencyProperty property = DependencyProperty.Register(nameof(FreezableTests) + MethodBase.GetCurrentMethod()!.Name + value?.GetType().Name, typeof(string), typeof(DependencyObject));
WindowsFormsIntegration (3)
System\Windows\Integration\PropertyMap.cs (2)
140throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.WFI_PropertyDoesntExist, propertyName, SourceObject.GetType().FullName)); 181return SourceObject.GetType().GetProperty(propertyName, Type.EmptyTypes);
System\Windows\Integration\WindowsFormsHostPropertyMap.cs (1)
109PropertyInfo propertyInfo = childControl.GetType().GetProperty("RightToLeftLayout", memberAccess);
WinFormsControlsTest (8)
CollectionEditors.cs (1)
40label1.Text = sender.GetType().FullName;
CustomComCtl32Button.cs (3)
57if (control.GetType().Name == "Button") 78if (sender.GetType().Name == "CheckBox") 85if (sender.GetType().Name == "Button")
Dialogs.cs (3)
23TypeDescriptor.AddProvider(new AssociatedMetadataTypeTypeDescriptionProvider(openFileDialog1.GetType(), typeof(ExposedClientGuidMetadata)), openFileDialog1); 24TypeDescriptor.AddProvider(new AssociatedMetadataTypeTypeDescriptionProvider(saveFileDialog1.GetType(), typeof(ExposedClientGuidMetadata)), saveFileDialog1); 25TypeDescriptor.AddProvider(new AssociatedMetadataTypeTypeDescriptionProvider(folderBrowserDialog1.GetType(), typeof(ExposedClientGuidMetadata)), folderBrowserDialog1);
MainForm.cs (1)
255Debug.WriteLine($"Why did we get a {control.GetType().Name} instead a {nameof(Button)} on {nameof(MainForm)}?");
XmlFileLogger (1)
LogProcessNode.cs (1)
96var type = childNode.GetType();
xunit.assert (45)
EqualityAsserts.cs (6)
272 var expectedType = expected?.GetType(); 273 var actualType = actual?.GetType(); 317 var expectedType = expected?.GetType(); 318 var actualType = actual?.GetType(); 786 var expectedType = expected?.GetType(); 787 var actualType = actual?.GetType();
EventAsserts.cs (10)
70 if (raisedEvent.Arguments != null && !raisedEvent.Arguments.GetType().Equals(typeof(T))) 71 throw RaisesException.ForIncorrectType(typeof(T), raisedEvent.Arguments.GetType()); 95 if (raisedEvent.Arguments != null && !raisedEvent.Arguments.GetType().Equals(typeof(T))) 96 throw RaisesException.ForIncorrectType(typeof(T), raisedEvent.Arguments.GetType()); 126 if (raisedEvent.Arguments != null && !raisedEvent.Arguments.GetType().Equals(typeof(T))) 127 throw RaisesException.ForIncorrectType(typeof(T), raisedEvent.Arguments.GetType()); 298 if (raisedEvent.Arguments != null && !raisedEvent.Arguments.GetType().Equals(typeof(T))) 299 throw RaisesException.ForIncorrectType(typeof(T), raisedEvent.Arguments.GetType()); 323 if (raisedEvent.Arguments != null && !raisedEvent.Arguments.GetType().Equals(typeof(T))) 324 throw RaisesException.ForIncorrectType(typeof(T), raisedEvent.Arguments.GetType());
Sdk\ArgumentFormatter.cs (4)
222 if (value.GetType().GetTypeInfo().IsEnum) 251 var type = value.GetType(); 293 return string.Format(CultureInfo.CurrentCulture, "{0} was thrown formatting an object of type \"{1}\"", ex.GetType().Name, value.GetType()); 587 (from @interface in obj.GetType().GetTypeInfo().ImplementedInterfaces
Sdk\AssertEqualityComparer.cs (4)
339 var xKeyType = xKey.GetType(); 340 var yKeyType = yKey?.GetType(); 362 var xValueType = xValue.GetType(); 363 var yValueType = yValue?.GetType();
Sdk\AssertHelper.cs (10)
452 var expectedType = expected.GetType(); 454 var actualType = actual.GetType(); 541 ArgumentFormatter.FormatTypeName(expected.GetType()), 542 ArgumentFormatter.FormatTypeName(actual.GetType()) 606 var expectedType = expected.GetType(); 607 var actualType = actual.GetType(); 671 if (!result && TryConvert(expected, actual.GetType(), out converted)) 673 if (!result && TryConvert(actual, expected.GetType(), out converted)) 698 var expectedGetters = GetGettersForType(expected.GetType()); 699 var actualGetters = GetGettersForType(actual.GetType());
Sdk\AssertRangeComparer.cs (2)
47 if (x.GetType() != y.GetType())
Sdk\CollectionTracker.cs (3)
225 var valueXType = valueX.GetType(); 226 var valueYType = valueY.GetType(); 807 return item?.GetType().FullName;
Sdk\Exceptions\IsAssignableFromException.cs (1)
53 ArgumentFormatter.Format(actual?.GetType())
Sdk\Exceptions\IsNotAssignableFromException.cs (1)
45 ArgumentFormatter.Format(Assert.GuardArgumentNotNull(nameof(actual), actual).GetType())
TypeAsserts.cs (4)
67 if (@object == null || !expectedType.GetTypeInfo().IsAssignableFrom(@object.GetType().GetTypeInfo())) 101 if (@object != null && expectedType.GetTypeInfo().IsAssignableFrom(@object.GetType().GetTypeInfo())) 136 if (@object != null && expectedType.Equals(@object.GetType())) 178 var actualType = @object.GetType();