1 interface inheriting from IFormattable
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\ISpanFormattable.cs (1)
7public interface ISpanFormattable : IFormattable
59 implementations of IFormattable
Microsoft.CodeAnalysis (9)
CodeAnalysisResourcesLocalizableErrorArgument.cs (1)
12internal readonly struct CodeAnalysisResourcesLocalizableErrorArgument : IFormattable
ConstantValue.cs (1)
39internal abstract partial class ConstantValue : IEquatable<ConstantValue?>, IFormattable
Diagnostic\Diagnostic.cs (2)
21public abstract partial class Diagnostic : IEquatable<Diagnostic?>, IFormattable 604internal abstract class RequiredLanguageVersion : IFormattable
Diagnostic\DiagnosticInfo.cs (1)
26internal class DiagnosticInfo : IFormattable
Diagnostic\LocalizableString.cs (1)
13public abstract partial class LocalizableString : IFormattable, IEquatable<LocalizableString?>
SymbolDisplay\FormattedSymbol.cs (1)
20internal sealed class FormattedSymbol : IFormattable
SymbolDisplay\FormattedSymbolList.cs (1)
16internal sealed class FormattedSymbolList : IFormattable
Symbols\Attributes\AttributeUsageInfo.cs (1)
169private readonly struct ValidTargetsStringLocalizableErrorArgument : IFormattable
Microsoft.CodeAnalysis.CSharp (5)
Errors\MessageID.cs (1)
317internal readonly struct LocalizableErrorArgument : IFormattable
Symbols\Symbol.cs (1)
30internal abstract partial class Symbol : ISymbolInternal, IFormattable
Symbols\SymbolDistinguisher.cs (1)
204private sealed class Description : IFormattable
Symbols\TypeWithAnnotations.cs (1)
22internal readonly struct TypeWithAnnotations : IFormattable
Syntax\CSharpSyntaxNode.cs (1)
24public abstract partial class CSharpSyntaxNode : SyntaxNode, IFormattable
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Redaction\TestFormattable.cs (1)
8internal sealed class TestFormattable : IFormattable
Microsoft.Extensions.Telemetry (1)
Logging\JustInTimeRedactor.cs (1)
21, IFormattable
Microsoft.Extensions.Telemetry.Tests (1)
Logging\JustInTimeRedactorTests.cs (1)
87private sealed class Formattable : IFormattable
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\FormattableTestExtensions.cs (1)
20internal struct Formattable : IFormattable
PresentationCore (35)
System\Windows\FontStretch.cs (1)
21public struct FontStretch : IFormattable
System\Windows\FontStyle.cs (1)
18public struct FontStyle : IFormattable
System\Windows\FontWeight.cs (1)
19public struct FontWeight : IFormattable
System\Windows\Media\Animation\KeySpline.cs (1)
17public class KeySpline : Freezable, IFormattable
System\Windows\Media\Animation\RepeatBehavior.cs (1)
24public readonly struct RepeatBehavior : IFormattable
System\Windows\Media\Brush.cs (1)
27public abstract partial class Brush : Animatable, IFormattable
System\Windows\Media\Color.cs (1)
18public struct Color : IFormattable, IEquatable<Color>
System\Windows\Media\Generated\Brush.cs (1)
30public abstract partial class Brush : Animatable, IFormattable, DUCE.IResource
System\Windows\Media\Generated\DoubleCollection.cs (1)
32public sealed partial class DoubleCollection : Freezable, IFormattable, IList, IList<double>
System\Windows\Media\Generated\GeneralTransform.cs (1)
27public abstract partial class GeneralTransform : Animatable, IFormattable
System\Windows\Media\Generated\Geometry.cs (1)
30public abstract partial class Geometry : Animatable, IFormattable, DUCE.IResource
System\Windows\Media\Generated\GradientStop.cs (1)
16public sealed partial class GradientStop : Animatable, IFormattable
System\Windows\Media\Generated\GradientStopCollection.cs (1)
31public sealed partial class GradientStopCollection : Animatable, IFormattable, IList, IList<GradientStop>
System\Windows\Media\Generated\ImageSource.cs (1)
27public abstract partial class ImageSource : Animatable, IFormattable, DUCE.IResource
System\Windows\Media\Generated\Int32Collection.cs (1)
32public sealed partial class Int32Collection : Freezable, IFormattable, IList, IList<int>
System\Windows\Media\Generated\PathFigureCollection.cs (1)
32public sealed partial class PathFigureCollection : Animatable, IFormattable, IList, IList<PathFigure>
System\Windows\Media\Generated\PointCollection.cs (1)
32public sealed partial class PointCollection : Freezable, IFormattable, IList, IList<Point>
System\Windows\Media\Generated\VectorCollection.cs (1)
32public sealed partial class VectorCollection : Freezable, IFormattable, IList, IList<Vector>
System\Windows\Media\PathFigure.cs (1)
15public sealed partial class PathFigure : Animatable, IFormattable
System\Windows\Media3D\Generated\Camera.cs (1)
25public abstract partial class Camera : Animatable, IFormattable, DUCE.IResource
System\Windows\Media3D\Generated\GeneralTransform3D.cs (1)
25public abstract partial class GeneralTransform3D : Animatable, IFormattable
System\Windows\Media3D\Generated\Material.cs (1)
25public abstract partial class Material : Animatable, IFormattable, DUCE.IResource
System\Windows\Media3D\Generated\Matrix3D.cs (1)
29public partial struct Matrix3D : IFormattable
System\Windows\Media3D\Generated\Model3D.cs (1)
25public abstract partial class Model3D : Animatable, IFormattable, DUCE.IResource
System\Windows\Media3D\Generated\Point3D.cs (1)
29public partial struct Point3D : IFormattable
System\Windows\Media3D\Generated\Point3DCollection.cs (1)
30public sealed partial class Point3DCollection : Freezable, IFormattable, IList, IList<Point3D>
System\Windows\Media3D\Generated\Point4D.cs (1)
29public partial struct Point4D : IFormattable
System\Windows\Media3D\Generated\Quaternion.cs (1)
29public partial struct Quaternion : IFormattable
System\Windows\Media3D\Generated\Rect3D.cs (1)
29public partial struct Rect3D : IFormattable
System\Windows\Media3D\Generated\Rotation3D.cs (1)
25public abstract partial class Rotation3D : Animatable, IFormattable, DUCE.IResource
System\Windows\Media3D\Generated\Size3D.cs (1)
29public partial struct Size3D : IFormattable
System\Windows\Media3D\Generated\Vector3D.cs (1)
29public partial struct Vector3D : IFormattable
System\Windows\Media3D\Generated\Vector3DCollection.cs (1)
30public sealed partial class Vector3DCollection : Freezable, IFormattable, IList, IList<Vector3D>
System\Windows\Media3D\Quaternion.cs (1)
34public partial struct Quaternion : IFormattable
System\Windows\Media3D\Rect3D.cs (1)
11public partial struct Rect3D: IFormattable
System.Private.CoreLib (5)
src\libraries\System.Private.CoreLib\src\System\FormattableString.cs (1)
14public abstract class FormattableString : IFormattable
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (1)
31public readonly unsafe struct Vector<T> : ISimdVector<Vector<T>, T>, IFormattable
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (1)
18public partial struct Vector2 : IEquatable<Vector2>, IFormattable
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (1)
18public partial struct Vector3 : IEquatable<Vector3>, IFormattable
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (1)
17public partial struct Vector4 : IEquatable<Vector4>, IFormattable
System.Runtime.Numerics (1)
System\Numerics\Complex.cs (1)
22IFormattable,
237 references to IFormattable
Aspire.Hosting (1)
Publishing\ResourceContainerImageManager.cs (1)
503IFormattable formattable => formattable.ToString(null, CultureInfo.InvariantCulture),
dotnet-svcutil-lib (6)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaDatatype.cs (6)
284if (cur is IFormattable) 286bldr.Append(((IFormattable)cur).ToString("", CultureInfo.InvariantCulture)); 296if (cur is IFormattable) 298bldr.Append(((IFormattable)cur).ToString("", CultureInfo.InvariantCulture)); 309else if (value is IFormattable) 311stringValue = ((IFormattable)value).ToString("", CultureInfo.InvariantCulture);
GenerateDocumentationAndConfigFiles (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Metrics (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Metrics.Legacy (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.AspNetCore.Components (1)
PersistentState\PersistentStateValueProviderKeyResolver.cs (1)
129if (key is IFormattable formattable)
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\SSRRenderModeBoundary.cs (1)
223IFormattable formattable => formattable.ToString(null, CultureInfo.InvariantCulture),
Microsoft.AspNetCore.Components.Forms (5)
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (3)
268else if (typeof(IFormattable).IsAssignableFrom(memberType)) 270var func = CompileMemberEvaluator<IFormattable>(memberExpression); 299case IFormattable formattable:
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (2)
103InsertFront((IFormattable)value); 107public void InsertFront(IFormattable formattable)
Microsoft.AspNetCore.Components.QuickGrid (4)
Columns\PropertyColumn.cs (4)
28/// Using this requires the <typeparamref name="TProp"/> type to implement <see cref="IFormattable" />. 56if (!typeof(IFormattable).IsAssignableFrom(nullableUnderlyingTypeOrNull ?? typeof(TProp))) 58throw new InvalidOperationException($"A '{nameof(Format)}' parameter was supplied, but the type '{typeof(TProp)}' does not implement '{typeof(IFormattable)}'."); 61_cellTextFunc = item => ((IFormattable?)compiledPropertyExpression!(item))?.ToString(Format, null);
Microsoft.AspNetCore.Components.Web (5)
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (3)
268else if (typeof(IFormattable).IsAssignableFrom(memberType)) 270var func = CompileMemberEvaluator<IFormattable>(memberExpression); 299case IFormattable formattable:
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (2)
103InsertFront((IFormattable)value); 107public void InsertFront(IFormattable formattable)
Microsoft.AspNetCore.Hosting (1)
Internal\HostingRequestStartingLog.cs (1)
71internal static string ValueOrEmptyMarker<T>(T? potentialValue) where T : struct, IFormattable
Microsoft.AspNetCore.Html.Abstractions (1)
HtmlFormattableString.cs (1)
136if (arg is IFormattable formattable)
Microsoft.CodeAnalysis (10)
Diagnostic\Diagnostic.cs (2)
414string IFormattable.ToString(string? ignored, IFormatProvider? formatProvider) 608string IFormattable.ToString(string? format, IFormatProvider? formatProvider)
Diagnostic\DiagnosticInfo.cs (3)
104if (arg is IFormattable) 386return ((IFormattable)this).ToString(null, formatProvider); 389string IFormattable.ToString(string? format, IFormatProvider? formatProvider)
Diagnostic\LocalizableString.cs (1)
52string IFormattable.ToString(string? ignored, IFormatProvider? formatProvider)
InternalUtilities\JsonWriter.cs (2)
116where T : struct, IFormattable 122where T : struct, IFormattable
SymbolDisplay\FormattedSymbol.cs (1)
53string IFormattable.ToString(string format, IFormatProvider formatProvider)
SymbolDisplay\FormattedSymbolList.cs (1)
52string IFormattable.ToString(string format, IFormatProvider formatProvider)
Microsoft.CodeAnalysis.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.CodeAnalysis.BannedApiAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.CodeAnalysis.CodeStyle (3)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
144FindType<IFormattable>(expression.SemanticModel) is { } systemIFormattable &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.CodeAnalysis.CSharp (6)
Symbols\Symbol.cs (1)
1830string IFormattable.ToString(string format, IFormatProvider formatProvider)
Symbols\SymbolDistinguisher.cs (3)
42public IFormattable First 47public IFormattable Second 244string IFormattable.ToString(string? format, IFormatProvider? formatProvider)
Symbols\TypeWithAnnotations.cs (1)
333string IFormattable.ToString(string format, IFormatProvider formatProvider)
Syntax\CSharpSyntaxNode.cs (1)
534string IFormattable.ToString(string? format, IFormatProvider? formatProvider)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
130var stringValue = ((IFormattable)value).ToString("R", CultureInfo.InvariantCulture); 276: ((IFormattable)nonNegativeValue).ToString(formatString, CultureInfo.InvariantCulture) + suffix;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (10)
Diagnostics\DiagnosticAnalyzerTests.cs (5)
856IFormattable context = $@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: {compilation.AssemblyName}")} 915IFormattable context = $@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: {compilation.AssemblyName}")} 955IFormattable context = $@"{new LazyToString(() => analyzerException)} 1065IFormattable context = $@"{string.Format(CodeAnalysisResources.ExceptionContext, contextDetail)} 1110IFormattable context = $@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: {compilation.AssemblyName}
Diagnostics\DiagnosticSuppressorTests.cs (5)
407IFormattable context = $@"{new LazyToString(() => exceptions[0])} 449IFormattable context = $@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: {compilation.AssemblyName}")} 501IFormattable context = $@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: {compilation.AssemblyName}")} 554IFormattable context = $@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: {compilation.AssemblyName}")} 607IFormattable context = $@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: {compilation.AssemblyName}")}
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\SymbolDistinguisherTests.cs (2)
723var arg1A = distinguisher1.First; 724var arg2A = distinguisher2.First;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (7)
Parsing\ParsingErrorRecoveryTests.cs (7)
7399Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7418Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7451Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7476Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7501Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7527Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[] 7551Assert.True(syntaxTree.GetDiagnostics().Select(d => ((IFormattable)d).ToString(null, EnsureEnglishUICulture.PreferredOrNull)).SequenceEqual(new[]
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
130var stringValue = ((IFormattable)value).ToString("R", CultureInfo.InvariantCulture); 276: ((IFormattable)nonNegativeValue).ToString(formatString, CultureInfo.InvariantCulture) + suffix;
Microsoft.CodeAnalysis.Extensions.Package (2)
Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.CodeAnalysis.Features (3)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (2)
177Name: nameof(IFormattable), 188.GetMembers(nameof(IFormattable.ToString))
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
144FindType<IFormattable>(expression.SemanticModel) is { } systemIFormattable &&
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\OperationTreeVerifier.cs (1)
222case IFormattable formattable:
Diagnostics\DiagnosticExtensions.cs (1)
451IFormattable formattable = d;
Microsoft.CodeAnalysis.UnitTests (4)
Diagnostics\SuppressMessageAttributeCompilerTests.cs (4)
107(IFormattable)$@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: TestProject 119(IFormattable)$@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: TestProject 131(IFormattable)$@"{string.Format(CodeAnalysisResources.ExceptionContext, $@"Compilation: TestProject 166(IFormattable)$@"{new LazyToString(() =>
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\Compilers\Core\Portable\InternalUtilities\JsonWriter.cs (2)
116where T : struct, IFormattable 122where T : struct, IFormattable
Microsoft.Extensions.Compliance.Abstractions (6)
Redaction\Redactor.cs (6)
138if (value is IFormattable) 140return Redact(((IFormattable)value).ToString(format, provider)); 189if (value is IFormattable) 191return Redact(((IFormattable)value).ToString(format, provider), destination); 249if (value is IFormattable) 252var str = ((IFormattable)value).ToString(fmt, provider);
Microsoft.Extensions.Logging.Abstractions (1)
LogValuesFormatter.cs (1)
274e is IFormattable f ? f.ToString(null, CultureInfo.InvariantCulture) :
Microsoft.Extensions.Telemetry (1)
Logging\JustInTimeRedactor.cs (1)
112if (value is IFormattable f)
Microsoft.Maui.Controls (1)
ToStringValueConverter.cs (1)
14 if (value is IFormattable formattable)
Microsoft.Private.Windows.Polyfills.Tests (1)
System\ISpanFormattableTests.cs (1)
85typeof(ISpanFormattable).IsAssignableTo(typeof(IFormattable)).Should().BeTrue();
Microsoft.VisualBasic.Core (8)
Microsoft\VisualBasic\Strings.vb (8)
1240Dim iformat As IFormattable = Nothing 1271iformat = TryCast(Expression, IFormattable) 1346Dim ifmt As IFormattable 1372ifmt = CType(Expression, IFormattable) 1429Dim ifmt As IFormattable 1455ifmt = CType(Expression, IFormattable) 1791Dim ifmt As IFormattable 1811ifmt = CType(Expression, IFormattable)
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
297[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IFormattable))]
netstandard (1)
netstandard.cs (1)
872[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IFormattable))]
PresentationCore (41)
MS\Internal\FontFace\FontDifferentiator.cs (3)
47parsedWeightName = ((IFormattable)fontWeight).ToString(null, CultureInfo.InvariantCulture); 50parsedStretchName = ((IFormattable)fontStretch).ToString(null, CultureInfo.InvariantCulture); 53parsedStyleName = ((IFormattable)fontStyle).ToString(null, CultureInfo.InvariantCulture);
System\Windows\FontStretch.cs (1)
195string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\FontStretchConverter.cs (1)
100return ((IFormattable)c).ToString(null, culture);
System\Windows\FontStyle.cs (1)
105string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\FontStyleConverter.cs (1)
100return ((IFormattable)c).ToString(null, culture);
System\Windows\FontWeight.cs (1)
192string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\FontWeightConverter.cs (1)
100return ((IFormattable)c).ToString(null, culture);
System\Windows\Media\Animation\KeySpline.cs (1)
457string IFormattable.ToString(string format, IFormatProvider formatProvider)
System\Windows\Media\Animation\RepeatBehavior.cs (1)
260string IFormattable.ToString(string format, IFormatProvider formatProvider)
System\Windows\Media\Color.cs (1)
251string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\Brush.cs (1)
357string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\DoubleCollection.cs (1)
663string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\GeneralTransform.cs (1)
152string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\Geometry.cs (1)
274string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\GradientStop.cs (1)
189string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\GradientStopCollection.cs (1)
746string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\ImageSource.cs (1)
209string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\Int32Collection.cs (1)
663string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\PathFigureCollection.cs (1)
747string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\PointCollection.cs (1)
663string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\Generated\VectorCollection.cs (1)
663string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media\LineSegment.cs (1)
86return "L" + ((IFormattable)Point).ToString(format, provider);
System\Windows\Media\MatrixTransform.cs (1)
100return ((IFormattable)Matrix).ToString(format, provider);
System\Windows\Media\PathFigure.cs (2)
176string IFormattable.ToString(string format, IFormatProvider provider) 207((IFormattable)StartPoint).ToString(format, provider) +
System\Windows\Media3D\Generated\Camera.cs (1)
267string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\GeneralTransform3D.cs (1)
150string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Material.cs (1)
207string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Matrix3D.cs (1)
347string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Model3D.cs (1)
267string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Point3D.cs (1)
314string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Point3DCollection.cs (1)
661string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Point4D.cs (1)
335string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Quaternion.cs (1)
299string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Rect3D.cs (1)
300string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Rotation3D.cs (1)
207string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Size3D.cs (1)
288string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Vector3D.cs (1)
314string IFormattable.ToString(string format, IFormatProvider provider)
System\Windows\Media3D\Generated\Vector3DCollection.cs (1)
661string IFormattable.ToString(string format, IFormatProvider provider)
ReachFramework (2)
Serialization\ColorTypeConverter.cs (2)
168IFormattable formattableColor = (IFormattable)color;
Roslyn.Diagnostics.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Roslyn.Diagnostics.CSharp.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
130var stringValue = ((IFormattable)value).ToString("R", CultureInfo.InvariantCulture); 276: ((IFormattable)nonNegativeValue).ToString(formatString, CultureInfo.InvariantCulture) + suffix;
System.ComponentModel.TypeConverter (1)
System\ComponentModel\TypeConverter.cs (1)
126if (value is IFormattable formattable)
System.Data.Common (4)
System\Data\Common\SQLConvert.cs (4)
483IFormattable? iformattable = (value as IFormattable); 731IFormattable? iformattable = (value as IFormattable);
System.Net.Primitives (3)
System\Net\IPAddress.cs (1)
476string IFormattable.ToString(string? format, IFormatProvider? formatProvider) =>
System\Net\IPEndPoint.cs (1)
289string IFormattable.ToString(string? format, IFormatProvider? formatProvider) => ToString();
System\Net\IPNetwork.cs (1)
347string IFormattable.ToString(string? format, IFormatProvider? provider) => ToString();
System.Private.CoreLib (37)
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
214string IFormattable.ToString(string? format, IFormatProvider? formatProvider) => ToString(m_value);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
1878if (value is IFormattable formattable)
src\libraries\System.Private.CoreLib\src\System\FormattableString.cs (1)
43string IFormattable.ToString(string? ignored, IFormatProvider? formatProvider) =>
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (2)
295if (value is IFormattable f) 534if (value is IFormattable f)
src\libraries\System.Private.CoreLib\src\System\ISpanFormattable.cs (1)
16/// An implementation of this interface should produce the same string of characters as an implementation of <see cref="IFormattable.ToString(string?, IFormatProvider?)"/>
src\libraries\System.Private.CoreLib\src\System\IUtf8SpanFormattable.cs (1)
16/// An implementation of this interface should produce the same string of characters as an implementation of <see cref="IFormattable.ToString"/> or <see cref="ISpanFormattable.TryFormat"/>
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (4)
6159if (value is IFormattable) 6185s = ((IFormattable)value).ToString(format: null, _provider); // constrained call avoiding boxing for value types 6220if (value is IFormattable) 6246s = ((IFormattable)value).ToString(format, _provider); // constrained call avoiding boxing for value types
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (2)
771sb.Append(((IFormattable)this.GetElementUnsafe(0)).ToString(format, formatProvider)); 777sb.Append(((IFormattable)this.GetElementUnsafe(i)).ToString(format, formatProvider));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (4)
263if (value is IFormattable) 291s = ((IFormattable)value).ToString(format: null, _provider); // constrained call avoiding boxing for value types 330if (value is IFormattable) 358s = ((IFormattable)value).ToString(format, _provider); // constrained call avoiding boxing for value types
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128_1.cs (2)
454sb.Append(((IFormattable)this.GetElementUnsafe(0)).ToString(format, formatProvider)); 460sb.Append(((IFormattable)this.GetElementUnsafe(i)).ToString(format, formatProvider));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256_1.cs (2)
443sb.Append(((IFormattable)this.GetElementUnsafe(0)).ToString(format, formatProvider)); 449sb.Append(((IFormattable)this.GetElementUnsafe(i)).ToString(format, formatProvider));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512_1.cs (2)
443sb.Append(((IFormattable)this.GetElementUnsafe(0)).ToString(format, formatProvider)); 449sb.Append(((IFormattable)this.GetElementUnsafe(i)).ToString(format, formatProvider));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64_1.cs (2)
511sb.Append(((IFormattable)this.GetElementUnsafe(0)).ToString(format, formatProvider)); 517sb.Append(((IFormattable)this.GetElementUnsafe(i)).ToString(format, formatProvider));
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (1)
999string IFormattable.ToString(string? format, IFormatProvider? formatProvider) => ToString();
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (5)
1779if (arg is IFormattable formattableArg) 2997if (value is IFormattable) 3041_stringBuilder.Append(((IFormattable)value).ToString(format: null, _provider)); // constrained call avoiding boxing for value types 3068if (value is IFormattable) 3112_stringBuilder.Append(((IFormattable)value).ToString(format, _provider)); // constrained call avoiding boxing for value types
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (4)
461if (value is IFormattable) 470s = ((IFormattable)value).ToString(null, _provider); 519if (value is IFormattable) 528s = ((IFormattable)value).ToString(format, _provider);
src\libraries\System.Private.CoreLib\src\System\Text\ValueStringBuilder.AppendFormat.cs (1)
231if (arg is IFormattable formattableArg)
src\libraries\System.Private.CoreLib\src\System\Version.cs (1)
180string IFormattable.ToString(string? format, IFormatProvider? formatProvider) =>
System.Private.Uri (1)
System\Uri.cs (1)
1656string IFormattable.ToString(string? format, IFormatProvider? formatProvider) =>
System.Private.Xml (6)
System\Xml\Schema\XmlSchemaDataType.cs (6)
184if (cur is IFormattable) 186bldr.Append(((IFormattable)cur).ToString("", CultureInfo.InvariantCulture)); 196if (cur is IFormattable) 198bldr.Append(((IFormattable)cur).ToString("", CultureInfo.InvariantCulture)); 209else if (value is IFormattable) 211stringValue = ((IFormattable)value).ToString("", CultureInfo.InvariantCulture);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net11.0\System.Runtime.Forwards.cs (1)
275[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IFormattable))]
System.Windows.Forms (1)
System\Windows\Forms\Internal\Formatter.cs (1)
130if (value is IFormattable valueAsFormattable && !string.IsNullOrEmpty(formatString))
Test.Utilities (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
Text.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
127=> compilation.GetTypeByMetadataName(typeof(IFormattable).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
246return symbol?.MetadataName is nameof(FormattableString) or nameof(IFormattable)
WindowsBase.Tests (12)
System\Windows\Int32RectTests.cs (2)
428IFormattable formattable = rect; 443IFormattable formattable = rect;
System\Windows\Media\MatrixTests.cs (2)
4583IFormattable formattable = matrix; 4604IFormattable formattable = matrix;
System\Windows\PointTests.cs (2)
502IFormattable formattable = point; 523IFormattable formattable = point;
System\Windows\RectTests.cs (2)
3014IFormattable formattable = rect; 3029IFormattable formattable = rect;
System\Windows\SizeTests.cs (2)
470IFormattable formattable = size; 491IFormattable formattable = size;
System\Windows\VectorTests.cs (2)
774IFormattable formattable = vector; 790IFormattable formattable = vector;