diff --git a/.editorconfig b/.editorconfig index 15f564ea..68e3b8be 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,7 @@ root = true # Default settings ############################################# [*] +charset = utf-8 end_of_line = lf insert_final_newline = true indent_style = space @@ -188,32 +189,32 @@ dotnet_diagnostic.AvoidAsyncVoid.severity = suggestion # Design dotnet_diagnostic.CA1000.severity = none # Do not declare static members on generic types — common factory pattern dotnet_diagnostic.CA1001.severity = error # Types that own disposable fields should be disposable -dotnet_diagnostic.CA1002.severity = none # Do not expose generic lists — we deliberately expose List; interface-based collections are an older convention we don't follow +dotnet_diagnostic.CA1002.severity = none # Do not expose generic lists — we expose List deliberately dotnet_diagnostic.CA1003.severity = none # Use generic event handler instances — covered by SST2304 -dotnet_diagnostic.CA1005.severity = none # Avoid excessive parameters on generic types — we deliberately expose 3+ type-parameter types (tuple-style handles, raw engine signals); the ergonomic guidance conflicts with that design +dotnet_diagnostic.CA1005.severity = none # Avoid excessive parameters on generic types — 3+ type parameters are deliberate dotnet_diagnostic.CA1008.severity = error # Enums should have zero value -dotnet_diagnostic.CA1010.severity = none # Collections should implement generic interface — we deliberately expose concrete collection types; interface-based collections are an older convention we don't follow +dotnet_diagnostic.CA1010.severity = none # Collections should implement generic interface — concrete types are deliberate dotnet_diagnostic.CA1012.severity = none # Abstract types should not have public constructors — covered by SST1428 -dotnet_diagnostic.CA1014.severity = none # Mark assemblies with CLSCompliantAttribute — we don't ship CLS-compliant assemblies +dotnet_diagnostic.CA1014.severity = none # Mark assemblies CLSCompliant — we don't ship CLS-compliant assemblies dotnet_diagnostic.CA1016.severity = error # Mark assemblies with AssemblyVersionAttribute dotnet_diagnostic.CA1017.severity = none # Mark assemblies with ComVisibleAttribute — we don't ship COM-visible assemblies -dotnet_diagnostic.CA1018.severity = error # Mark attributes with AttributeUsageAttribute -dotnet_diagnostic.CA1019.severity = none # Define accessors for attribute arguments — conflicts with SST2324, which caps an internal attribute's accessor at internal -dotnet_diagnostic.CA1021.severity = none # Avoid out parameters - disabled - needed for the zero-allocation idiom in Try/Find APIs and other performance-critical paths +dotnet_diagnostic.CA1018.severity = none # Mark attributes with AttributeUsageAttribute — covered by SST2336 +dotnet_diagnostic.CA1019.severity = none # Define accessors for attribute arguments — conflicts with SST2324 +dotnet_diagnostic.CA1021.severity = none # Avoid out parameters — needed for zero-allocation Try/Find APIs dotnet_diagnostic.CA1024.severity = error # Use properties where appropriate dotnet_diagnostic.CA1027.severity = error # Mark enums with FlagsAttribute dotnet_diagnostic.CA1028.severity = none # Enum storage should be Int32 — covered by SST2313 dotnet_diagnostic.CA1030.severity = none # Use events where appropriate — we use Rx observables instead of CLR events dotnet_diagnostic.CA1031.severity = none # Do not catch general exception types — required at logging/dispose/IO boundaries dotnet_diagnostic.CA1032.severity = none # Implement standard exception constructors — covered by SST1488 -dotnet_diagnostic.CA1033.severity = none # Interface methods should be callable by child types — explicit interface implementations are a deliberate design choice -dotnet_diagnostic.CA1034.severity = none # Nested types should not be visible — public nested types are sometimes the cleanest API (e.g. interface-scoped exception helpers) -dotnet_diagnostic.CA1036.severity = none # Override methods on comparable types — relational operators rarely meaningful for our types -dotnet_diagnostic.CA1040.severity = none # Avoid empty interfaces — duplicate of SST1437 (canonical); marker interfaces (IActivatableView etc.) are deliberate public API +dotnet_diagnostic.CA1033.severity = none # Interface methods callable by child types — explicit impls are deliberate +dotnet_diagnostic.CA1034.severity = none # Nested types should not be visible — sometimes the cleanest API +dotnet_diagnostic.CA1036.severity = none # Override methods on comparable types — relational operators rarely meaningful +dotnet_diagnostic.CA1040.severity = none # Avoid empty interfaces — covered by SST1437; marker interfaces are deliberate dotnet_diagnostic.CA1041.severity = none # Provide ObsoleteAttribute message — covered by SST2308 dotnet_diagnostic.CA1043.severity = error # Use integral or string argument for indexers dotnet_diagnostic.CA1044.severity = none # Properties should not be write only — covered by SST1421 -dotnet_diagnostic.CA1045.severity = none # Do not pass types by reference — we deliberately use ref-passing static helpers so they carry only the data they touch; data-oriented layout is the default here +dotnet_diagnostic.CA1045.severity = none # Do not pass types by reference — ref-passing helpers are the chosen layout dotnet_diagnostic.CA1046.severity = error # Do not overload operator equals on reference types dotnet_diagnostic.CA1047.severity = none # Do not declare protected member in sealed type — covered by SST1427 dotnet_diagnostic.CA1048.severity = none # Do not declare virtual members in sealed types — covered by SST1491 @@ -228,20 +229,20 @@ dotnet_diagnostic.CA1058.severity = error # Types should not extend certain base dotnet_diagnostic.CA1059.severity = error # Members should not expose certain concrete types dotnet_diagnostic.CA1060.severity = error # Move P/Invokes to NativeMethods class dotnet_diagnostic.CA1061.severity = none # Do not hide base class methods — covered by SST2427 -dotnet_diagnostic.CA1062.severity = none # Validate arguments of public methods - Nullable=enable + we own every consumer, so the compiler already guarantees non-null params +dotnet_diagnostic.CA1062.severity = none # Validate arguments of public methods — nullable annotations already guarantee it dotnet_diagnostic.CA1063.severity = none # Implement IDisposable correctly — covered by SST2300 dotnet_diagnostic.CA1064.severity = error # Exceptions should be public dotnet_diagnostic.CA1065.severity = none # Do not raise exceptions in unexpected locations — covered by SST1485 dotnet_diagnostic.CA1066.severity = error # Implement IEquatable when overriding Equals dotnet_diagnostic.CA1067.severity = error # Override Equals when implementing IEquatable dotnet_diagnostic.CA1068.severity = error # CancellationToken parameters must come last -dotnet_diagnostic.CA1069.severity = error # Enums should not have duplicate values +dotnet_diagnostic.CA1069.severity = none # Enums should not have duplicate values — covered by SST2455 dotnet_diagnostic.CA1070.severity = error # Do not declare event fields as virtual # Globalization dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters — we don't ship localized resources dotnet_diagnostic.CA1307.severity = none # Covered by PSH1207 (canonical) -dotnet_diagnostic.CA1308.severity = none # Normalize strings to uppercase — ToLowerInvariant is correct for filesystem path / cache key normalization +dotnet_diagnostic.CA1308.severity = none # Normalize strings to uppercase — ToLowerInvariant is right for path/cache keys dotnet_diagnostic.CA1310.severity = none # Covered by PSH1207 (canonical) # Interoperability @@ -252,7 +253,7 @@ dotnet_diagnostic.CA1500.severity = none # Variable names should not match field dotnet_diagnostic.CA1501.severity = none # Covered by SST1446 (canonical) dotnet_diagnostic.CA1502.severity = none # Covered by SST1442 (canonical) dotnet_diagnostic.CA1505.severity = error # Avoid unmaintainable code -dotnet_diagnostic.CA1506.severity = none # Avoid excessive class coupling — adds little signal here, mostly trips on legitimate orchestration code +dotnet_diagnostic.CA1506.severity = none # Avoid excessive class coupling — little signal, trips on orchestration code dotnet_diagnostic.CA1507.severity = none # Use nameof in place of string — covered by SST1463 dotnet_diagnostic.CA1508.severity = error # Avoid dead conditional code dotnet_diagnostic.CA1509.severity = error # Invalid entry in code metrics configuration file @@ -261,23 +262,23 @@ dotnet_diagnostic.CA1511.severity = none # Covered by PSH1409 (canonical) dotnet_diagnostic.CA1512.severity = none # Covered by PSH1409 (canonical) dotnet_diagnostic.CA1513.severity = none # Covered by PSH1409 (canonical) dotnet_diagnostic.CA1514.severity = none # Avoid redundant length argument — covered by PSH1220 -dotnet_diagnostic.CA1515.severity = none # Consider making public types internal — interferes with tests and reflection-discovered types (BenchmarkDotNet, TUnit, etc.) +dotnet_diagnostic.CA1515.severity = none # Consider making public types internal — breaks tests and reflection discovery dotnet_diagnostic.CA1516.severity = error # Use cross-platform intrinsics # Naming dotnet_diagnostic.CA1710.severity = suggestion # Identifiers should have correct suffix -dotnet_diagnostic.CA1724.severity = none # Type Names Should Not Match Namespaces — namespace/type name overlap is intentional API surface +dotnet_diagnostic.CA1724.severity = none # Type names should not match namespaces — the overlap is intentional # Performance dotnet_diagnostic.CA1802.severity = none # Use literals where appropriate — covered by PSH1402 dotnet_diagnostic.CA1805.severity = none # Do not initialize unnecessarily — covered by PSH1403 dotnet_diagnostic.CA1806.severity = error # Do not ignore method results -dotnet_diagnostic.CA1810.severity = none # Initialize reference type static fields inline — explicit static constructors are deliberate in some types +dotnet_diagnostic.CA1810.severity = none # Initialize static fields inline — explicit static constructors are deliberate dotnet_diagnostic.CA1812.severity = error # Avoid uninstantiated internal classes dotnet_diagnostic.CA1813.severity = none # Avoid unsealed attributes — covered by PSH1401 dotnet_diagnostic.CA1814.severity = none # Prefer jagged arrays over multidimensional — covered by PSH1020 dotnet_diagnostic.CA1815.severity = none # Override equals and operator equals on value types — covered by PSH1005 -dotnet_diagnostic.CA1819.severity = none # Properties should not return arrays — incompatible with the RxUI/sqlite-net mapping style we use throughout the codebase +dotnet_diagnostic.CA1819.severity = none # Properties should not return arrays — incompatible with our mapping style dotnet_diagnostic.CA1820.severity = none # Test for empty strings using string length — covered by PSH1204 dotnet_diagnostic.CA1821.severity = none # Remove empty finalizers — covered by PSH1002 dotnet_diagnostic.CA1822.severity = none # Mark members as static — covered by PSH1414 @@ -286,14 +287,14 @@ dotnet_diagnostic.CA1824.severity = error # Mark assemblies with NeutralResource dotnet_diagnostic.CA1825.severity = none # Avoid zero-length array allocations — covered by PSH1001 dotnet_diagnostic.CA1826.severity = none # Use property instead of Linq Enumerable method — covered by PSH1103 dotnet_diagnostic.CA1827.severity = none # Do not use Count/LongCount when Any can be used — covered by PSH1119 -dotnet_diagnostic.CA1828.severity = none # Do not use CountAsync/LongCountAsync when AnyAsync can be used — covered by PSH1126 +dotnet_diagnostic.CA1828.severity = none # Use AnyAsync instead of CountAsync — covered by PSH1126 dotnet_diagnostic.CA1829.severity = none # Use Length/Count property instead of Enumerable.Count — covered by PSH1103 -dotnet_diagnostic.CA1830.severity = none # Prefer strongly-typed Append/Insert overloads on StringBuilder — covered by PSH1202 +dotnet_diagnostic.CA1830.severity = none # Use strongly-typed StringBuilder overloads — covered by PSH1202 dotnet_diagnostic.CA1831.severity = none # Use AsSpan instead of Range-based indexers for string — covered by PSH1212 -dotnet_diagnostic.CA1832.severity = none # Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array — covered by PSH1019 -dotnet_diagnostic.CA1833.severity = none # Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memory portion of an array — conflicts with PSH1019, which owns the array range-indexer rewrite and refuses it for mutable Span/Memory targets +dotnet_diagnostic.CA1832.severity = none # AsSpan/AsMemory over range indexers for read-only slices — covered by PSH1019 +dotnet_diagnostic.CA1833.severity = none # AsSpan/AsMemory over range indexers for mutable slices — conflicts with PSH1019 dotnet_diagnostic.CA1834.severity = none # Use StringBuilder.Append(char) for single character strings — covered by PSH1202 -dotnet_diagnostic.CA1835.severity = none # Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes — covered by PSH1314 +dotnet_diagnostic.CA1835.severity = none # Prefer memory-based ReadAsync/WriteAsync overloads — covered by PSH1314 dotnet_diagnostic.CA1836.severity = none # Prefer IsEmpty over Count when available — covered by PSH1117 dotnet_diagnostic.CA1837.severity = none # Use Environment.ProcessId — covered by PSH1405 dotnet_diagnostic.CA1838.severity = error # Avoid StringBuilder parameters for P/Invokes @@ -321,7 +322,7 @@ dotnet_diagnostic.CA1858.severity = none # Use 'StartsWith' instead of 'IndexOf' dotnet_diagnostic.CA1859.severity = error # Use concrete types when possible for improved performance dotnet_diagnostic.CA1860.severity = none # Avoid using 'Enumerable.Any()' extension method — covered by PSH1103 dotnet_diagnostic.CA1861.severity = none # Avoid constant arrays as arguments — covered by PSH1004 -dotnet_diagnostic.CA1862.severity = none # Use the 'StringComparison' overloads for case-insensitive comparisons — covered by PSH1200 +dotnet_diagnostic.CA1862.severity = none # StringComparison overloads for case-insensitive compares — covered by PSH1200 dotnet_diagnostic.CA1863.severity = none # Use 'CompositeFormat' — covered by PSH1223 dotnet_diagnostic.CA1864.severity = none # Prefer the 'IDictionary.TryAdd' method — covered by PSH1115 dotnet_diagnostic.CA1865.severity = none # Covered by PSH1201 (canonical) @@ -331,8 +332,8 @@ dotnet_diagnostic.CA1868.severity = none # Unnecessary call to 'Contains' for se dotnet_diagnostic.CA1869.severity = none # Cache and reuse 'JsonSerializerOptions' instances — covered by PSH1416 dotnet_diagnostic.CA1870.severity = none # Use a cached 'SearchValues' instance — covered by PSH1213 dotnet_diagnostic.CA1871.severity = error # Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull' -dotnet_diagnostic.CA1872.severity = none # Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString' — covered by PSH1224 -dotnet_diagnostic.CA1873.severity = none # Avoid potentially expensive evaluation of arguments to 'Debug.Assert' — covered by PSH1417 +dotnet_diagnostic.CA1872.severity = none # Convert.ToHexString over BitConverter.ToString chains — covered by PSH1224 +dotnet_diagnostic.CA1873.severity = none # Avoid expensive Debug.Assert arguments — covered by PSH1417 dotnet_diagnostic.CA1874.severity = none # Use 'Regex.IsMatch' — covered by PSH1406 dotnet_diagnostic.CA1875.severity = none # Use 'Regex.Count' — covered by PSH1406 dotnet_diagnostic.CA1877.severity = none # Use 'Encoding.GetString' instead of 'Encoding.GetChars' — covered by PSH1225 @@ -340,7 +341,7 @@ dotnet_diagnostic.CA1877.severity = none # Use 'Encoding.GetString' instead of ' # Reliability dotnet_diagnostic.CA2000.severity = suggestion # Dispose objects before losing scope dotnet_diagnostic.CA2002.severity = error # Do not lock on objects with weak identity -dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task — Rx and library callers drive synchronization context themselves +dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task — callers drive the synchronization context dotnet_diagnostic.CA2008.severity = error # Do not create tasks without passing a TaskScheduler dotnet_diagnostic.CA2009.severity = error # Do not call ToImmutableCollection on an ImmutableCollection value dotnet_diagnostic.CA2011.severity = error # Do not assign property within its setter @@ -350,7 +351,7 @@ dotnet_diagnostic.CA2014.severity = error # Do not use stackalloc in loops dotnet_diagnostic.CA2015.severity = error # Do not define finalizers for types derived from MemoryManager dotnet_diagnostic.CA2016.severity = error # Forward the CancellationToken parameter to methods that take one dotnet_diagnostic.CA2017.severity = error # Parameter count mismatch -dotnet_diagnostic.CA2018.severity = error # The 'count' argument to 'Buffer.BlockCopy' should specify the number of bytes to copy +dotnet_diagnostic.CA2018.severity = error # The Buffer.BlockCopy 'count' argument should be a byte count dotnet_diagnostic.CA2019.severity = error # Improper 'ThreadStatic' field initialization dotnet_diagnostic.CA2020.severity = error # Prevent behavioral change caused by built-in operators of IntPtr/UIntPtr dotnet_diagnostic.CA2021.severity = error # Don't call Enumerable.Cast or Enumerable.OfType with incompatible types @@ -358,28 +359,28 @@ dotnet_diagnostic.CA2022.severity = error # Avoid inexact read with 'Stream.Read dotnet_diagnostic.CA2023.severity = error # Invalid braces in message template dotnet_diagnostic.CA2024.severity = error # Do not use 'StreamReader.EndOfStream' in async methods dotnet_diagnostic.CA2025.severity = error # Do not pass 'IDisposable' instances into unawaited tasks -dotnet_diagnostic.CA2026.severity = error # Do not use methods or types annotated with [RequiresDynamicCode] in code that uses [RequiresDynamicCode] +dotnet_diagnostic.CA2026.severity = error # A [RequiresDynamicCode] member is used from code that also requires it # Usage -dotnet_diagnostic.CA1801.severity = error # Review unused parameters +dotnet_diagnostic.CA1801.severity = none # Review unused parameters — covered by SST1461 dotnet_code_quality.CA1801.api_surface = private, internal # only flag non-public APIs so we don't break public signatures dotnet_diagnostic.CA1816.severity = error # Call GC.SuppressFinalize correctly dotnet_diagnostic.CA2200.severity = none # Rethrow to preserve stack details — covered by SST1430 dotnet_diagnostic.CA2201.severity = error # Do not raise reserved exception types dotnet_diagnostic.CA2207.severity = error # Initialize value type static fields inline -dotnet_diagnostic.CA2208.severity = none # Instantiate argument exceptions correctly — too sensitive: flags valid context-forwarding nameof(arg.Property) patterns +dotnet_diagnostic.CA2208.severity = none # Instantiate argument exceptions correctly — flags valid nameof forwarding dotnet_diagnostic.CA2211.severity = none # Non-constant fields should not be visible — covered by SST1499 dotnet_diagnostic.CA2213.severity = error # Disposable fields should be disposed dotnet_diagnostic.CA2214.severity = none # Do not call overridable methods in constructors — covered by SST1483 dotnet_diagnostic.CA2215.severity = error # Dispose methods should call base class dispose -dotnet_diagnostic.CA2216.severity = none # Disposable types should declare finalizer — conflicts with SST2317, which owns the owned-native-handle shape and prescribes a SafeHandle instead of a finalizer +dotnet_diagnostic.CA2216.severity = none # Disposable types should declare finalizer — conflicts with SST2317 (SafeHandle) dotnet_diagnostic.CA2217.severity = none # Do not mark enums with FlagsAttribute — covered by SST2303 dotnet_diagnostic.CA2218.severity = error # Override GetHashCode on overriding Equals dotnet_diagnostic.CA2219.severity = error # Do not raise exceptions in finally clauses dotnet_diagnostic.CA2224.severity = none # Override Equals on overloading operator equals — covered by SST2302 dotnet_diagnostic.CA2225.severity = error # Operator overloads have named alternates dotnet_diagnostic.CA2226.severity = error # Operators should have symmetrical overloads -dotnet_diagnostic.CA2227.severity = none # Collection properties should be read only — settable collection properties are common in our DTOs and config types +dotnet_diagnostic.CA2227.severity = none # Collection properties should be read only — settable ones are common in our DTOs dotnet_diagnostic.CA2231.severity = error # Overload operator equals on overriding ValueType.Equals dotnet_diagnostic.CA2234.severity = error # Pass System.Uri objects instead of strings dotnet_diagnostic.CA2241.severity = error # Provide correct arguments to formatting methods @@ -388,7 +389,7 @@ dotnet_diagnostic.CA2243.severity = error # Attribute string literals should par dotnet_diagnostic.CA2244.severity = error # Do not duplicate indexed element initializations dotnet_diagnostic.CA2245.severity = none # Do not assign a property to itself — covered by SST1189 dotnet_diagnostic.CA2246.severity = error # Do not assign a symbol and its member in the same statement -dotnet_diagnostic.CA2247.severity = error # Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum +dotnet_diagnostic.CA2247.severity = error # TaskCompletionSource argument should be a TaskCreationOptions value dotnet_diagnostic.CA2248.severity = error # Provide correct enum argument to Enum.HasFlag dotnet_diagnostic.CA2249.severity = error # Use String.Contains instead of String.IndexOf for substring checks dotnet_diagnostic.CA2250.severity = error # Use ThrowIfCancellationRequested @@ -397,9 +398,9 @@ dotnet_diagnostic.CA2252.severity = error # Opt in to preview features before us dotnet_diagnostic.CA2253.severity = error # Named placeholders should not be numeric values dotnet_diagnostic.CA2254.severity = error # Template should be a static expression dotnet_diagnostic.CA2255.severity = error # The 'ModuleInitializer' attribute should not be used in libraries -dotnet_diagnostic.CA2256.severity = error # All members declared in parent interfaces must have an implementation in a 'DynamicInterfaceCastableImplementation' interface -dotnet_diagnostic.CA2257.severity = error # Members defined in a type with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static' -dotnet_diagnostic.CA2258.severity = error # Providing a 'DynamicInterfaceCastableImplementation' interface in Visual Basic is unsupported +dotnet_diagnostic.CA2256.severity = error # A DynamicInterfaceCastable type must implement all parent interface members +dotnet_diagnostic.CA2257.severity = error # Members of a DynamicInterfaceCastableImplementation type should be static +dotnet_diagnostic.CA2258.severity = error # DynamicInterfaceCastableImplementation is unsupported in Visual Basic dotnet_diagnostic.CA2259.severity = error # 'ThreadStatic' only affects static fields dotnet_diagnostic.CA2260.severity = error # Implement generic math interfaces correctly dotnet_diagnostic.CA2261.severity = error # Do not use 'ConfigureAwaitOptions.SuppressThrowing' with 'Task' @@ -409,9 +410,8 @@ dotnet_diagnostic.CA2264.severity = error # Do not pass a non-nullable value to dotnet_diagnostic.CA2265.severity = error # Do not compare Span to 'null' or 'default' dotnet_diagnostic.CA2266.severity = error # Do not consume the result of 'Span.Enumerator.MoveNext()' more than once dotnet_diagnostic.CA2267.severity = error # Member should not be marked with 'StaticAttribute' -dotnet_diagnostic.CA2268.severity = error # Use 'string.Equals(string, string, StringComparison)' instead of the implicit ordinal overload -# Skipped (deprecated ISerializable formatter): CA2229 Implement serialization constructors, -# CA2235 Mark all non-serializable fields, CA2237 Mark ISerializable types with SerializableAttribute. +dotnet_diagnostic.CA2268.severity = error # Use string.Equals with StringComparison, not the implicit ordinal overload +# Skipped, deprecated ISerializable formatter: CA2229, CA2235, CA2237. # Security @@ -546,18 +546,18 @@ dotnet_diagnostic.SYSLIB0004.severity = error # Constrained Execution Region (CE dotnet_diagnostic.SYSLIB0005.severity = error # Global Assembly Cache is not supported dotnet_diagnostic.SYSLIB0006.severity = error # Thread.Abort is not supported and throws PlatformNotSupportedException dotnet_diagnostic.SYSLIB0007.severity = error # The default implementation of this cryptography algorithm is not supported -dotnet_diagnostic.SYSLIB0008.severity = error # The CreatePdbGenerator API is not supported and throws PlatformNotSupportedException -dotnet_diagnostic.SYSLIB0009.severity = error # The AuthenticationManager Authenticate and PreAuthenticate methods are not supported +dotnet_diagnostic.SYSLIB0008.severity = error # CreatePdbGenerator is not supported and throws +dotnet_diagnostic.SYSLIB0009.severity = error # AuthenticationManager Authenticate/PreAuthenticate are not supported dotnet_diagnostic.SYSLIB0010.severity = error # This Remoting API is not supported and throws PlatformNotSupportedException dotnet_diagnostic.SYSLIB0011.severity = error # BinaryFormatter serialization is obsolete dotnet_diagnostic.SYSLIB0012.severity = error # Assembly.CodeBase and Assembly.EscapedCodeBase are obsolete dotnet_diagnostic.SYSLIB0013.severity = error # Uri.EscapeUriString can corrupt the Uri string -dotnet_diagnostic.SYSLIB0014.severity = error # WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete — use HttpClient +dotnet_diagnostic.SYSLIB0014.severity = error # WebRequest, ServicePoint and WebClient are obsolete — use HttpClient dotnet_diagnostic.SYSLIB0015.severity = error # DisablePrivateReflectionAttribute is not honored dotnet_diagnostic.SYSLIB0016.severity = error # Use Marshal.GetExceptionPointers instead dotnet_diagnostic.SYSLIB0017.severity = error # Strong name signing is not supported on .NET Core dotnet_diagnostic.SYSLIB0018.severity = error # ReflectionOnly loading is not supported -dotnet_diagnostic.SYSLIB0019.severity = error # RuntimeEnvironment members SystemConfigurationFile, GetSystemVersion, and FromGlobalAccessCache are not supported +dotnet_diagnostic.SYSLIB0019.severity = error # RuntimeEnvironment configuration and GAC members are not supported dotnet_diagnostic.SYSLIB0020.severity = error # JsonSerializerOptions.IgnoreNullValues is obsolete — use DefaultIgnoreCondition dotnet_diagnostic.SYSLIB0021.severity = error # Derived cryptographic types are obsolete — use the Create factory methods dotnet_diagnostic.SYSLIB0022.severity = error # Rijndael types are obsolete — use Aes @@ -566,31 +566,31 @@ dotnet_diagnostic.SYSLIB0024.severity = error # Creating and unloading AppDomain dotnet_diagnostic.SYSLIB0025.severity = error # SuppressIldasmAttribute has no effect in .NET 6.0+ dotnet_diagnostic.SYSLIB0026.severity = error # X509Certificate and X509Certificate2 parameterless constructors are obsolete dotnet_diagnostic.SYSLIB0027.severity = error # PublicKey.Key is obsolete — use the appropriate method to get the public key -dotnet_diagnostic.SYSLIB0028.severity = error # X509Certificate2.PrivateKey is obsolete — use the appropriate method to get the private key +dotnet_diagnostic.SYSLIB0028.severity = error # X509Certificate2.PrivateKey is obsolete dotnet_diagnostic.SYSLIB0029.severity = error # ProduceLegacyHmacValues is obsolete dotnet_diagnostic.SYSLIB0030.severity = error # HMACSHA1 always uses the algorithm implementation provided by the platform dotnet_diagnostic.SYSLIB0031.severity = error # EncodingProvider.GetEncoding(int, EncoderFallback, DecoderFallback) is obsolete dotnet_diagnostic.SYSLIB0032.severity = error # Recovery from corrupted process state exceptions is not supported dotnet_diagnostic.SYSLIB0033.severity = error # Rfc2898DeriveBytes.CryptDeriveKey is obsolete -dotnet_diagnostic.SYSLIB0034.severity = error # CmsSigner has been deprecated — use a constructor that accepts a SubjectIdentifierType +dotnet_diagnostic.SYSLIB0034.severity = error # CmsSigner is deprecated — pass a SubjectIdentifierType dotnet_diagnostic.SYSLIB0035.severity = error # ComputeCounterSignature without specifying a CmsSigner is obsolete -dotnet_diagnostic.SYSLIB0036.severity = error # Regex.CompileToAssembly is obsolete and not supported — use the RegexGenerator source generator -dotnet_diagnostic.SYSLIB0037.severity = error # AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete +dotnet_diagnostic.SYSLIB0036.severity = error # Regex.CompileToAssembly is obsolete — use the source generator +dotnet_diagnostic.SYSLIB0037.severity = error # AssemblyName HashAlgorithm and ProcessorArchitecture members are obsolete dotnet_diagnostic.SYSLIB0038.severity = error # SerializationFormat.Binary is obsolete dotnet_diagnostic.SYSLIB0039.severity = error # TLS versions 1.0 and 1.1 have known vulnerabilities and are not recommended dotnet_diagnostic.SYSLIB0040.severity = error # EncryptionPolicy.NoEncryption and AllowEncryption significantly reduce security -dotnet_diagnostic.SYSLIB0041.severity = error # The default iteration count for Rfc2898DeriveBytes parameters is outdated and insecure +dotnet_diagnostic.SYSLIB0041.severity = error # The default Rfc2898DeriveBytes iteration count is insecure dotnet_diagnostic.SYSLIB0042.severity = error # ToXmlString and FromXmlString have no implementation for ECC types -dotnet_diagnostic.SYSLIB0043.severity = error # ECDiffieHellmanPublicKey.ToByteArray() and the associated constructor do not have a consistent and interoperable implementation +dotnet_diagnostic.SYSLIB0043.severity = error # ECDiffieHellmanPublicKey.ToByteArray is not interoperable dotnet_diagnostic.SYSLIB0044.severity = error # AssemblyName.CodeBase and AssemblyName.EscapedCodeBase are obsolete dotnet_diagnostic.SYSLIB0045.severity = error # Cryptographic factory methods accepting an algorithm name are obsolete -dotnet_diagnostic.SYSLIB0046.severity = error # ControlledExecution.Run may corrupt the process and should not be used in production code +dotnet_diagnostic.SYSLIB0046.severity = error # ControlledExecution.Run may corrupt the process dotnet_diagnostic.SYSLIB0047.severity = error # XmlSecureResolver is obsolete -dotnet_diagnostic.SYSLIB0048.severity = error # RSA.EncryptValue and RSA.DecryptValue are not supported and throw NotSupportedException +dotnet_diagnostic.SYSLIB0048.severity = error # RSA.EncryptValue and RSA.DecryptValue are not supported dotnet_diagnostic.SYSLIB0049.severity = error # JsonSerializerOptions.AddContext is obsolete -dotnet_diagnostic.SYSLIB0050.severity = error # Formatter-based serialization (ISerializable, FormatterServices, etc.) is obsolete -dotnet_diagnostic.SYSLIB0051.severity = error # The Exception API ISerializable / GetObjectData formatter-based serialization is obsolete -dotnet_diagnostic.SYSLIB0052.severity = error # Members for assigning to AssemblyName.CodeBase or AssemblyName.EscapedCodeBase are obsolete +dotnet_diagnostic.SYSLIB0050.severity = error # Formatter-based serialization is obsolete +dotnet_diagnostic.SYSLIB0051.severity = error # Exception ISerializable and GetObjectData serialization is obsolete +dotnet_diagnostic.SYSLIB0052.severity = error # Assigning AssemblyName.CodeBase is obsolete dotnet_diagnostic.SYSLIB0053.severity = error # AesGcm should indicate the required tag size for encryption and decryption dotnet_diagnostic.SYSLIB0054.severity = error # Strong name signing is not supported and throws PlatformNotSupportedException dotnet_diagnostic.SYSLIB0055.severity = error # 'Memory.Pin' may be incorrectly used with structures @@ -598,7 +598,7 @@ dotnet_diagnostic.SYSLIB0056.severity = error # LoadFromHash and related members dotnet_diagnostic.SYSLIB0057.severity = error # Use X509CertificateLoader instead to load certificates dotnet_diagnostic.SYSLIB0058.severity = error # KeyExchangeAlgorithm and KeyExchangeStrength are obsolete on SslStream dotnet_diagnostic.SYSLIB0059.severity = error # SystemEvents.EventsThreadShutdown event is obsolete -dotnet_diagnostic.SYSLIB0060.severity = error # Constructors of DirectoryServices.ActiveDirectory.ConfigurationContext are obsolete +dotnet_diagnostic.SYSLIB0060.severity = error # ActiveDirectory ConfigurationContext constructors are obsolete dotnet_diagnostic.SYSLIB0061.severity = error # CryptographyConfig.AddOID and AddAlgorithm methods are obsolete # Source generators @@ -617,7 +617,7 @@ dotnet_diagnostic.SYSLIB1011.severity = error # Logging methods cannot be generi dotnet_diagnostic.SYSLIB1012.severity = error # Logging methods must not have a body dotnet_diagnostic.SYSLIB1013.severity = error # Missing logger argument to logging method dotnet_diagnostic.SYSLIB1015.severity = error # Argument is not referenced from the logging message -dotnet_diagnostic.SYSLIB1016.severity = error # Logging methods cannot have a parameter named the same as one of the template parameters +dotnet_diagnostic.SYSLIB1016.severity = error # A logging method parameter shadows a template parameter name dotnet_diagnostic.SYSLIB1017.severity = error # Logging methods cannot have more than one parameter of type LogLevel dotnet_diagnostic.SYSLIB1018.severity = error # Logging method parameter doesn't appear in template dotnet_diagnostic.SYSLIB1019.severity = error # Couldn't find a field of type ILogger @@ -658,7 +658,7 @@ dotnet_diagnostic.SYSLIB1050.severity = error # Method should be marked 'Library dotnet_diagnostic.SYSLIB1051.severity = error # Specified type is not supported by source-generated P/Invokes dotnet_diagnostic.SYSLIB1052.severity = error # Specified configuration is not supported by source-generated P/Invokes dotnet_diagnostic.SYSLIB1053.severity = error # 'LibraryImportAttribute' requires unsafe code -dotnet_diagnostic.SYSLIB1054.severity = error # Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time +dotnet_diagnostic.SYSLIB1054.severity = error # Use LibraryImport over DllImport for compile-time marshalling dotnet_diagnostic.SYSLIB1055.severity = error # Invalid 'CustomMarshallerAttribute' usage dotnet_diagnostic.SYSLIB1056.severity = error # Specified marshaller type is invalid dotnet_diagnostic.SYSLIB1057.severity = error # Marshaller type does not have the required shape @@ -678,7 +678,7 @@ dotnet_diagnostic.SYSLIB1093.severity = error # Method on 'GeneratedComInterface dotnet_diagnostic.SYSLIB1094.severity = error # Method on 'GeneratedComInterface' has unsupported parameter dotnet_diagnostic.SYSLIB1095.severity = error # Type implements 'GeneratedComInterface' but is not partial dotnet_diagnostic.SYSLIB1096.severity = error # 'GeneratedComClassAttribute' must be applied to a partial type -dotnet_diagnostic.SYSLIB1097.severity = error # 'GeneratedComClassAttribute' type must implement at least one 'GeneratedComInterface' +dotnet_diagnostic.SYSLIB1097.severity = error # A GeneratedComClass type must implement a GeneratedComInterface dotnet_diagnostic.SYSLIB1098.severity = error # 'GeneratedComInterface' interface inheritance not supported # Configuration binding source generator @@ -692,11 +692,7 @@ dotnet_diagnostic.SYSLIB1104.severity = error # Configuration binding source gen # Microsoft .NET Code Style Analyzers (IDE) ################### # Language rules -# EnforceCodeStyleInBuild=true (set in Directory.Build.props) promotes these -# IDE rules into `dotnet build` so they fire at compile time, not just in the -# IDE. We enable the ones that are unambiguous wins and skip the rules that -# conflict with an existing convention (SA1101, SA1200, SA1206, SA1400, SA1633, -# etc.) so we don't double-report. +# EnforceCodeStyleInBuild promotes these into the build; double-reporting rules are off. # Bug catchers — always error. dotnet_diagnostic.IDE0035.severity = none # Remove unreachable code — covered by SST1453 @@ -707,7 +703,7 @@ dotnet_diagnostic.IDE0052.severity = none # Remove unread private member — cov dotnet_diagnostic.IDE0002.severity = none # Simplify member access — covered by SST1117 dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast — covered by SST1175 dotnet_diagnostic.IDE0016.severity = none # Use throw expression — covered by SST2207 -dotnet_diagnostic.IDE0019.severity = none # Use pattern matching to avoid 'as' followed by a 'null' check — covered by SST2005/SST2274 +dotnet_diagnostic.IDE0019.severity = none # Use pattern matching over 'as' plus null check — covered by SST2005/SST2274 dotnet_diagnostic.IDE0028.severity = none # Use collection initializers — covered by SST1194 dotnet_diagnostic.IDE0031.severity = none # Use null propagation — covered by SST1196 dotnet_diagnostic.IDE0038.severity = none # Use pattern matching ('is' check without a cast) — covered by SST2007 @@ -715,10 +711,10 @@ dotnet_diagnostic.IDE0041.severity = none # Use 'is null' check — covered by S dotnet_diagnostic.IDE0042.severity = none # Deconstruct variable declaration — covered by SST2214 dotnet_diagnostic.IDE0044.severity = none # Add readonly modifier — covered by SST1424 dotnet_diagnostic.IDE0047.severity = none # Remove unnecessary parentheses — covered by SST1459 -dotnet_diagnostic.IDE0049.severity = none # Use language keywords instead of framework type names for type references — covered by SST1121 +dotnet_diagnostic.IDE0049.severity = none # Use language keywords over framework type names — covered by SST1121 dotnet_diagnostic.IDE0057.severity = none # Use range operator — covered by SST2204 dotnet_diagnostic.IDE0059.severity = none # Remove unnecessary value assignment — covered by SST2222 -dotnet_diagnostic.IDE0064.severity = none # Make struct fields writable — flag readonly-but-mutable struct fields where intent diverges from declaration +dotnet_diagnostic.IDE0064.severity = none # Make struct fields writable — flags readonly-but-mutable struct fields dotnet_diagnostic.IDE0066.severity = none # Use switch expression — covered by SST2201 dotnet_diagnostic.IDE0075.severity = none # Simplify conditional expression — covered by SST1182 dotnet_diagnostic.IDE0078.severity = none # Use pattern matching — covered by SST2006/SST2231 @@ -741,7 +737,7 @@ dotnet_diagnostic.IDE0026.severity = none # Use expression body for indexers — dotnet_diagnostic.IDE0048.severity = none # Add parentheses for clarity — preference not enforced dotnet_diagnostic.IDE0055.severity = none # Formatting — StyleCop SA rules own formatting dotnet_diagnostic.IDE0058.severity = none # Remove unnecessary expression value — covered by SST2221 -dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter — CA1801 handles (with api_surface config) +dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter — covered by SST1461 dotnet_diagnostic.IDE0061.severity = none # Use expression body for local function — covered by SST2281 dotnet_diagnostic.IDE0079.severity = none # Remove unnecessary suppression — can misfire on multi-TFM suppressions dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure — we don't enforce strict mirror @@ -754,7 +750,7 @@ dotnet_diagnostic.IDE0320.severity = none # Make anonymous function static — c dotnet_diagnostic.IDE0050.severity = none # Convert anonymous type to tuple — covered by SST2224 dotnet_diagnostic.IDE0310.severity = none # Convert lambda expression to method group — handled by RCS1207 dotnet_diagnostic.IDE0360.severity = none # Simplify property accessor — covered by SST2219 -dotnet_diagnostic.IDE0370.severity = none # Remove unnecessary suppression (null-forgiving operator) — disabled for the same reason as RCS1249: multi-TFM nullability annotations can differ per platform +dotnet_diagnostic.IDE0370.severity = none # Remove unnecessary null-forgiving suppression — multi-TFM nullability differs # Language and unnecessary code rules. dotnet_diagnostic.IDE0001.severity = none # Simplify name @@ -821,12 +817,7 @@ dotnet_diagnostic.IDE0380.severity = none # Remove unnecessary unsafe modifier dotnet_diagnostic.IDE1005.severity = none # Use conditional delegate call # Naming and miscellaneous -# Naming conventions — SA1300 family already enforces PascalCase / interface -# prefix / field casing (with our _underscore convention on SA1306/1309/1311 -# deliberately disabled). Leaving IDE1006 off because configuring -# `dotnet_naming_rule.*` would duplicate what SA already enforces and could -# conflict with the _underscore convention. -dotnet_diagnostic.IDE1006.severity = none # Naming rule violation — SA1300 family handles naming +dotnet_diagnostic.IDE1006.severity = none # Naming rule violation — the SA1300 family owns casing and prefixes dotnet_diagnostic.IDE3000.severity = none # Disabled per project convention — not enforced ################### @@ -834,11 +825,11 @@ dotnet_diagnostic.IDE3000.severity = none # Disabled per project convention — ################### # Code simplification dotnet_diagnostic.RCS1001.severity = none # Add braces (when expression spans over multiple lines) — covered by SST1519 -dotnet_diagnostic.RCS1003.severity = none # Add braces to if-else (when expression spans over multiple lines) — covered by SST1519 -dotnet_diagnostic.RCS1005.severity = error # Simplify nested using statement +dotnet_diagnostic.RCS1003.severity = none # Add braces to if-else spanning multiple lines — covered by SST1519 +dotnet_diagnostic.RCS1005.severity = none # Simplify nested using — the stacked form trips SST1503; SST2236 owns this dotnet_diagnostic.RCS1006.severity = none # Merge 'else' with nested 'if' — covered by SST1465 dotnet_diagnostic.RCS1007.severity = error # Add braces -dotnet_diagnostic.RCS1031.severity = none # Remove unnecessary braces in switch section -- we don't mind braces in switch statements +dotnet_diagnostic.RCS1031.severity = none # Remove unnecessary braces in switch section — braces there are deliberate dotnet_diagnostic.RCS1032.severity = error # Remove redundant parentheses dotnet_diagnostic.RCS1033.severity = none # Remove redundant boolean literal — covered by SST1143 dotnet_diagnostic.RCS1039.severity = none # Remove argument list from attribute — covered by SST1411 @@ -855,27 +846,27 @@ dotnet_diagnostic.RCS1071.severity = none # Remove redundant base constructor ca dotnet_diagnostic.RCS1072.severity = none # Remove empty namespace declaration — covered by SST1435 dotnet_diagnostic.RCS1073.severity = none # Convert 'if' to 'return' statement — covered by SST1197 dotnet_diagnostic.RCS1074.severity = none # Remove redundant constructor — covered by SST1433 -dotnet_diagnostic.RCS1078.severity = none # Use "" or 'string.Empty' — conflicts with SST1122, which owns the string.Empty direction +dotnet_diagnostic.RCS1078.severity = none # Use "" or string.Empty — conflicts with SST1122, which owns the direction dotnet_diagnostic.RCS1084.severity = none # Use coalesce expression instead of conditional expression — covered by SST1195 dotnet_diagnostic.RCS1085.severity = none # Use auto-implemented property — covered by SST1420 -dotnet_diagnostic.RCS1089.severity = error # Use --/++ operator instead of assignment -dotnet_diagnostic.RCS1097.severity = error # Remove redundant 'ToString' call +dotnet_diagnostic.RCS1089.severity = none # Use --/++ operator instead of assignment — covered by SST2284 +dotnet_diagnostic.RCS1097.severity = none # Remove redundant 'ToString' call — covered by SST2286 dotnet_diagnostic.RCS1103.severity = error # Convert 'if' to assignment -dotnet_diagnostic.RCS1104.severity = none # Simplify conditional expression — covered by SST1182 +dotnet_diagnostic.RCS1104.severity = none # Simplify conditional expression — covered by SST1182/SST2288 dotnet_diagnostic.RCS1105.severity = error # Unnecessary interpolation dotnet_diagnostic.RCS1106.severity = none # Remove empty destructor — covered by PSH1002 dotnet_diagnostic.RCS1107.severity = none # Remove redundant 'ToCharArray' call — covered by PSH1217 dotnet_diagnostic.RCS1114.severity = error # Remove redundant delegate creation -dotnet_diagnostic.RCS1124.severity = error # Inline local variable +dotnet_diagnostic.RCS1124.severity = none # Inline local variable — duplicates SST2266 and cannot hold with SST2275 dotnet_diagnostic.RCS1126.severity = error # Add braces to if-else dotnet_diagnostic.RCS1128.severity = error # Use coalesce expression dotnet_diagnostic.RCS1129.severity = none # Remove redundant field initialization — covered by SST1176 dotnet_diagnostic.RCS1132.severity = none # Remove redundant overriding member — covered by SST1181 dotnet_diagnostic.RCS1133.severity = error # Remove redundant Dispose/Close call dotnet_diagnostic.RCS1134.severity = none # Remove redundant statement — covered by SST1174 -dotnet_diagnostic.RCS1143.severity = error # Simplify coalesce expression +dotnet_diagnostic.RCS1143.severity = none # Simplify coalesce expression — covered by SST2453 dotnet_diagnostic.RCS1145.severity = error # Remove redundant 'as' operator -dotnet_diagnostic.RCS1146.severity = error # Use conditional access +dotnet_diagnostic.RCS1146.severity = none # Use conditional access — covered by SST2285 dotnet_diagnostic.RCS1151.severity = none # Remove redundant cast — covered by SST1175 dotnet_diagnostic.RCS1171.severity = error # Simplify lazy initialization dotnet_diagnostic.RCS1173.severity = error # Use coalesce expression instead of 'if' @@ -886,37 +877,37 @@ dotnet_diagnostic.RCS1188.severity = none # Remove redundant auto-property initi dotnet_diagnostic.RCS1192.severity = none # Unnecessary usage of verbatim string literal — covered by SST1184 dotnet_diagnostic.RCS1199.severity = error # Unnecessary null check dotnet_diagnostic.RCS1206.severity = error # Use conditional access instead of conditional expression -dotnet_diagnostic.RCS1207.severity = none # Use anonymous function or method group — conflicts with SST2239, which owns the method-group direction +dotnet_diagnostic.RCS1207.severity = none # Use anonymous function or method group — conflicts with SST2239 dotnet_diagnostic.RCS1211.severity = none # Remove unnecessary 'else' — covered by SST1464 dotnet_diagnostic.RCS1212.severity = error # Remove redundant assignment dotnet_diagnostic.RCS1214.severity = none # Unnecessary interpolated string — covered by SST1183 -dotnet_diagnostic.RCS1216.severity = error # Unnecessary unsafe context -dotnet_diagnostic.RCS1217.severity = none # Convert interpolated string to concatenation — reverses SST2249, which owns the concatenation-to-interpolation direction +dotnet_diagnostic.RCS1216.severity = none # Unnecessary unsafe context — covered by SST1455 +dotnet_diagnostic.RCS1217.severity = none # Convert interpolated string to concatenation — reverses SST2249 dotnet_diagnostic.RCS1218.severity = error # Simplify code branching -dotnet_diagnostic.RCS1220.severity = none # Use pattern matching instead of combination of 'is' and cast — covered by SST2007 -dotnet_diagnostic.RCS1221.severity = error # Use pattern matching instead of combination of 'as' and null check +dotnet_diagnostic.RCS1220.severity = none # Use pattern matching over 'is' plus cast — covered by SST2007 +dotnet_diagnostic.RCS1221.severity = none # Use pattern matching instead of combination of 'as' and null check — covered by SST2274 dotnet_diagnostic.RCS1238.severity = none # Avoid nested ?: operators — covered by SST1147 dotnet_diagnostic.RCS1244.severity = none # Simplify 'default' expression — covered by SST1188 -dotnet_diagnostic.RCS1249.severity = none # Unnecessary null-forgiving operator — disabled because multi-TFM nullability annotations can differ per platform, leading to false positives +dotnet_diagnostic.RCS1249.severity = none # Unnecessary null-forgiving operator — multi-TFM nullability differs dotnet_diagnostic.RCS1251.severity = error # Remove unnecessary braces from record declaration dotnet_diagnostic.RCS1259.severity = error # Remove empty syntax (replaces RCS1066) dotnet_diagnostic.RCS1262.severity = error # Unnecessary raw string literal dotnet_diagnostic.RCS1265.severity = none # Remove redundant catch block — covered by SST1470 -dotnet_diagnostic.RCS1268.severity = error # Simplify numeric comparison +dotnet_diagnostic.RCS1268.severity = none # Simplify numeric comparison — covered by SST2447 # Code quality dotnet_diagnostic.RCS1013.severity = none # Use predefined type — covered by SST1121 dotnet_diagnostic.RCS1014.severity = error # Use explicitly/implicitly typed array dotnet_diagnostic.RCS1015.severity = error # Use nameof operator -dotnet_diagnostic.RCS1016.severity = none # Use block body or expression body — conflicts with SST2219, which owns the expression-bodied accessor direction +dotnet_diagnostic.RCS1016.severity = none # Use block body or expression body — conflicts with SST2219 dotnet_diagnostic.RCS1020.severity = none # Covered by SST2234 (canonical) dotnet_diagnostic.RCS1021.severity = error # Convert lambda expression body to expression body dotnet_diagnostic.RCS1044.severity = none # Remove original exception from throw statement — covered by SST1430 -dotnet_diagnostic.RCS1046.severity = none # Asynchronous method name should end with 'Async' — TUnit test method naming convention doesn't follow the Async suffix — covered by SST1317 +dotnet_diagnostic.RCS1046.severity = none # Async method name should end with 'Async' — covered by SST1317 dotnet_diagnostic.RCS1047.severity = error # Non-asynchronous method name should not end with 'Async' dotnet_diagnostic.RCS1048.severity = none # Use lambda expression instead of anonymous method — covered by SST1130 dotnet_diagnostic.RCS1050.severity = error # Include/omit parentheses when creating new object -dotnet_diagnostic.RCS1051.severity = none # Add/remove parentheses from condition in conditional operator — conflicts with SST1459, which owns the non-grouping-parenthesis removal direction +dotnet_diagnostic.RCS1051.severity = none # Parentheses around a conditional's condition — conflicts with SST1459 dotnet_diagnostic.RCS1056.severity = none # Avoid usage of using alias directive - used to avoid conflicts dotnet_diagnostic.RCS1059.severity = none # Avoid locking on publicly accessible instance — covered by SST1901 dotnet_diagnostic.RCS1075.severity = none # Avoid empty catch clause that catches System.Exception — covered by SST1429 @@ -925,21 +916,21 @@ dotnet_diagnostic.RCS1081.severity = error # Split variable declaration dotnet_diagnostic.RCS1093.severity = error # File contains no code dotnet_diagnostic.RCS1094.severity = none # Declare using directive on top level — covered by SST1200 dotnet_diagnostic.RCS1096.severity = none # Use 'HasFlag' method or bitwise operator — covered by PSH1016 -dotnet_diagnostic.RCS1098.severity = none # Constant values should be placed on right side of comparisons — covered by SST1186 +dotnet_diagnostic.RCS1098.severity = none # Constant should be on the right of a comparison — covered by SST1186 dotnet_diagnostic.RCS1099.severity = none # Default label should be the last label in a switch section — covered by SST1466 dotnet_diagnostic.RCS1102.severity = none # Make class static — covered by SST1432 dotnet_diagnostic.RCS1108.severity = error # Add 'static' modifier to all partial class declarations -dotnet_diagnostic.RCS1111.severity = error # Add braces to switch section with multiple statements -dotnet_diagnostic.RCS1113.severity = error # Use 'string.IsNullOrEmpty' method +dotnet_diagnostic.RCS1111.severity = none # Add braces to switch section with multiple statements — covered by SST1525 +dotnet_diagnostic.RCS1113.severity = none # Use 'string.IsNullOrEmpty' method — covered by SST2255 dotnet_diagnostic.RCS1118.severity = none # Mark local variable as const — covered by PSH1402 dotnet_diagnostic.RCS1123.severity = none # Add parentheses when necessary — covered by SST1407 dotnet_diagnostic.RCS1130.severity = none # Bitwise operation on enum without Flags attribute — covered by SST2458 -dotnet_diagnostic.RCS1135.severity = error # Declare enum member with zero value (when enum has FlagsAttribute) +dotnet_diagnostic.RCS1135.severity = none # Declare enum member with zero value (when enum has FlagsAttribute) — covered by SST2329 dotnet_diagnostic.RCS1136.severity = none # Merge switch sections with equivalent content — covered by SST2414 -dotnet_diagnostic.RCS1154.severity = error # Sort enum members +dotnet_diagnostic.RCS1154.severity = none # Sort enum members — covered by SST1222 dotnet_diagnostic.RCS1155.severity = none # Use StringComparison when comparing strings — covered by PSH1207 dotnet_diagnostic.RCS1156.severity = none # Use string.Length instead of comparison with empty string — covered by PSH1204 -dotnet_diagnostic.RCS1157.severity = none # Composite enum value contains undefined flag — covered by SST2303 +dotnet_diagnostic.RCS1157.severity = none # Composite enum value contains undefined flag — covered by SST2461 dotnet_diagnostic.RCS1159.severity = error # Use EventHandler dotnet_diagnostic.RCS1160.severity = none # Abstract type should not have public constructors — covered by SST1428 dotnet_diagnostic.RCS1161.severity = none # Enum should declare explicit values - do not need explicit values @@ -947,43 +938,43 @@ dotnet_diagnostic.RCS1162.severity = none # Avoid chain of assignments — cover dotnet_diagnostic.RCS1166.severity = none # Value type object is never equal to null — covered by SST1469 dotnet_diagnostic.RCS1168.severity = none # Parameter name differs from base name — covered by SST1318 dotnet_diagnostic.RCS1169.severity = error # Make field read-only -dotnet_diagnostic.RCS1170.severity = error # Use read-only auto-implemented property +dotnet_diagnostic.RCS1170.severity = none # Use read-only auto-implemented property — covered by SST2332 dotnet_diagnostic.RCS1172.severity = none # Use 'is' operator instead of 'as' operator — covered by SST2005 dotnet_diagnostic.RCS1187.severity = none # Use constant instead of field — covered by PSH1402 dotnet_diagnostic.RCS1191.severity = error # Declare enum value as combination of names dotnet_diagnostic.RCS1193.severity = none # Overriding member should not change 'params' modifier — covered by SST2426 -dotnet_diagnostic.RCS1196.severity = error # Call extension method as instance method +dotnet_diagnostic.RCS1196.severity = none # Call extension method as instance method — covered by SST2256 dotnet_diagnostic.RCS1200.severity = none # Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy' — covered by PSH1108 dotnet_diagnostic.RCS1201.severity = error # Use method chaining -dotnet_diagnostic.RCS1202.severity = error # Avoid NullReferenceException -dotnet_diagnostic.RCS1204.severity = error # Use EventArgs.Empty -dotnet_diagnostic.RCS1205.severity = error # Order named arguments according to the order of parameters +dotnet_diagnostic.RCS1202.severity = none # Avoid NullReferenceException — covered by SST2454 +dotnet_diagnostic.RCS1204.severity = none # Use EventArgs.Empty — covered by PSH1022 +dotnet_diagnostic.RCS1205.severity = none # Order named arguments according to the order of parameters — covered by SST1220 dotnet_diagnostic.RCS1208.severity = error # Reduce 'if' nesting -dotnet_diagnostic.RCS1209.severity = error # Order type parameter constraints +dotnet_diagnostic.RCS1209.severity = none # Order type parameter constraints — covered by SST1221 dotnet_diagnostic.RCS1210.severity = none # Return completed task instead of returning null — covered by PSH1312 dotnet_diagnostic.RCS1215.severity = error # Expression is always equal to true/false dotnet_diagnostic.RCS1222.severity = error # Merge preprocessor directives -dotnet_diagnostic.RCS1223.severity = suggestion # Mark publicly visible type with DebuggerDisplay attribute — only data types benefit; the rule is too broad to be an error +dotnet_diagnostic.RCS1223.severity = suggestion # Mark visible types with DebuggerDisplay — too broad to be an error dotnet_diagnostic.RCS1224.severity = error # Make method an extension method dotnet_diagnostic.RCS1225.severity = error # Make class sealed dotnet_diagnostic.RCS1227.severity = none # Validate arguments correctly — covered by SST2404 dotnet_diagnostic.RCS1229.severity = error # Use async/await when necessary dotnet_diagnostic.RCS1231.severity = none # Make parameter ref read-only — covered by PSH1007 dotnet_diagnostic.RCS1233.severity = none # Use short-circuiting operator — covered by SST1468 -dotnet_diagnostic.RCS1234.severity = error # Duplicate enum value -dotnet_diagnostic.RCS1239.severity = error # Use 'for' statement instead of 'while' statement +dotnet_diagnostic.RCS1234.severity = none # Duplicate enum value — covered by SST2455 +dotnet_diagnostic.RCS1239.severity = none # Use 'for' statement instead of 'while' statement — covered by SST2287 dotnet_diagnostic.RCS1240.severity = error # Operator is unnecessary dotnet_diagnostic.RCS1242.severity = none # Do not pass non-read-only struct by read-only reference — covered by PSH1003 dotnet_diagnostic.RCS1243.severity = none # Duplicate word in a comment — covered by SST1658 (documentation comments) dotnet_diagnostic.RCS1247.severity = error # Fix documentation comment tag -dotnet_diagnostic.RCS1248.severity = none # Normalize null check — conflicts with SST1149, which owns the 'is null' pattern direction -dotnet_diagnostic.RCS1250.severity = none # Use implicit/explicit object creation — conflicts with SST2202, which owns the implicit-target-type direction +dotnet_diagnostic.RCS1248.severity = none # Normalize null check — conflicts with SST1149, which owns 'is null' +dotnet_diagnostic.RCS1250.severity = none # Use implicit/explicit object creation — conflicts with SST2202 dotnet_diagnostic.RCS1252.severity = error # Normalize usage of infinite loop dotnet_diagnostic.RCS1254.severity = error # Normalize format of enum flag value -dotnet_diagnostic.RCS1255.severity = none # Simplify argument null check — conflicts with our ArgumentExceptionHelper helper pattern +dotnet_diagnostic.RCS1255.severity = none # Simplify argument null check — conflicts with our ArgumentExceptionHelper dotnet_diagnostic.RCS1257.severity = error # Use enum field explicitly dotnet_diagnostic.RCS1258.severity = error # Unnecessary enum flag -dotnet_diagnostic.RCS1260.severity = none # Add/remove trailing comma — conflicts with SST1413, which owns the trailing-comma direction +dotnet_diagnostic.RCS1260.severity = none # Add/remove trailing comma — conflicts with SST1413 dotnet_diagnostic.RCS1261.severity = none # Resource can be disposed asynchronously — covered by PSH1310 dotnet_diagnostic.RCS1264.severity = error # Use 'var' or explicit type (replaces RCS1010, RCS1176, RCS1177) dotnet_diagnostic.RCS1266.severity = none # Use raw string literal — covered by SST2243 @@ -993,32 +984,32 @@ dotnet_diagnostic.RCS1267.severity = error # Use string interpolation instead of dotnet_diagnostic.RCS1077.severity = none # Covered by the PSH1101-PSH1111 family (canonical) dotnet_diagnostic.RCS1080.severity = none # Covered by PSH1106 (canonical) dotnet_diagnostic.RCS1112.severity = none # Combine 'Enumerable.Where' method chain — covered by PSH1109 -dotnet_diagnostic.RCS1186.severity = error # Use Regex instance instead of static method -dotnet_diagnostic.RCS1190.severity = none # Join string expressions — conflicts with SST2470, which reports the fused-literal seam this would create -dotnet_diagnostic.RCS1195.severity = error # Use ^ operator +dotnet_diagnostic.RCS1186.severity = none # Use Regex instance instead of static method — covered by PSH1421 +dotnet_diagnostic.RCS1190.severity = none # Join string expressions — conflicts with SST2470 (fused literal seam) +dotnet_diagnostic.RCS1195.severity = none # Use ^ operator — covered by SST2261 dotnet_diagnostic.RCS1197.severity = none # Optimize StringBuilder.Append/AppendLine call — covered by PSH1203/PSH1214 -dotnet_diagnostic.RCS1198.severity = none # Avoid unnecessary boxing of value type — boxing is unavoidable bridging Rx and IEnumerable +dotnet_diagnostic.RCS1198.severity = none # Avoid unnecessary boxing — unavoidable bridging Rx and IEnumerable dotnet_diagnostic.RCS1230.severity = none # Unnecessary explicit use of enumerator — covered by SST1467 dotnet_diagnostic.RCS1235.severity = error # Optimize method call dotnet_diagnostic.RCS1236.severity = none # Use exception filter — covered by SST2009 dotnet_diagnostic.RCS1246.severity = none # Use element access — covered by PSH1106 # Maintainability -dotnet_diagnostic.RCS1158.severity = none # Static member in generic type should use a type parameter — common factory pattern — covered by SST1431 -dotnet_diagnostic.RCS1163.severity = none # Unused parameter — interface implementations and Rx selectors often have unused parameters -dotnet_diagnostic.RCS1164.severity = none # Unused type parameter - DUPLICATE IDE0060 (UnusedParameter analyzer 210ms; IDE0060 bundled at lower cost) -dotnet_diagnostic.RCS1165.severity = none # Unconstrained type parameter checked for null - we validate all parameters for non-nullable enabled platforms +dotnet_diagnostic.RCS1158.severity = none # Static member in generic type should use a type parameter — covered by SST1431 +dotnet_diagnostic.RCS1163.severity = none # Unused parameter — interface impls and Rx selectors often have them +dotnet_diagnostic.RCS1164.severity = none # Unused type parameter — covered by IDE0060 at lower cost +dotnet_diagnostic.RCS1165.severity = none # Unconstrained type parameter checked for null — we validate all parameters dotnet_diagnostic.RCS1182.severity = none # Remove redundant base interface — covered by SST1177 dotnet_diagnostic.RCS1213.severity = none # Remove unused member declaration - DUPLICATE IDE0051 (slower: 230ms vs 75ms) dotnet_diagnostic.RCS1241.severity = error # Implement non-generic counterpart -dotnet_diagnostic.RCS1256.severity = none # Invalid argument null check — conflicts with our ArgumentExceptionHelper helper pattern +dotnet_diagnostic.RCS1256.severity = none # Invalid argument null check — conflicts with our ArgumentExceptionHelper # Documentation dotnet_diagnostic.RCS1181.severity = error # Convert comment to documentation comment -dotnet_diagnostic.RCS1189.severity = error # Add or remove region name -dotnet_diagnostic.RCS1226.severity = none # Add paragraph to documentation comment — <para> wrapping is subjective and adds noise +dotnet_diagnostic.RCS1189.severity = none # Add or remove region name — covered by SST1124 +dotnet_diagnostic.RCS1226.severity = none # Add paragraph to documentation comment — para wrapping adds noise dotnet_diagnostic.RCS1228.severity = error # Unused element in a documentation comment -dotnet_diagnostic.RCS1232.severity = error # Order elements in documentation comment +dotnet_diagnostic.RCS1232.severity = none # Order elements in documentation comment — covered by SST1666 dotnet_diagnostic.RCS1253.severity = error # Format documentation comment summary dotnet_diagnostic.RCS1263.severity = none # Invalid reference in a documentation comment @@ -1038,7 +1029,7 @@ dotnet_diagnostic.RCS1141.severity = none # Add 'param' element to documentation dotnet_diagnostic.RCS1142.severity = none # Add 'typeparam' element to documentation comment — covered by SA1618 dotnet_diagnostic.RCS1175.severity = none # Unused 'this' parameter — covered by CA1822 dotnet_diagnostic.RCS1194.severity = none # Implement exception constructors — covered by CA1032 -dotnet_diagnostic.RCS1203.severity = none # Use AttributeUsageAttribute — covered by CA1018 +dotnet_diagnostic.RCS1203.severity = none # Use AttributeUsageAttribute — covered by SST2336 # Formatting dotnet_diagnostic.RCS0001.severity = none # Add blank line after embedded statement — covered by StyleCop layout rules @@ -1050,9 +1041,9 @@ dotnet_diagnostic.RCS0007.severity = none # Add blank line between accessors — dotnet_diagnostic.RCS0008.severity = none # Add blank line between closing brace and next statement — covered by SA1513 dotnet_diagnostic.RCS0009.severity = none # Add blank line between declaration and documentation comment — covered by SA1514 dotnet_diagnostic.RCS0010.severity = none # Add blank line between declarations — covered by SA1516 -dotnet_diagnostic.RCS0011.severity = none # Add/remove blank line between single-line accessors — StyleCop already governs this +dotnet_diagnostic.RCS0011.severity = none # Blank line between single-line accessors — covered by the layout rules dotnet_diagnostic.RCS0012.severity = none # Add blank line between single-line declarations — covered by SA1516 -dotnet_diagnostic.RCS0013.severity = none # Add blank line between single-line declarations of different kind — covered by SA1516 +dotnet_diagnostic.RCS0013.severity = none # Blank line between single-line declarations of different kind — SA1516 dotnet_diagnostic.RCS0015.severity = none # Add/remove blank line between using directives — covered by SA1209 / SA1210 dotnet_diagnostic.RCS0016.severity = none # Put attribute list on its own line — StyleCop SA1133 governs attribute lists dotnet_diagnostic.RCS0020.severity = none # Format accessor's braces — covered by SA1500 @@ -1067,12 +1058,12 @@ dotnet_diagnostic.RCS0030.severity = none # Put embedded statement on its own li dotnet_diagnostic.RCS0031.severity = none # Put enum member on its own line — covered by SA1136 dotnet_diagnostic.RCS0032.severity = none # Place new line after/before arrow token — StyleCop wrapping rules cover this dotnet_diagnostic.RCS0033.severity = none # Put statement on its own line — covered by SA1505 family -dotnet_diagnostic.RCS0034.severity = none # Put type parameter constraint on its own line — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0036.severity = none # Remove blank line between single-line declarations of same kind — covered by SA1516 +dotnet_diagnostic.RCS0034.severity = none # Put type parameter constraint on its own line — covered by wrapping rules +dotnet_diagnostic.RCS0036.severity = none # Remove blank line between single-line declarations — covered by SA1516 dotnet_diagnostic.RCS0039.severity = none # Remove new line before base list — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0041.severity = none # Remove new line between 'if' keyword and 'else' keyword — StyleCop layout rules cover this +dotnet_diagnostic.RCS0041.severity = none # Remove new line between 'if' and 'else' — covered by the layout rules dotnet_diagnostic.RCS0042.severity = none # Put auto-accessors on a single line — formatting preference, not enforced -dotnet_diagnostic.RCS0044.severity = none # Use carriage return + linefeed as new line — handled by .gitattributes / editorconfig end_of_line +dotnet_diagnostic.RCS0044.severity = none # Use CRLF as new line — handled by .gitattributes / end_of_line dotnet_diagnostic.RCS0045.severity = none # Use linefeed as new line — handled by .gitattributes / editorconfig end_of_line dotnet_diagnostic.RCS0046.severity = none # Use spaces instead of tab — handled by editorconfig indent_style dotnet_diagnostic.RCS0048.severity = none # Put initializer on a single line — formatting preference, not enforced @@ -1086,7 +1077,7 @@ dotnet_diagnostic.RCS0055.severity = none # Fix formatting of a binary expressio dotnet_diagnostic.RCS0056.severity = none # A line is too long — line-length not enforced dotnet_diagnostic.RCS0057.severity = none # Normalize whitespace at the beginning of a file — handled by editorconfig dotnet_diagnostic.RCS0058.severity = none # Normalize whitespace at the end of a file — covered by SST1518 -dotnet_diagnostic.RCS0059.severity = none # Place new line after/before null-conditional operator — StyleSharp wrapping rules cover this +dotnet_diagnostic.RCS0059.severity = none # New line around the null-conditional operator — covered by wrapping rules dotnet_diagnostic.RCS0060.severity = none # Add/remove line after file scoped namespace declaration — formatting preference dotnet_diagnostic.RCS0061.severity = none # Add/remove blank line between switch sections — formatting preference dotnet_diagnostic.RCS0062.severity = none # Put expression body on its own line — formatting preference @@ -1098,25 +1089,23 @@ dotnet_diagnostic.RCS0063.severity = none # Remove unnecessary blank line — co file_header_template = Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved.\nReactiveUI Association Incorporated licenses this file to you under the MIT license.\nSee the LICENSE file in the project root for full license information. stylesharp.summary_single_line_max_length = 120 -# SonarAnalyzer's S4022 only ever flagged storage narrower than int; uint, long and ulong -# passed silently. Match that, so retiring S4022 for SST2313 does not fail a build on an -# enum that was deliberately widened. -stylesharp.SST2313.allowed_enum_storage = int, uint, long, ulong +stylesharp.SST2313.allowed_enum_storage = int, uint, long, ulong # deliberately widened enums stay legal -# Documentation coverage scope (SST1600/SST1601/SST1602/SST1654). -# Require documentation on every element, including private members. -stylesharp.document_exposed_elements = true +stylesharp.document_exposed_elements = true # Documentation coverage — every element, private members included stylesharp.document_internal_elements = true stylesharp.document_private_elements = true stylesharp.document_private_fields = true stylesharp.document_interfaces = all stylesharp.SST1305.allowed_hungarian_prefixes = rx +stylesharp.tuple_element_naming = pascal_case # SST1316 stylesharp.instance_member_qualification = omit_this +stylesharp.use_var = always # SST2271; matches the csharp_style_var_* preferences above stylesharp.max_cyclomatic_complexity = 10 stylesharp.max_cognitive_complexity = 15 stylesharp.max_property_cognitive_complexity = 3 -# SST1484 also reports a field that shadows one inherited from a base type. -stylesharp.SST1484.check_base_types = true +stylesharp.SST1484.check_base_types = true # also report a field shadowed from a base type + +stylesharp.SST2403.allowed_escape_methods = WhenActivated, ToProperty # both hand this straight back, so nothing observes a half-built instance stylesharp.max_line_length = 200 # SST1521 (characters; keeps the limit this repo has always enforced) stylesharp.max_file_lines = 1000 # SST1522 (code lines; blank lines and comments do not count) # stylesharp.max_member_lines = 60 # SST1523 (code lines) @@ -1135,7 +1124,7 @@ dotnet_diagnostic.SST1006.severity = error # A preprocessor keyword is preceded dotnet_diagnostic.SST1007.severity = error # An operator keyword is not followed by a space dotnet_diagnostic.SST1008.severity = error # An opening parenthesis is followed by a space dotnet_diagnostic.SST1009.severity = error # A closing parenthesis is preceded by a space -dotnet_diagnostic.SST1010.severity = none # An opening square bracket has adjacent whitespace — conflicts with modern collection expressions +dotnet_diagnostic.SST1010.severity = none # Opening square bracket has adjacent whitespace — collection expressions need it dotnet_diagnostic.SST1011.severity = error # A closing square bracket is preceded by a space dotnet_diagnostic.SST1012.severity = error # An opening brace is not followed by a space on a single line dotnet_diagnostic.SST1013.severity = error # A closing brace is not preceded by a space on a single line @@ -1172,15 +1161,15 @@ dotnet_diagnostic.SST1114.severity = error # A blank line separates the declarat dotnet_diagnostic.SST1115.severity = error # A blank line separates a parameter from the preceding comma dotnet_diagnostic.SST1116.severity = error # A qualified name can be shortened without changing the symbol it binds to dotnet_diagnostic.SST1117.severity = error # Instance member access follows the configured this. qualification style -dotnet_diagnostic.SST1118.severity = none # A parameter should not span multiple lines +dotnet_diagnostic.SST1118.severity = none # A parameter spanning multiple lines — collides with the 200-char line limit dotnet_diagnostic.SST1119.severity = error # A numeric literal groups its digit separators irregularly dotnet_diagnostic.SST1120.severity = error # A comment contains no text -dotnet_diagnostic.SST1121.severity = error # A framework type name is used instead of its built-in alias (opt-in rule, enabled here) +dotnet_diagnostic.SST1121.severity = error # A framework type name is used instead of its built-in alias dotnet_diagnostic.SST1122.severity = error # An empty string literal is used instead of string.Empty dotnet_diagnostic.SST1123.severity = error # A #region is placed inside a code element body dotnet_diagnostic.SST1124.severity = error # A #region directive is used dotnet_diagnostic.SST1125.severity = error # A Nullable type is written in long form instead of the T? shorthand -dotnet_diagnostic.SST1127.severity = error # A generic type constraint shares a line with the declaration or another constraint +dotnet_diagnostic.SST1127.severity = error # A generic type constraint shares a line with another constraint dotnet_diagnostic.SST1128.severity = error # A constructor initializer shares a line with the constructor signature dotnet_diagnostic.SST1129.severity = error # A value type is created with a parameterless constructor call instead of default dotnet_diagnostic.SST1130.severity = error # An anonymous delegate is used where a lambda expression is clearer @@ -1245,7 +1234,7 @@ dotnet_diagnostic.SST1188.severity = error # Use the 'default' literal instead o dotnet_diagnostic.SST1189.severity = error # Variables should not be self-assigned dotnet_diagnostic.SST1190.severity = error # Doubled negation operators should be removed dotnet_diagnostic.SST1191.severity = error # Long numeric literals should use digit separators -dotnet_diagnostic.SST1192.severity = none # Control characters in string literals should be escaped +dotnet_diagnostic.SST1192.severity = error # Control characters in string literals should be escaped dotnet_diagnostic.SST1193.severity = error # Keep initial member values with construction dotnet_diagnostic.SST1194.severity = error # Keep initial collection values with construction dotnet_diagnostic.SST1195.severity = error # Write null fallback with ?? @@ -1275,31 +1264,32 @@ dotnet_diagnostic.SST1216.severity = error # Using static directives should be p dotnet_diagnostic.SST1217.severity = error # Using static directives should be ordered alphabetically dotnet_diagnostic.SST1218.severity = error # Other members separate a method's overloads dotnet_diagnostic.SST1219.severity = error # A switch default clause is not placed last -dotnet_diagnostic.SST1220.severity = error # An all-named argument list is in a different order than the parameters. Code fix reorders it to declaration order. Info. -dotnet_diagnostic.SST1221.severity = error # `where` constraint clauses are not ordered to match the type-parameter list. Code fix reorders them. Info. +dotnet_diagnostic.SST1220.severity = error # An all-named argument list is not in declaration order +dotnet_diagnostic.SST1221.severity = error # where constraint clauses do not match the type-parameter order +dotnet_diagnostic.SST1222.severity = error # An enum with explicit values declares them out of ascending order # Naming -dotnet_diagnostic.SST1300.severity = none # Types and members should be PascalCase — naming duplicates existing analyzers +dotnet_diagnostic.SST1300.severity = error # Types and members should be PascalCase dotnet_diagnostic.SST1302.severity = error # Interface names should begin with I dotnet_diagnostic.SST1303.severity = error # Const names should be PascalCase dotnet_diagnostic.SST1304.severity = error # Non-private readonly fields should be PascalCase dotnet_diagnostic.SST1305.severity = error # Field names should not use Hungarian notation -dotnet_diagnostic.SST1306.severity = none # Field names should begin with a lower-case letter — private fields use _camelCase here +dotnet_diagnostic.SST1306.severity = none # Field names should begin lower-case — private fields use _camelCase here dotnet_diagnostic.SST1307.severity = error # Accessible fields should be PascalCase -dotnet_diagnostic.SST1308.severity = none # Field names should not be prefixed with m_ or s_ — too broad for existing conventions +dotnet_diagnostic.SST1308.severity = none # Field names should not use m_ or s_ prefixes — too broad for our conventions dotnet_diagnostic.SST1309.severity = error # Private fields should be _camelCase dotnet_diagnostic.SST1310.severity = none # Field names should not contain underscores — conflicts with _camelCase -dotnet_diagnostic.SST1311.severity = none # Static readonly fields should be PascalCase — we use _camelCase for private static readonly too +dotnet_diagnostic.SST1311.severity = none # Static readonly fields should be PascalCase — we use _camelCase there too dotnet_diagnostic.SST1312.severity = error # Local variables should be camelCase dotnet_diagnostic.SST1313.severity = error # Parameters should be camelCase dotnet_diagnostic.SST1314.severity = error # Type parameters should begin with T dotnet_diagnostic.SST1315.severity = error # Union member names should match the configured casing -dotnet_diagnostic.SST1316.severity = none # Tuple element names should use the configured casing — tuple naming is not enforced here -dotnet_diagnostic.SST1317.severity = none # Asynchronous method names should end with 'Async' — conflicts with this project's Rx-compatibility and naming mechanism +dotnet_diagnostic.SST1316.severity = error # Tuple element names should use the configured casing +dotnet_diagnostic.SST1317.severity = none # Async method names should end with 'Async' — conflicts with our Rx naming dotnet_diagnostic.SST1318.severity = error # Overriding parameter names should match the base declaration dotnet_diagnostic.SST1319.severity = error # An enumeration's type name is not PascalCase dotnet_diagnostic.SST1320.severity = error # A parameter name matches its method's name -dotnet_diagnostic.SST1321.severity = none # Public APIs intentionally use Async to describe asynchronous observable behavior without returning an awaitable. +dotnet_diagnostic.SST1321.severity = none # Async naming without an awaitable return — deliberate on our public APIs # Maintainability dotnet_diagnostic.SST1400.severity = error # An element does not declare an access modifier @@ -1313,12 +1303,12 @@ dotnet_diagnostic.SST1407.severity = error # Mixed-precedence arithmetic is not dotnet_diagnostic.SST1408.severity = error # Mixed conditional operators are not parenthesized dotnet_diagnostic.SST1410.severity = error # An anonymous method has an empty parameter list dotnet_diagnostic.SST1411.severity = error # An attribute uses an empty argument list -dotnet_diagnostic.SST1412.severity = none # Store files as UTF-8 with a byte order mark — conflicts with SST1450 (UTF-8 without BOM) -dotnet_diagnostic.SST1413.severity = none # A multi-line initializer omits the trailing comma — trailing commas are not required here +dotnet_diagnostic.SST1412.severity = none # Store files as UTF-8 with a BOM — conflicts with SST1450 (no BOM) +dotnet_diagnostic.SST1413.severity = error # A multi-line initializer omits the trailing comma dotnet_diagnostic.SST1414.severity = error # A tuple type in a member signature has an unnamed element -dotnet_diagnostic.SST1415.severity = error # An argument-exception constructor uses a string literal where nameof would track renames -dotnet_diagnostic.SST1416.severity = none # Do not declare public members in a non-public type -dotnet_diagnostic.SST1417.severity = suggestion # Namespace should match the folder structure +dotnet_diagnostic.SST1415.severity = error # An argument-exception constructor uses a literal instead of nameof +dotnet_diagnostic.SST1416.severity = none # Public members in a non-public type — reflection binding needs them public +dotnet_diagnostic.SST1417.severity = none # Namespace should match the folder — BCL-namespace types cannot comply dotnet_diagnostic.SST1418.severity = error # Declare precedence when mixing the null-coalescing operator dotnet_diagnostic.SST1419.severity = error # Remove redundant modifiers dotnet_diagnostic.SST1420.severity = error # Trivial properties should be auto-implemented @@ -1360,9 +1350,9 @@ dotnet_diagnostic.SST1455.severity = error # Unsafe modifiers should be used onl dotnet_diagnostic.SST1456.severity = error # Readonly fields should not store mutable source-defined structs dotnet_diagnostic.SST1457.severity = error # Global suppressions should point at real declarations dotnet_diagnostic.SST1458.severity = error # Global suppression targets should use declaration ids directly -dotnet_diagnostic.SST1459.severity = error # Grouping parentheses should be removed when the parent syntax already isolates the expression +dotnet_diagnostic.SST1459.severity = error # Grouping parentheses the parent syntax already isolates dotnet_diagnostic.SST1460.severity = error # Non-mutating struct members should be readonly -dotnet_diagnostic.SST1461.severity = error # Private parameters that are never read should be removed +dotnet_diagnostic.SST1461.severity = error # A parameter is never read anywhere in the member body dotnet_diagnostic.SST1462.severity = error # Suppressions for diagnostics already disabled by config should be removed dotnet_diagnostic.SST1463.severity = error # Symbol-name strings should use nameof dotnet_diagnostic.SST1464.severity = error # An else clause follows a branch that always jumps and can be unwrapped @@ -1374,7 +1364,7 @@ dotnet_diagnostic.SST1469.severity = error # A non-nullable value type is compar dotnet_diagnostic.SST1470.severity = error # A trailing catch clause that only rethrows should be removed dotnet_diagnostic.SST1471.severity = error # Magic numbers should be named constants dotnet_diagnostic.SST1472.severity = error # Signatures should not declare too many parameters -dotnet_diagnostic.SST1473.severity = error # A floating-point value is compared for exact equality (zero comparison allowed by default) +dotnet_diagnostic.SST1473.severity = error # A floating-point value is compared for exact equality dotnet_diagnostic.SST1474.severity = error # Both sides of an operator are the same expression dotnet_diagnostic.SST1475.severity = error # A condition repeats an earlier one in the chain, so its branch cannot run dotnet_diagnostic.SST1476.severity = error # Every branch of a conditional has the same body @@ -1389,8 +1379,8 @@ dotnet_diagnostic.SST1484.severity = error # A declaration shadows an outer fiel dotnet_diagnostic.SST1485.severity = error # A member that must not throw throws dotnet_diagnostic.SST1486.severity = error # The same string literal is repeated instead of being named dotnet_diagnostic.SST1487.severity = error # A collection element is assigned twice with nothing reading it in between -dotnet_diagnostic.SST1488.severity = error # An exception type does not declare the standard constructors (parameterless waivable) -dotnet_diagnostic.SST1489.severity = error # An exception type carries serialization members the target framework has obsoleted +dotnet_diagnostic.SST1488.severity = error # An exception type does not declare the standard constructors +dotnet_diagnostic.SST1489.severity = error # An exception type carries obsoleted serialization members dotnet_diagnostic.SST1490.severity = error # A base list names an interface the rest of the list already implies dotnet_diagnostic.SST1491.severity = error # A modifier restates the declaration's default dotnet_diagnostic.SST1492.severity = error # A value is tested against what it is then assigned, so the guard decides nothing @@ -1400,13 +1390,13 @@ dotnet_diagnostic.SST1495.severity = error # '==' compares references on a type dotnet_diagnostic.SST1496.severity = error # An abstract type declares nothing abstract dotnet_diagnostic.SST1497.severity = error # A local is declared and never read dotnet_diagnostic.SST1498.severity = error # Only a nested type uses a private member -dotnet_diagnostic.SST1499.severity = error # A static field visible outside its type can still be changed (internal fields included by default) +dotnet_diagnostic.SST1499.severity = error # A static field visible outside its type can still be changed # Layout dotnet_diagnostic.SST1500.severity = error # A brace in a multi-line construct shares its line with other code dotnet_diagnostic.SST1501.severity = error # A statement block is collapsed onto a single line dotnet_diagnostic.SST1502.severity = error # An element body is collapsed onto a single line -dotnet_diagnostic.SST1503.severity = none # A control-flow statement omits the braces around its child statement — duplicate with existing brace preferences +dotnet_diagnostic.SST1503.severity = error # A control-flow statement omits the braces around its child statement dotnet_diagnostic.SST1504.severity = error # The accessors of a property/event mix single-line and multi-line forms dotnet_diagnostic.SST1505.severity = error # An opening brace is followed by a blank line dotnet_diagnostic.SST1506.severity = error # An element documentation header is followed by a blank line @@ -1428,15 +1418,19 @@ dotnet_diagnostic.SST1521.severity = error # A line is longer than the configure dotnet_diagnostic.SST1522.severity = error # A file has more code lines than the configured maximum (default 500) dotnet_diagnostic.SST1523.severity = error # A member has more code lines than the configured maximum (default 60) dotnet_diagnostic.SST1524.severity = error # A switch section has more code lines than the configured maximum (default 20) -dotnet_diagnostic.SST1525.severity = error # A multi-statement `switch` section has no braces; the braces-on policy extends to switch sections. Code fix wraps it. -dotnet_diagnostic.SST1526.severity = error # A wrapped binary expression places the operator inconsistently. Configurable (`before`/`after`, default before). Opt-in. -dotnet_diagnostic.SST1527.severity = error # The `=>` of an expression-bodied member wraps inconsistently. Configurable. Opt-in. +dotnet_diagnostic.SST1525.severity = error # A multi-statement switch section has no braces +dotnet_diagnostic.SST1526.severity = error # A wrapped binary expression places the operator inconsistently +dotnet_diagnostic.SST1527.severity = error # The => of an expression-bodied member wraps inconsistently dotnet_diagnostic.SST1528.severity = error # The `=` of a wrapped initializer wraps inconsistently. Configurable. Opt-in. -dotnet_diagnostic.SST1529.severity = error # A wrapped `?.`/`.` call chain places the break inconsistently. Configurable. Opt-in. -dotnet_diagnostic.SST1530.severity = error # A newline sits between a type declaration and its base list. Code fix pulls the base list onto the declaration line. Opt-in. -dotnet_diagnostic.SST1531.severity = error # A short object initializer is split across lines. Code fix collapses it when it fits. Opt-in. +dotnet_diagnostic.SST1529.severity = error # A wrapped call chain places the break inconsistently +dotnet_diagnostic.SST1530.severity = error # A newline sits between a type declaration and its base list +dotnet_diagnostic.SST1531.severity = error # A short object initializer is split across lines dotnet_diagnostic.SST1532.severity = error # A file mixes line endings. Configurable (`lf`/`crlf`, default lf). Opt-in. -dotnet_diagnostic.SST1533.severity = error # A source file contains no code. Opt-in. +dotnet_diagnostic.SST1533.severity = none # A source file contains no code — a polyfill behind #if is empty by design +dotnet_diagnostic.SST1534.severity = none # Switch braces that scope nothing — conflicts with SST1525's braces-on policy +dotnet_diagnostic.SST1535.severity = error # A constructor initializer colon should not be followed by a blank line +dotnet_diagnostic.SST1536.severity = error # A conditional operator token should not be followed by a blank line +dotnet_diagnostic.SST1537.severity = error # An expression-body arrow should not be followed by a blank line # Documentation dotnet_diagnostic.SST1600.severity = error # Externally visible members should be documented @@ -1447,7 +1441,7 @@ dotnet_diagnostic.SST1605.severity = error # Partial element documentation shoul dotnet_diagnostic.SST1606.severity = error # The summary should have text dotnet_diagnostic.SST1607.severity = error # Partial element summary should have text dotnet_diagnostic.SST1608.severity = error # Documentation should not use the default placeholder summary -dotnet_diagnostic.SST1609.severity = none # Property documentation should have a value +dotnet_diagnostic.SST1609.severity = none # Property docs should have a value — it only restates the summary dotnet_diagnostic.SST1610.severity = error # Property value documentation should have text dotnet_diagnostic.SST1611.severity = error # Parameters should be documented dotnet_diagnostic.SST1612.severity = error # Parameter documentation should match the parameters @@ -1483,14 +1477,16 @@ dotnet_diagnostic.SST1653.severity = error # Keep short documentation summaries dotnet_diagnostic.SST1654.severity = error # Extension blocks should be documented with a summary dotnet_diagnostic.SST1655.severity = error # Extension block parameters should be documented dotnet_diagnostic.SST1656.severity = error # Extension block type parameters should be documented -dotnet_diagnostic.SST1657.severity = error # Extension block documentation should reference a real parameter or type parameter +dotnet_diagnostic.SST1657.severity = error # Extension block docs name an unknown parameter or type parameter dotnet_diagnostic.SST1658.severity = error # Documentation text repeats a word dotnet_diagnostic.SST1659.severity = error # A comment has no text at all dotnet_diagnostic.SST1660.severity = error # The `` tags are not in parameter order. Code fix reorders them. Info. -dotnet_diagnostic.SST1661.severity = error # A snippet uses ``/`` mismatched to single- vs multi-line content. Code fix swaps the tag. Info. -dotnet_diagnostic.SST1662.severity = none # A thrown exception type has no `` documentation. Code fix adds the skeleton. Opt-in. -dotnet_diagnostic.SST1663.severity = none # A `//` comment before a public member reads like a summary; use `///`. Code fix converts it. Opt-in. -dotnet_diagnostic.SST1664.severity = none # A summary separates paragraphs with blank lines instead of ``. Code fix wraps them. Opt-in. +dotnet_diagnostic.SST1661.severity = error # A snippet uses / mismatched to its content +dotnet_diagnostic.SST1662.severity = error # A thrown exception type has no documentation +dotnet_diagnostic.SST1663.severity = error # A // comment before a public member reads like a summary +dotnet_diagnostic.SST1664.severity = error # A summary separates paragraphs with blank lines instead of +dotnet_diagnostic.SST1665.severity = error # An names a type but says nothing about what triggers it +dotnet_diagnostic.SST1666.severity = error # Documentation elements are out of the conventional order # Concurrency and modernization dotnet_diagnostic.SST1900.severity = error # see docs/rules/SST1900.md @@ -1499,11 +1495,11 @@ dotnet_diagnostic.SST1902.severity = error # Do not lock on 'this', a Type, or a dotnet_diagnostic.SST1903.severity = error # Do not lock on a newly-created object dotnet_diagnostic.SST1904.severity = error # A lock targets a non-readonly field dotnet_diagnostic.SST1905.severity = error # An async method or converted delegate returns void -dotnet_diagnostic.SST2000.severity = suggestion # A null check plus throw should use ArgumentNullException.ThrowIfNull +dotnet_diagnostic.SST2000.severity = error # A null check plus throw should use ArgumentNullException.ThrowIfNull dotnet_diagnostic.SST2001.severity = error # Use ArgumentException.ThrowIfNullOrEmpty dotnet_diagnostic.SST2002.severity = error # Use ArgumentException.ThrowIfNullOrWhiteSpace -dotnet_diagnostic.SST2003.severity = suggestion # A disposed check should use ObjectDisposedException.ThrowIf -dotnet_diagnostic.SST2004.severity = suggestion # A range check should use an ArgumentOutOfRangeException.ThrowIf... helper +dotnet_diagnostic.SST2003.severity = error # A disposed check should use ObjectDisposedException.ThrowIf +dotnet_diagnostic.SST2004.severity = error # A range check should use an ArgumentOutOfRangeException.ThrowIf... helper dotnet_diagnostic.SST2005.severity = error # Use the 'is' type pattern instead of comparing an 'as' cast to null dotnet_diagnostic.SST2006.severity = error # Use the 'is not' pattern instead of negating an 'is' check dotnet_diagnostic.SST2007.severity = error # Use declaration patterns instead of an is check followed by a cast local @@ -1516,41 +1512,42 @@ dotnet_diagnostic.SST2013.severity = error # An if whose entire body is another dotnet_diagnostic.SST2014.severity = error # A goto jumps to a label dotnet_diagnostic.SST2015.severity = error # A ++ or -- is buried inside a larger expression dotnet_diagnostic.SST2016.severity = error # A DateTime on a visible signature loses its offset at the boundary -dotnet_diagnostic.SST2017.severity = error # A .Date or .TimeOfDay read proves the value is only a date, or only a time of day +dotnet_diagnostic.SST2017.severity = error # A .Date or .TimeOfDay read proves the value is only one of the two dotnet_diagnostic.SST2018.severity = error # A redundant null check sits beside an is type pattern +dotnet_diagnostic.SST2019.severity = error # Test for null rather than for the object type # Modern language and library usage dotnet_diagnostic.SST1700.severity = error # An extension block declares no members dotnet_diagnostic.SST1701.severity = error # Two extension blocks in a type share the same receiver type dotnet_diagnostic.SST1702.severity = error # Extension blocks in a type are separated by other members -dotnet_diagnostic.SST1703.severity = error # A classic this-parameter extension method is used where an extension block could be +dotnet_diagnostic.SST1703.severity = error # A classic this-parameter extension method could be an extension block dotnet_diagnostic.SST1704.severity = error # A class declaring extension blocks is not named with an Extensions suffix dotnet_diagnostic.SST1705.severity = error # A class mixes classic extension methods with extension blocks dotnet_diagnostic.SST1706.severity = error # An extension block targets a broad receiver type such as object or dynamic dotnet_diagnostic.SST1707.severity = error # Extension blocks should be ordered by receiver type -dotnet_diagnostic.SST1708.severity = error # An extension method never uses its `this` receiver, so it need not be an extension. -dotnet_diagnostic.SST1709.severity = none # A method in a `*Extensions` class whose first parameter lacks `this`. Code fix converts it to an extension block. Opt-in. +dotnet_diagnostic.SST1708.severity = error # An extension method never uses its this receiver +dotnet_diagnostic.SST1709.severity = error # A method in an *Extensions class whose first parameter lacks this dotnet_diagnostic.SST1800.severity = error # Record classes should be sealed dotnet_diagnostic.SST1801.severity = error # A positional record parameter does not match the configured casing dotnet_diagnostic.SST1802.severity = error # A record declares a settable rather than init-only instance property dotnet_diagnostic.SST1803.severity = error # A record struct is not declared readonly -dotnet_diagnostic.SST1804.severity = error # A positional record has an empty `{ }` body where `;` would do. Code fix rewrites it. Info. +dotnet_diagnostic.SST1804.severity = error # A positional record has an empty { } body where ; would do dotnet_diagnostic.SST2100.severity = error # An empty collection creation can use [] dotnet_diagnostic.SST2101.severity = error # An explicit collection creation can use [...] dotnet_diagnostic.SST2102.severity = error # A span-targeted stackalloc initializer can use a collection expression dotnet_diagnostic.SST2103.severity = error # A collection-builder factory call can use a collection expression dotnet_diagnostic.SST2104.severity = error # A short builder-local sequence can return a collection expression -dotnet_diagnostic.SST2105.severity = error # A literal array materialized with LINQ can use the target collection expression directly +dotnet_diagnostic.SST2105.severity = error # A literal array materialized with LINQ can use a collection expression dotnet_diagnostic.SST2200.severity = error # A single-use backing field can use the C# 14 field keyword dotnet_diagnostic.SST2201.severity = error # A return-only switch statement can use a switch expression dotnet_diagnostic.SST2202.severity = error # An object creation repeats an explicit target type dotnet_diagnostic.SST2203.severity = error # An array or string index can use from-end indexing dotnet_diagnostic.SST2204.severity = error # A string slice can use range syntax -dotnet_diagnostic.SST2205.severity = none # An enum switch statement omits named enum values — duplicate of IDE0010 (disabled: too noisy for default/fallthrough) and S131; statement switches deliberately no-op omitted values, and a default to satisfy it is rejected by SST1179/S3532. SST2206 keeps the valuable switch-expression exhaustiveness check. +dotnet_diagnostic.SST2205.severity = none # Enum switch statement omits named values — deliberate; SST2206 covers these dotnet_diagnostic.SST2206.severity = error # An enum switch expression omits named enum values dotnet_diagnostic.SST2207.severity = error # A null guard and return can keep the throw in the returned expression dotnet_diagnostic.SST2208.severity = error # An out variable can be declared at the call site -dotnet_diagnostic.SST2209.severity = none # A null-forgiving operator has no local effect +dotnet_diagnostic.SST2209.severity = error # A null-forgiving operator has no local effect dotnet_diagnostic.SST2210.severity = error # A nullable directive repeats the current file-local state dotnet_diagnostic.SST2211.severity = error # A nullable restore directive has no file-local state to restore dotnet_diagnostic.SST2212.severity = error # Literal UTF-8 byte data can use a u8 string literal @@ -1583,63 +1580,68 @@ dotnet_diagnostic.SST2238.severity = error # Nested property patterns can use ex dotnet_diagnostic.SST2239.severity = error # Forwarding lambdas can use method groups dotnet_diagnostic.SST2240.severity = error # Delegate null checks can use conditional invocation dotnet_diagnostic.SST2241.severity = error # Constructors that only store parameters can use primary-constructor storage -dotnet_diagnostic.SST2242.severity = error # Enum switch statement mappings should name every enum value or include a catch-all +dotnet_diagnostic.SST2242.severity = error # Enum switch mappings should name every value or include a catch-all dotnet_diagnostic.SST2243.severity = error # A verbatim string with escapes or line breaks can use a raw string literal dotnet_diagnostic.SST2244.severity = error # A numeric literal's suffix is lower case dotnet_diagnostic.SST2245.severity = error # A for loop with only a condition should be a while loop -dotnet_diagnostic.SST2246.severity = error # A chain of conditional expressions testing one value against constants can be a switch expression +dotnet_diagnostic.SST2246.severity = error # A chain of conditionals against constants can be a switch expression dotnet_diagnostic.SST2247.severity = error # Consecutive locals copying one value's members in order can be a deconstruction dotnet_diagnostic.SST2248.severity = error # Two constant comparisons of the same value can fold into one is-pattern -dotnet_diagnostic.SST2249.severity = error # A literal-format string.Format or literal concatenation can be an interpolated string -dotnet_diagnostic.SST2250.severity = error # A bare local assigned once by the next statement can be an initialized declaration +dotnet_diagnostic.SST2249.severity = error # A literal string.Format or concatenation can be interpolated +dotnet_diagnostic.SST2250.severity = error # A bare local assigned by the next statement can be an initialized declaration dotnet_diagnostic.SST2251.severity = error # A method call names type arguments that inference would supply dotnet_diagnostic.SST2252.severity = error # A switch statement is nested inside another switch statement -dotnet_diagnostic.SST2254.severity = none # A target-typed `new()` is written where an explicit type reads more clearly; the code fix restores `new TypeName(...)`. Opt-in — the counterpart to SST2202's target-typed direction, so a team enables at most one. +dotnet_diagnostic.SST2254.severity = none # Explicit type where new() is written — counterpart to SST2202, enable one dotnet_diagnostic.SST2255.severity = error # A hand-written null-or-empty string test. Code fix uses `string.IsNullOrEmpty`. -dotnet_diagnostic.SST2256.severity = error # An extension method called in static form. Code fix rewrites to instance form. Info. -dotnet_diagnostic.SST2257.severity = error # A lambda block body that is a single `return`. Code fix uses an expression body. Info. -dotnet_diagnostic.SST2258.severity = error # A redundant explicit delegate wrapper (`new EventHandler(M)`). Code fix drops it. Info. +dotnet_diagnostic.SST2256.severity = error # An extension method called in static form +dotnet_diagnostic.SST2257.severity = error # A lambda block body that is a single return +dotnet_diagnostic.SST2258.severity = error # A redundant explicit delegate wrapper dotnet_diagnostic.SST2259.severity = error # A stray `;` after a type declaration. Code fix removes it. Info. dotnet_diagnostic.SST2260.severity = error # An `as` cast to a type the operand already has. Code fix removes it. Info. dotnet_diagnostic.SST2261.severity = error # `(x && !y) -dotnet_diagnostic.SST2262.severity = error # A raw string literal whose content needs no raw syntax. Code fix demotes it. Info. -dotnet_diagnostic.SST2263.severity = error # An infinite loop whose body re-derives its stop condition. Code fix hoists the condition into the header. Info. +dotnet_diagnostic.SST2262.severity = error # A raw string literal whose content needs no raw syntax +dotnet_diagnostic.SST2263.severity = error # An infinite loop whose body re-derives its stop condition dotnet_diagnostic.SST2264.severity = error # A numeric literal cast to an enum. Code fix names the member. -dotnet_diagnostic.SST2265.severity = none # Consecutive fluent calls on one receiver can fold into a chain. Opt-in. -dotnet_diagnostic.SST2266.severity = none # A local read exactly once can be inlined into that use. Opt-in. -dotnet_diagnostic.SST2267.severity = none # Infinite loops written in mixed `while(true)`/`for(;;)` styles. Configurable. Opt-in. -dotnet_diagnostic.SST2268.severity = none # Inconsistent `()` on object creation with an initializer. Configurable. Opt-in. -dotnet_diagnostic.SST2269.severity = none # Inconsistent parentheses around a conditional's condition. Configurable. Opt-in. -dotnet_diagnostic.SST2270.severity = none # Inconsistent explicit-vs-implicit array-creation type. Configurable. Opt-in. -dotnet_diagnostic.SST2271.severity = none # `var`-vs-explicit local type per the configured preference. Configurable. Opt-in. -dotnet_diagnostic.SST2272.severity = none # `[Flags]` member values written as mixed decimals and shifts. Configurable. Opt-in. -dotnet_diagnostic.SST2273.severity = none # A function or loop body wraps its work in a trailing `if` that could be an early-exit guard clause. Code fix inverts it. Configurable threshold. Opt-in. -dotnet_diagnostic.SST2274.severity = error # A value assigned with `as` and then null-checked is an `is` declaration pattern in one step. Code fix rewrites it. -dotnet_diagnostic.SST2275.severity = error # A method whose block body is a single statement can use an expression body `=> expr`. Code fix rewrites it. -dotnet_diagnostic.SST2276.severity = none # A constructor whose block body is a single statement can use an expression body. Code fix rewrites it. Opt-in. -dotnet_diagnostic.SST2277.severity = none # An operator whose block body is a single `return` can use an expression body. Code fix rewrites it. Opt-in. -dotnet_diagnostic.SST2278.severity = none # A conversion operator whose block body is a single `return` can use an expression body. Code fix rewrites it. Opt-in. -dotnet_diagnostic.SST2279.severity = error # A get-only property whose getter is a single `return` can use a whole-member expression body. Code fix rewrites it. -dotnet_diagnostic.SST2280.severity = error # A get-only indexer whose getter is a single `return` can use a whole-member expression body. Code fix rewrites it. -dotnet_diagnostic.SST2281.severity = error # A local function whose block body is a single statement can use an expression body. Code fix rewrites it. -dotnet_diagnostic.SST2282.severity = error # A reference-type `ReferenceEquals` check against `null` reads as an `is null` / `is not null` pattern. Code fix rewrites it. -dotnet_diagnostic.SST2283.severity = error # A null guard that throws right before assigning the guarded value can fold into the assignment as `?? throw`. Code fix rewrites it. +dotnet_diagnostic.SST2265.severity = error # Consecutive fluent calls on one receiver can fold into a chain +dotnet_diagnostic.SST2266.severity = error # A local read exactly once can be inlined into that use +dotnet_diagnostic.SST2267.severity = error # Infinite loops written in mixed `while(true)`/`for(;;)` styles. Configurable. +dotnet_diagnostic.SST2268.severity = error # Inconsistent `()` on object creation with an initializer. Configurable. +dotnet_diagnostic.SST2269.severity = error # Inconsistent parentheses around a conditional's condition. Configurable. +dotnet_diagnostic.SST2270.severity = error # Inconsistent explicit-vs-implicit array-creation type. Configurable. +dotnet_diagnostic.SST2271.severity = error # `var`-vs-explicit local type per the configured preference. Configurable. +dotnet_diagnostic.SST2272.severity = error # `[Flags]` member values written as mixed decimals and shifts. Configurable. +dotnet_diagnostic.SST2273.severity = error # A trailing if that could be an early-exit guard clause +dotnet_diagnostic.SST2274.severity = error # An 'as' assignment plus null check is one is-declaration pattern +dotnet_diagnostic.SST2275.severity = error # A method whose block body is a single statement can use => expr +dotnet_diagnostic.SST2276.severity = error # A constructor whose block body is a single statement can use => +dotnet_diagnostic.SST2277.severity = error # An operator whose block body is a single return can use => +dotnet_diagnostic.SST2278.severity = error # A conversion operator whose block body is a single return can use => +dotnet_diagnostic.SST2279.severity = error # A get-only property whose getter is a single return can use => +dotnet_diagnostic.SST2280.severity = error # A get-only indexer whose getter is a single return can use => +dotnet_diagnostic.SST2281.severity = error # A local function whose block body is a single statement can use => +dotnet_diagnostic.SST2282.severity = error # A ReferenceEquals check against null reads as an is null pattern +dotnet_diagnostic.SST2283.severity = error # A null guard before an assignment can fold into it as ?? throw +dotnet_diagnostic.SST2284.severity = error # A statement steps a value by one through a compound assignment +dotnet_diagnostic.SST2285.severity = error # A null guard is conjoined with a member read on the same value +dotnet_diagnostic.SST2286.severity = error # ToString is called on a receiver already typed as string +dotnet_diagnostic.SST2287.severity = error # A while loop owns its counter, so a for header would gather it +dotnet_diagnostic.SST2288.severity = error # A conditional expression has a boolean literal in exactly one branch # Design dotnet_diagnostic.SST2300.severity = error # A class implements IDisposable but builds only half of the disposal pattern dotnet_diagnostic.SST2301.severity = error # A class implementing IEquatable for itself can still be derived from dotnet_diagnostic.SST2302.severity = error # A type overloads an operator without the rest of the set it belongs to dotnet_diagnostic.SST2303.severity = error # A [Flags] enum's members are not distinct bit values -dotnet_diagnostic.SST2304.severity = error # An event's delegate does not have the standard (object sender, TEventArgs e) shape +dotnet_diagnostic.SST2304.severity = error # An event delegate lacks the (object sender, TEventArgs e) shape dotnet_diagnostic.SST2305.severity = error # A mutable collection property declares a caller-visible setter dotnet_diagnostic.SST2306.severity = error # A collection-returning member hands back null -dotnet_diagnostic.SST2307.severity = error # A generic method's type parameter appears in no parameter, so no caller can infer it +dotnet_diagnostic.SST2307.severity = error # A generic method type parameter appears in no parameter and cannot be inferred dotnet_diagnostic.SST2308.severity = error # An [Obsolete] attribute carries no message -dotnet_diagnostic.SST2309.severity = error # An externally visible member declares an optional parameter, so callers bake in the default +dotnet_diagnostic.SST2309.severity = error # An externally visible member declares an optional parameter dotnet_diagnostic.SST2310.severity = error # Deprecated code is still here; remove it once its last caller is gone dotnet_diagnostic.SST2311.severity = error # A visible const is copied into every assembly that reads it dotnet_diagnostic.SST2312.severity = error # A type is declared outside any namespace dotnet_diagnostic.SST2313.severity = error # An enum is stored as a type the project does not allow -dotnet_diagnostic.SST2314.severity = none # An [Obsolete] has a message but no DiagnosticId — unusable here: ObsoleteAttribute.DiagnosticId is .NET 5+, and this source is shared with net462 +dotnet_diagnostic.SST2314.severity = none # [Obsolete] with a message but no DiagnosticId — the property is .NET 5+ only dotnet_diagnostic.SST2315.severity = error # A type owns a disposable field but does not implement IDisposable dotnet_diagnostic.SST2316.severity = error # A type declares Dispose or DisposeAsync without implementing IDisposable dotnet_diagnostic.SST2317.severity = error # A disposable type owns a raw IntPtr without a SafeHandle or finalizer @@ -1648,19 +1650,20 @@ dotnet_diagnostic.SST2319.severity = error # An overload's optional default can dotnet_diagnostic.SST2320.severity = error # An interface inherits two interfaces that declare the same member dotnet_diagnostic.SST2321.severity = error # Environment.Exit or Environment.FailFast is called from library code dotnet_diagnostic.SST2322.severity = error # A non-private readonly field holds a mutable collection callers can still change -dotnet_diagnostic.SST2323.severity = error # A stateless abstract class declaring only public abstract members should be an interface +dotnet_diagnostic.SST2323.severity = error # A stateless abstract class with only public abstract members dotnet_diagnostic.SST2324.severity = error # A member is declared more accessible than its containing type dotnet_diagnostic.SST2325.severity = error # An async method checks an argument after its first await -dotnet_diagnostic.SST2326.severity = none # An interface-typed value is narrowed to a concrete implementation — this is a high-performance core library, not strictly SOLID code, and narrowing to a known runtime type is a normal fast-path technique here: foreach over IEnumerable boxes List's struct enumerator (40 bytes per call, measured) where the indexed loop behind the type test allocates nothing -dotnet_diagnostic.SST2327.severity = error # A type tests its own runtime type against a class instead of dispatching through a virtual member +dotnet_diagnostic.SST2326.severity = none # Interface value narrowed to a concrete type — a deliberate fast path here +dotnet_diagnostic.SST2327.severity = error # A type tests its own runtime type instead of dispatching virtually dotnet_diagnostic.SST2328.severity = error # A raw native pointer handle is exposed instead of a SafeHandle dotnet_diagnostic.SST2329.severity = error # A `[Flags]` enum declares no zero-valued member. Code fix adds `None = 0`. -dotnet_diagnostic.SST2330.severity = error # A `[Flags]` member is a numeric literal equal to a combination of others (`All = 7`). Code fix writes `A -dotnet_diagnostic.SST2331.severity = none # An enum leaves member values implicit, so their numbers depend on declaration order. Opt-in. -dotnet_diagnostic.SST2332.severity = error # An auto-property's `private set` is only written during construction; make it get-only. -dotnet_diagnostic.SST2333.severity = none # A generic comparison/equality contract is implemented without its non-generic counterpart. Opt-in. -dotnet_diagnostic.SST2334.severity = none # A publicly visible type has no `[DebuggerDisplay]`. Opt-in. -dotnet_diagnostic.SST2335.severity = none # Parts of a partial type disagree on the `static` modifier. Opt-in. +dotnet_diagnostic.SST2330.severity = error # A [Flags] member literal equal to a combination of other members +dotnet_diagnostic.SST2331.severity = error # An enum leaves member values implicit, so numbering follows declaration order +dotnet_diagnostic.SST2332.severity = error # An auto-property private set is only written during construction +dotnet_diagnostic.SST2333.severity = error # A generic equality contract lacks its non-generic counterpart +dotnet_diagnostic.SST2334.severity = error # A publicly visible type has no `[DebuggerDisplay]` +dotnet_diagnostic.SST2335.severity = error # Parts of a partial type disagree on the `static` modifier +dotnet_diagnostic.SST2336.severity = error # A concrete attribute type declares no [AttributeUsage] # Correctness dotnet_diagnostic.SST2400.severity = error # Two arguments name each other's parameters and have been transposed @@ -1672,7 +1675,7 @@ dotnet_diagnostic.SST2405.severity = error # A [DebuggerDisplay] string names a dotnet_diagnostic.SST2406.severity = error # A loop's stop condition reads only variables the loop never writes dotnet_diagnostic.SST2407.severity = error # A declared event is never raised dotnet_diagnostic.SST2408.severity = error # A StringBuilder is filled and never read -dotnet_diagnostic.SST2409.severity = error # A throw constructs a general exception type (Exception/SystemException/ApplicationException) +dotnet_diagnostic.SST2409.severity = error # A throw constructs a general exception type dotnet_diagnostic.SST2410.severity = error # A created disposable is never disposed and never leaves the method dotnet_diagnostic.SST2411.severity = error # A for loop declares and tests a counter it never steps dotnet_diagnostic.SST2412.severity = error # A for loop update moves the counter away from its stop condition @@ -1698,40 +1701,46 @@ dotnet_diagnostic.SST2431.severity = error # A ToString override can return null dotnet_diagnostic.SST2432.severity = error # GetType is called on a value that is already a System.Type dotnet_diagnostic.SST2433.severity = error # A caller-info parameter is not last in the list dotnet_diagnostic.SST2434.severity = error # An array is assigned through a covariant element type -dotnet_diagnostic.SST2435.severity = error # A non-object base's value-equality Equals is used as a reference-equality fast path +dotnet_diagnostic.SST2435.severity = error # A non-object base's value Equals used as a reference fast path dotnet_diagnostic.SST2436.severity = error # An event is raised with a null sender or null args dotnet_diagnostic.SST2437.severity = error # A generic type inherits from itself recursively dotnet_diagnostic.SST2438.severity = error # A catch that discards its exception logs at Error or Critical without it -dotnet_diagnostic.SST2439.severity = error # An exception is passed as a log template argument instead of the exception parameter +dotnet_diagnostic.SST2439.severity = error # An exception is passed as a log template argument dotnet_diagnostic.SST2440.severity = error # Log template arguments are transposed dotnet_diagnostic.SST2441.severity = error # A log template has an empty or non-identifier placeholder dotnet_diagnostic.SST2442.severity = error # A log template repeats a named placeholder dotnet_diagnostic.SST2443.severity = error # An ILogger is injected or created with the wrong category type dotnet_diagnostic.SST2444.severity = error # A regular expression pattern is invalid -dotnet_diagnostic.SST2445.severity = error # A culture-sensitive custom date or time format is used without an invariant culture +dotnet_diagnostic.SST2445.severity = error # A culture-sensitive date or time format without an invariant culture dotnet_diagnostic.SST2446.severity = error # A Stream.ReadAsync result is discarded through ConfigureAwait or a local -dotnet_diagnostic.SST2448.severity = error # A combined or opaque delegate is removed with - or -=, which strips only a contiguous run +dotnet_diagnostic.SST2447.severity = error # An integer subtraction is compared against literal zero +dotnet_diagnostic.SST2448.severity = error # A combined delegate removed with -= strips only a contiguous run dotnet_diagnostic.SST2449.severity = error # A lambda or anonymous-method handler is removed with -=, which never matches it -dotnet_diagnostic.SST2450.severity = error # A Debug.Assert condition performs a side effect that a release build compiles out +dotnet_diagnostic.SST2450.severity = error # A Debug.Assert condition performs a side effect dotnet_diagnostic.SST2451.severity = error # Every constructor is private and no member ever creates an instance dotnet_diagnostic.SST2452.severity = error # A [Pure] method returns void, Task, or ValueTask, so it has no observable result +dotnet_diagnostic.SST2453.severity = error # A ?? whose right operand is a constant null substitutes null for null +dotnet_diagnostic.SST2454.severity = error # The result of an 'as' conversion is dereferenced with no null check +dotnet_diagnostic.SST2455.severity = error # Two enum members hold the same number without saying so dotnet_diagnostic.SST2456.severity = error # An override or new field-like event gets its own backing delegate field dotnet_diagnostic.SST2457.severity = error # An integer Sum wrapped in unchecked still throws on overflow dotnet_diagnostic.SST2458.severity = error # A bitwise operator is applied to an enum not declared [Flags] dotnet_diagnostic.SST2459.severity = error # [Optional] on a ref or out parameter advertises an optionality no caller can use dotnet_diagnostic.SST2460.severity = error # [DefaultValue] on a method or record parameter is inert +dotnet_diagnostic.SST2461.severity = error # A [Flags] member sets a bit that no member of the enum declares dotnet_diagnostic.SST2462.severity = error # A new member is less accessible than the inherited member it hides dotnet_diagnostic.SST2463.severity = error # A field differs from an inherited accessible field only by case -dotnet_diagnostic.SST2464.severity = error # A mutable class declares a value-equality operator ==, so it is lost as a hash key +dotnet_diagnostic.SST2464.severity = error # A mutable class declares value-equality ==, so it is lost as a hash key dotnet_diagnostic.SST2465.severity = error # A for loop body reassigns the counter or the local its condition tests -dotnet_diagnostic.SST2467.severity = error # A params overload is shadowed by a same-arity overload with a more specific last parameter -dotnet_diagnostic.SST2468.severity = error # A classic partial method is declared but never implemented, so its calls are removed -dotnet_diagnostic.SST2470.severity = error # Two string literals concatenate with no space, fusing a SQL keyword into the next token +dotnet_diagnostic.SST2466.severity = error # A finally clause contains no statements +dotnet_diagnostic.SST2467.severity = error # A params overload is shadowed by a same-arity overload +dotnet_diagnostic.SST2468.severity = error # A classic partial method is declared but never implemented +dotnet_diagnostic.SST2470.severity = error # Two string literals concatenate with no space, fusing keywords dotnet_diagnostic.SST2472.severity = error # A type is exported for a contract it neither implements nor inherits dotnet_diagnostic.SST2473.severity = error # A shared export part is constructed with new, bypassing the container dotnet_diagnostic.SST2474.severity = error # A part-creation-policy attribute is applied to a type with no [Export] dotnet_diagnostic.SST2475.severity = error # An entity's primary key is typed DateTime or DateTimeOffset -dotnet_diagnostic.SST2479.severity = error # A loop variable captured by a callback stored beyond the iteration reads its final value +dotnet_diagnostic.SST2479.severity = error # A loop variable captured beyond the iteration reads its final value dotnet_diagnostic.SST2481.severity = error # A GetHashCode override folds the base identity hash into a value hash dotnet_diagnostic.SST2484.severity = error # A handle read through DangerousGetHandle is not reference-counted dotnet_diagnostic.SST2485.severity = error # A NotImplementedException is left in shipped code @@ -1740,17 +1749,19 @@ dotnet_diagnostic.SST2487.severity = error # A [ConstructorArgument] does not na dotnet_diagnostic.SST2488.severity = error # An exception is logged and rethrown, duplicating the record dotnet_diagnostic.SST2489.severity = error # A relational comparison is decided by the operand's type rather than its value dotnet_diagnostic.SST2490.severity = error # Adjacent try statements with identical handling should be merged -dotnet_diagnostic.SST2491.severity = error # A non-`async` method returns an awaitable from inside `using`/`try-finally`/`lock`, so the resource is torn down before the task completes. Code fix makes it `async`. +dotnet_diagnostic.SST2491.severity = error # A non-async method returns an awaitable from inside using or lock dotnet_diagnostic.SST2492.severity = error # A null-guard throws on a parameter the signature declares may be null. -dotnet_diagnostic.SST2493.severity = error # `== null`/`!= null` on an unconstrained generic `T`. Code fix uses `is null`/`is not null`. -dotnet_diagnostic.SST2494.severity = error # A `??` whose left operand is a constant null, so the right is always taken. Code fix folds it. -dotnet_diagnostic.SST2495.severity = error # A `[Flags]` combination includes an operand whose bits another already covers. Code fix removes it. -dotnet_diagnostic.SST2496.severity = error # An explicit `Dispose`/`Close` on a resource an enclosing `using` already disposes. Code fix removes it. Info. +dotnet_diagnostic.SST2493.severity = error # == null or != null on an unconstrained generic T +dotnet_diagnostic.SST2494.severity = error # A ?? whose left operand is a constant null +dotnet_diagnostic.SST2495.severity = error # A [Flags] combination includes bits another operand already covers +dotnet_diagnostic.SST2496.severity = error # An explicit Dispose/Close an enclosing using already performs +dotnet_diagnostic.SST2497.severity = error # A member forwards to itself, so calling it recurses until the stack is gone +dotnet_diagnostic.SST2498.severity = error # nameof on a type parameter is the constant "T" # Testing dotnet_diagnostic.SST2500.severity = error # A test method contains no assertion and no expected-exception check dotnet_diagnostic.SST2501.severity = error # An equality or identity assertion compares an expression with itself -dotnet_diagnostic.SST2502.severity = error # An equality assertion passes the constant as actual and the computed value as expected +dotnet_diagnostic.SST2502.severity = error # An equality assertion has expected and actual transposed dotnet_diagnostic.SST2503.severity = error # An equality assertion compares a value against a boolean literal dotnet_diagnostic.SST2504.severity = error # A test fixture declares and inherits no test method dotnet_diagnostic.SST2505.severity = error # A test method declares parameters but no data source @@ -1760,24 +1771,24 @@ dotnet_diagnostic.SST2508.severity = error # A fluent assertion is started but n dotnet_diagnostic.SST2509.severity = error # A test method has a shape the runner cannot execute # Logging -dotnet_diagnostic.SST2600.severity = error # Application output is written through legacy Trace instead of a structured logger +dotnet_diagnostic.SST2600.severity = error # Output written through legacy Trace instead of a structured logger dotnet_diagnostic.SST2601.severity = error # A logger field or property does not follow the logger naming convention # Frameworks -dotnet_diagnostic.SST2700.severity = error # An MVC route template contains a backslash; route segments are separated by `/`, so the route is unreachable. Code fix replaces `\` with `/`. -dotnet_diagnostic.SST2701.severity = error # A `[JSInvokable]` method is not public, so JavaScript interop cannot call it. Code fix makes it public. -dotnet_diagnostic.SST2702.severity = error # A `[SupplyParameterFromQuery]` property has a type the framework cannot bind from the query string, which throws at runtime. -dotnet_diagnostic.SST2703.severity = error # A routable component's route constraint (`{id:int}`) disagrees with the matching `[Parameter]` CLR type, so the route silently fails to match. -dotnet_diagnostic.SST2704.severity = error # A public action on an `[ApiController]` declares no HTTP-verb attribute, so it answers every verb and can make routing ambiguous. -dotnet_diagnostic.SST2705.severity = none # A bound model member is a non-nullable value type with no required marker, so a request that omits it binds the default with no error. Opt-in. -dotnet_diagnostic.SST2706.severity = error # A Windows Forms entry point carries neither `[STAThread]` nor `[MTAThread]`; without STA, clipboard, drag-and-drop, and common dialogs misbehave. Code fix adds `[STAThread]`. -dotnet_diagnostic.SST2707.severity = none # A fire-and-forget `Task.Run` in a controller captures the request's `HttpContext`, which is disposed when the request ends, so the background work throws `ObjectDisposedException`. Opt-in. -dotnet_diagnostic.SST2708.severity = error # A component subscribes to an event in a lifecycle method but never unsubscribes, so the event source keeps the component alive — a per-session leak on a Server circuit. -dotnet_diagnostic.SST2709.severity = error # `StateHasChanged` is called while the component is being disposed, which the renderer no longer supports and throws. -dotnet_diagnostic.SST2710.severity = error # `StateHasChanged` is called directly from a timer callback, off the renderer's dispatcher; marshal it with `InvokeAsync(StateHasChanged)`. -dotnet_diagnostic.SST2711.severity = error # A synchronous component lifecycle method is overridden as `async void`, which the framework never awaits; override the `…Async` twin returning `Task`. Code fix rewrites the signature. -dotnet_diagnostic.SST2712.severity = error # An `[Inject]`/`[CascadingParameter]` property has no setter, so the framework's reflection-based binding leaves it null. Code fix adds a setter. -dotnet_diagnostic.SST2713.severity = error # A `DotNetObjectReference.Create(this)` is passed inline and never stored, so nothing can dispose it and it leaks on the JavaScript side. +dotnet_diagnostic.SST2700.severity = error # An MVC route template contains a backslash, so the route is unreachable +dotnet_diagnostic.SST2701.severity = error # A [JSInvokable] method is not public, so interop cannot call it +dotnet_diagnostic.SST2702.severity = error # A [SupplyParameterFromQuery] property cannot bind from the query string +dotnet_diagnostic.SST2703.severity = error # A route constraint disagrees with the matching [Parameter] CLR type +dotnet_diagnostic.SST2704.severity = error # An [ApiController] action declares no HTTP-verb attribute +dotnet_diagnostic.SST2705.severity = error # A bound model member is a non-nullable value type with no required marker +dotnet_diagnostic.SST2706.severity = error # A Windows Forms entry point carries neither [STAThread] nor [MTAThread] +dotnet_diagnostic.SST2707.severity = error # A fire-and-forget Task.Run in a controller captures the request HttpContext +dotnet_diagnostic.SST2708.severity = error # A component subscribes to an event and never unsubscribes +dotnet_diagnostic.SST2709.severity = error # StateHasChanged is called while the component is being disposed +dotnet_diagnostic.SST2710.severity = error # StateHasChanged is called from a timer callback, off the dispatcher +dotnet_diagnostic.SST2711.severity = error # A component lifecycle method is overridden as async void +dotnet_diagnostic.SST2712.severity = error # An [Inject] or [CascadingParameter] property has no setter +dotnet_diagnostic.SST2713.severity = error # A DotNetObjectReference.Create(this) is passed inline and never stored ################### # PerformanceSharp Analyzers (PSH) @@ -1787,13 +1798,13 @@ performancesharp.avoid_linq_on_hot_path = true # performancesharp.excluded_properties = Items, Keys # PSH1017 (comma-separated; properties allowed to copy on read) # performancesharp.include_public = false # PSH1411 (set true in an app to seal public types too; a break in a library) dotnet_diagnostic.PSH1000.severity = error # Anonymous functions without captures should be static -dotnet_diagnostic.PSH1001.severity = error # Avoid allocating zero-length arrays (fix prefers [] on C# 12+, else Array.Empty()) +dotnet_diagnostic.PSH1001.severity = error # Avoid allocating zero-length arrays dotnet_diagnostic.PSH1002.severity = error # Empty finalizers should be removed dotnet_diagnostic.PSH1003.severity = error # 'in' parameters should use readonly structs dotnet_diagnostic.PSH1004.severity = error # Constant arrays passed as arguments should be hoisted dotnet_diagnostic.PSH1005.severity = error # Structs should define equality members to avoid boxing comparisons dotnet_diagnostic.PSH1006.severity = error # ConcurrentDictionary factories should use the lambda argument -dotnet_diagnostic.PSH1007.severity = error # Pass large readonly structs by 'in' reference (size threshold + exclusions configurable) +dotnet_diagnostic.PSH1007.severity = error # Pass large readonly structs by 'in' reference dotnet_diagnostic.PSH1008.severity = error # GC.SuppressFinalize does nothing for sealed finalizer-free types dotnet_diagnostic.PSH1009.severity = error # Bound variable-length stackalloc with a constant guard dotnet_diagnostic.PSH1010.severity = error # Clear reference-typed arrays when returning them to the pool @@ -1803,15 +1814,16 @@ dotnet_diagnostic.PSH1013.severity = error # Expose constant UTF-8 data as a Rea dotnet_diagnostic.PSH1014.severity = error # Declare immutable structs as readonly dotnet_diagnostic.PSH1015.severity = error # Avoid casting value types through object dotnet_diagnostic.PSH1016.severity = error # Test enum flags with bitwise operators instead of Enum.HasFlag -dotnet_diagnostic.PSH1017.severity = error # A property allocates a copy of a collection on every read (excludable via performancesharp.PSH1017.excluded_properties) +dotnet_diagnostic.PSH1017.severity = error # A property allocates a copy of a collection on every read dotnet_diagnostic.PSH1018.severity = error # A hand-written array is passed to a params parameter dotnet_diagnostic.PSH1019.severity = error # The range indexer on an array allocates a copy; slice with AsSpan/AsMemory dotnet_diagnostic.PSH1020.severity = error # Prefer a jagged array over a multidimensional one -dotnet_diagnostic.PSH1021.severity = error # An explicit GC.Collect or GC.WaitForPendingFinalizers forces collection the runtime tunes itself -dotnet_diagnostic.PSH1022.severity = error # A parameterless `new EventArgs()` allocates where the shared `EventArgs.Empty` singleton would serve. Code fix uses the singleton. +dotnet_diagnostic.PSH1021.severity = error # An explicit GC.Collect forces collection the runtime tunes itself +dotnet_diagnostic.PSH1022.severity = error # A parameterless new EventArgs() where EventArgs.Empty would serve +dotnet_diagnostic.PSH1023.severity = error # A local anonymous type allocates where a tuple would not dotnet_diagnostic.PSH1100.severity = error # Hot-path code should avoid System.Linq.Enumerable calls -dotnet_diagnostic.PSH1101.severity = none # LINQ terminal predicate simplification is reserved for test code; production code should avoid LINQ on hot paths -dotnet_diagnostic.PSH1102.severity = none # LINQ type-filter simplification is reserved for test code; production code should avoid LINQ on hot paths +dotnet_diagnostic.PSH1101.severity = none # LINQ predicate simplification — production code avoids LINQ on hot paths +dotnet_diagnostic.PSH1102.severity = none # LINQ type-filter simplification — production code avoids LINQ on hot paths dotnet_diagnostic.PSH1103.severity = error # Prefer the collection's own count over enumerating dotnet_diagnostic.PSH1104.severity = error # Use TryGetValue instead of ContainsKey followed by an indexer read dotnet_diagnostic.PSH1105.severity = error # Avoid double lookups on dictionaries and sets @@ -1821,9 +1833,9 @@ dotnet_diagnostic.PSH1108.severity = error # Chain secondary sorts with ThenBy dotnet_diagnostic.PSH1109.severity = error # Merge consecutive Where calls dotnet_diagnostic.PSH1110.severity = error # Use the collection's own predicate methods over LINQ dotnet_diagnostic.PSH1111.severity = error # Use Contains for membership tests -dotnet_diagnostic.PSH1112.severity = error # Seed the collection through its constructor (fix honors performancesharp.prefer_collection_expressions) +dotnet_diagnostic.PSH1112.severity = error # Seed the collection through its constructor dotnet_diagnostic.PSH1113.severity = error # Sort naturally instead of ordering by the element itself -dotnet_diagnostic.PSH1114.severity = none # Freeze static lookup collections that are never mutated. Opt-in. +dotnet_diagnostic.PSH1114.severity = error # Freeze static lookup collections that are never mutated dotnet_diagnostic.PSH1115.severity = error # Insert-if-absent should probe the dictionary once dotnet_diagnostic.PSH1116.severity = error # Probe string-keyed collections with a span through GetAlternateLookup dotnet_diagnostic.PSH1117.severity = error # Ask the collection whether it is empty @@ -1861,18 +1873,18 @@ dotnet_diagnostic.PSH1222.severity = error # Concatenate slices without material dotnet_diagnostic.PSH1223.severity = error # A reused composite format string is re-parsed on every call dotnet_diagnostic.PSH1224.severity = error # Convert bytes to hex in one call, not by building the string twice dotnet_diagnostic.PSH1225.severity = error # Decode bytes to a string in one call, without a throwaway char[] -dotnet_diagnostic.PSH1226.severity = error # A string's `ToCharArray()` result is only iterated, allocating a throwaway `char[]`; iterate the string directly. Code fix drops the copy. -dotnet_diagnostic.PSH1227.severity = error # A cheaper equivalent exists — `string.CompareOrdinal` over `Compare(…, Ordinal)`, `Debug.Fail` over `Debug.Assert(false, …)`. Info. Code fix rewrites the call. +dotnet_diagnostic.PSH1226.severity = error # A string's ToCharArray() result is only iterated +dotnet_diagnostic.PSH1227.severity = error # A cheaper equivalent exists, such as string.CompareOrdinal or Debug.Fail dotnet_diagnostic.PSH1300.severity = error # Use System.Threading.Lock for a dedicated lock object dotnet_diagnostic.PSH1301.severity = error # Do not wrap a single task in WhenAll or WaitAll dotnet_diagnostic.PSH1302.severity = error # TaskCompletionSource should run continuations asynchronously dotnet_diagnostic.PSH1303.severity = error # Do not block an async method with Thread.Sleep dotnet_diagnostic.PSH1304.severity = error # Use PeriodicTimer instead of pacing a loop with Task.Delay dotnet_diagnostic.PSH1305.severity = error # Enumerate a ConcurrentDictionary directly, not its Keys/Values snapshots -dotnet_diagnostic.PSH1306.severity = none # Guard one-time execution with an interlocked latch. Opt-in. +dotnet_diagnostic.PSH1306.severity = error # Guard one-time execution with an interlocked latch dotnet_diagnostic.PSH1307.severity = error # Access interlocked fields with Volatile dotnet_diagnostic.PSH1308.severity = error # Return the completed task instead of Task.FromResult -dotnet_diagnostic.PSH1309.severity = none # Register cancellation callbacks without flowing the execution context. Opt-in. +dotnet_diagnostic.PSH1309.severity = error # Register cancellation callbacks without flowing the execution context dotnet_diagnostic.PSH1310.severity = error # Dispose IAsyncDisposable resources with await using in async code dotnet_diagnostic.PSH1311.severity = error # Remove a pass-through async state machine and return the task directly dotnet_diagnostic.PSH1312.severity = error # Return a completed task instead of null @@ -1890,7 +1902,7 @@ dotnet_diagnostic.PSH1406.severity = error # Ask Regex for the answer directly dotnet_diagnostic.PSH1407.severity = error # Query the dictionary, not its Keys view dotnet_diagnostic.PSH1408.severity = error # Measure elapsed time with Stopwatch timestamps dotnet_diagnostic.PSH1409.severity = error # Use the built-in throw helpers for argument guards -dotnet_diagnostic.PSH1410.severity = none # Mark trivial forwarders for aggressive inlining. Opt-in. +dotnet_diagnostic.PSH1410.severity = error # Mark trivial forwarders for aggressive inlining dotnet_diagnostic.PSH1411.severity = error # Seal non-public types nothing derives from so the JIT can devirtualize dotnet_diagnostic.PSH1412.severity = error # Use Random.Shared instead of allocating a Random dotnet_diagnostic.PSH1413.severity = error # Read the Unix epoch from the framework, not a hand-built DateTime @@ -1899,29 +1911,28 @@ dotnet_diagnostic.PSH1415.severity = error # Hold the concrete type when the con dotnet_diagnostic.PSH1416.severity = error # Cache the serializer options instead of building them per call dotnet_diagnostic.PSH1417.severity = error # Do not compute an expensive argument for an assertion dotnet_diagnostic.PSH1418.severity = error # An HttpClient is constructed on every call -dotnet_diagnostic.PSH1419.severity = error # A time-zone is resolved with a platform-specific id instead of the cross-platform API -dotnet_diagnostic.PSH1420.severity = error # A shareable client held in an instance field of an Azure Functions worker class is rebuilt on every invocation, leaking sockets and connections; share a static/singleton client or inject `IHttpClientFactory`. +dotnet_diagnostic.PSH1419.severity = error # A time zone is resolved with a platform-specific id +dotnet_diagnostic.PSH1420.severity = error # A shareable client is rebuilt on every Azure Functions invocation +dotnet_diagnostic.PSH1421.severity = error # A static Regex method is called from inside a loop body -# ASP.NET Core - inert in this repo (no route handlers or middleware), enabled so the set stays complete +# ASP.NET Core — inert here, enabled so the set stays complete dotnet_diagnostic.PSH1500.severity = error # A minimal API handler returns Results instead of TypedResults, boxing the result -dotnet_diagnostic.PSH1501.severity = error # Middleware uses the legacy nested-delegate Use overload, allocating a per-request closure -dotnet_diagnostic.PSH1502.severity = error # A route handler returns a deferred sequence the serializer enumerates on the request thread +dotnet_diagnostic.PSH1501.severity = error # Middleware uses the legacy nested-delegate Use overload +dotnet_diagnostic.PSH1502.severity = error # A route handler returns a sequence serialized on the request thread dotnet_diagnostic.PSH1503.severity = error # Response caching is used where server-side output caching applies -dotnet_diagnostic.PSH1505.severity = error # Exceptions are handled in an MVC exception filter instead of an IExceptionHandler -dotnet_diagnostic.PSH1506.severity = error # The HTTP request or response body is read or written synchronously (`ReadToEnd`, `Body.Read`, `Body.Write`), which blocks a thread on Kestrel and buffers the whole payload; use the async overload. Code fix awaits it when the method is already async. +dotnet_diagnostic.PSH1505.severity = error # Exceptions handled in an MVC filter instead of an IExceptionHandler +dotnet_diagnostic.PSH1506.severity = error # The HTTP request or response body is read or written synchronously # Blazor -dotnet_diagnostic.PSH1600.severity = error # A delegate captured per iteration inside a component render loop reallocates on every render (measured ~128 B per row per render) and churns the diff; hoist it to a cached delegate or a precomputed per-item model. -dotnet_diagnostic.PSH1601.severity = error # A JavaScript-interop call is issued once per loop iteration; on Interactive Server each is a separate SignalR round-trip. Batch into a single call over the collection. -dotnet_diagnostic.PSH1602.severity = error # `StateHasChanged` is called unconditionally in `OnAfterRender`/`OnAfterRenderAsync`, scheduling another render every time — a runaway loop. Guard it with `firstRender` or a state flag. -dotnet_diagnostic.PSH1603.severity = error # A non-delegate allocation is used as a component-parameter value inside a render loop, allocating per item and forcing the child to re-render each pass. Sibling of PSH1600. +dotnet_diagnostic.PSH1600.severity = error # A delegate captured per iteration in a render loop reallocates every render +dotnet_diagnostic.PSH1601.severity = error # A JavaScript-interop call is issued once per loop iteration +dotnet_diagnostic.PSH1602.severity = error # StateHasChanged is called unconditionally in OnAfterRender +dotnet_diagnostic.PSH1603.severity = error # A non-delegate allocation is a component parameter in a render loop ################### # SecuritySharp Analyzers (SES) ################### -# Every rule is raised to error, including the three that ship at suggestion (SES1403, SES1506, -# SES1605). Security rules only ever suggest an API they can resolve in the compilation and report -# local shapes only - there is no interprocedural taint tracking, so the taint-flow CA rules stay on. +# Every rule is error; these report local shapes only, so the taint-flow CA rules stay on. # securitysharp.SES1003.iterations = 100000 # minimum accepted PBKDF2 iteration count # securitysharp.SES1403.maxdepth = 64 # highest accepted System.Text.Json MaxDepth @@ -1931,18 +1942,18 @@ dotnet_diagnostic.SES1002.severity = error # Password-based key derivation must dotnet_diagnostic.SES1003.severity = error # Password-based key derivation must use a sufficient iteration count dotnet_diagnostic.SES1004.severity = error # A secret must not be produced from Guid.NewGuid() dotnet_diagnostic.SES1005.severity = error # Compare secret values in constant time -dotnet_diagnostic.SES1006.severity = error # A Data Protection key ring is persisted without a ProtectKeysWith call, so keys sit unencrypted at rest -dotnet_diagnostic.SES1007.severity = error # A cryptographic primitive is implemented by hand instead of using a vetted platform algorithm -dotnet_diagnostic.SES1008.severity = error # An XML signature is verified with the no-key CheckSignature overload, trusting the document's own KeyInfo +dotnet_diagnostic.SES1006.severity = error # A Data Protection key ring is persisted without ProtectKeysWith +dotnet_diagnostic.SES1007.severity = error # A cryptographic primitive is implemented by hand +dotnet_diagnostic.SES1008.severity = error # An XML signature is verified with the no-key CheckSignature overload dotnet_diagnostic.SES1009.severity = error # A password is stored without a slow, salted key-derivation function # Transport dotnet_diagnostic.SES1102.severity = error # Do not accept any server certificate dotnet_diagnostic.SES1104.severity = error # Certificate-chain validation must not be deliberately weakened -dotnet_diagnostic.SES1105.severity = error # Bearer and OpenID Connect metadata must not be retrieved over plain HTTP outside development +dotnet_diagnostic.SES1105.severity = error # Bearer or OpenID Connect metadata is retrieved over plain HTTP dotnet_diagnostic.SES1106.severity = error # Do not send HttpClient requests to a cleartext http URL -dotnet_diagnostic.SES1107.severity = error # A SQL connection string weakens transport security via TrustServerCertificate or a disabled Encrypt -dotnet_diagnostic.SES1108.severity = error # A custom server-certificate validation callback unconditionally returns true, so any certificate is trusted +dotnet_diagnostic.SES1107.severity = error # A SQL connection string weakens transport security +dotnet_diagnostic.SES1108.severity = error # A certificate validation callback unconditionally returns true # Secrets dotnet_diagnostic.SES1201.severity = error # Do not hard-code secrets in source @@ -1966,8 +1977,8 @@ dotnet_diagnostic.SES1401.severity = error # A type resolved from non-constant d dotnet_diagnostic.SES1402.severity = error # Do not load an assembly from raw bytes or a non-constant location dotnet_diagnostic.SES1403.severity = error # JSON deserialization depth limit must stay within a safe ceiling dotnet_diagnostic.SES1404.severity = error # A type is instantiated by name from a non-constant Activator typeName -dotnet_diagnostic.SES1405.severity = error # MessagePack typeless deserialization reconstructs whatever type the payload names -dotnet_diagnostic.SES1406.severity = warning # Reflection must not reach non-public members via BindingFlags.NonPublic (opt-in; replaces S3011) +dotnet_diagnostic.SES1405.severity = error # MessagePack typeless deserialization reconstructs the named type +dotnet_diagnostic.SES1406.severity = error # Reflection must not reach non-public members via BindingFlags.NonPublic # Web hardening dotnet_diagnostic.SES1501.severity = error # A CORS policy must not allow credentials together with any origin @@ -1978,10 +1989,10 @@ dotnet_diagnostic.SES1505.severity = error # The request body size limit must no dotnet_diagnostic.SES1506.severity = error # The developer exception page must be guarded by a development-environment check dotnet_diagnostic.SES1507.severity = error # AllowAnonymous and Authorize on the same declaration conflict dotnet_diagnostic.SES1508.severity = error # A validation method must not fail open by returning success from a catch -dotnet_diagnostic.SES1509.severity = error # A backtracking-prone constant regex runs without a match timeout or NonBacktracking +dotnet_diagnostic.SES1509.severity = error # A backtracking-prone regex runs without a match timeout dotnet_diagnostic.SES1510.severity = error # A controller redirects to a non-constant URL, allowing an open redirect -dotnet_diagnostic.SES1511.severity = error # The forwarded-headers trust boundary is cleared, letting proxies spoof the client IP -dotnet_diagnostic.SES1512.severity = error # Sensitive framework diagnostics are enabled without a development-environment guard +dotnet_diagnostic.SES1511.severity = error # The forwarded-headers trust boundary is cleared +dotnet_diagnostic.SES1512.severity = error # Sensitive diagnostics are enabled without an environment guard dotnet_diagnostic.SES1513.severity = error # An AuthorizeAsync result is discarded, so the guarded operation runs regardless dotnet_diagnostic.SES1514.severity = error # OpenID Connect protections (PKCE, state, nonce) are disabled dotnet_diagnostic.SES1515.severity = error # A Content-Security-Policy value disables its own protection @@ -1989,37 +2000,39 @@ dotnet_diagnostic.SES1515.severity = error # A Content-Security-Policy value dis # AI trust boundaries dotnet_diagnostic.SES1601.severity = error # An LLM system prompt must be a constant, trusted template dotnet_diagnostic.SES1602.severity = error # Do not route AI model output into a process, file, or raw SQL sink -dotnet_diagnostic.SES1603.severity = error # An AI tool declared read-only or non-destructive must not call a state-changing API +dotnet_diagnostic.SES1603.severity = error # A read-only AI tool calls a state-changing API dotnet_diagnostic.SES1604.severity = error # Prompt-template input encoding must not be disabled dotnet_diagnostic.SES1605.severity = error # AI instrumentation must not enable sensitive-data capture dotnet_diagnostic.SES1606.severity = error # Do not fetch model weights over cleartext HTTP # Web UI trust boundaries -dotnet_diagnostic.SES1701.severity = error # Raw HTML is rendered from a non-constant value (`MarkupString`/`AddMarkupContent`), bypassing automatic encoding — an XSS risk. Sanitizer allow-list via `securitysharp.SES1701.sanitizers`. -dotnet_diagnostic.SES1702.severity = error # A JavaScript-interop call targets a script-evaluation primitive (`eval`, `Function`, `document.write`), turning interop into a script-injection channel. -dotnet_diagnostic.SES1703.severity = error # `[Authorize]` on a non-routable component enforces nothing — authorization runs as a routing concern. Exempt types via `securitysharp.SES1703.exempt_types`. -dotnet_diagnostic.SES1704.severity = error # `IHttpContextAccessor` or a cascading `HttpContext` is used in an interactively-rendered component, where it is null or frozen at circuit start. -dotnet_diagnostic.SES1705.severity = error # `NavigationManager.NavigateTo` is called with a target that is not a verified relative URL — an open-redirect risk. Validator allow-list via `securitysharp.SES1705.validators`. -dotnet_diagnostic.SES1706.severity = error # An uploaded file is read with an unbounded or client-chosen size limit, letting an attacker fill server memory. Threshold via `securitysharp.SES1706.max_bytes`. -dotnet_diagnostic.SES1707.severity = error # A secret-shaped literal appears in code reachable as WebAssembly, which downloads to the browser in full — guaranteed disclosure. -dotnet_diagnostic.SES1708.severity = error # `CircuitOptions.DetailedErrors` is enabled, shipping server exception detail to every connected client. -dotnet_diagnostic.SES1709.severity = error # `SerializeAllClaims` serializes every claim into client-readable WebAssembly authentication state, exposing internal ids, tokens, and PII. -dotnet_diagnostic.SES1710.severity = error # Antiforgery validation is disabled on a form (`[RequireAntiforgeryToken(required: false)]`), removing CSRF protection. +dotnet_diagnostic.SES1701.severity = error # Raw HTML is rendered from a non-constant value — an XSS risk +dotnet_diagnostic.SES1702.severity = error # A JavaScript-interop call targets a script-evaluation primitive +dotnet_diagnostic.SES1703.severity = error # [Authorize] on a non-routable component enforces nothing +dotnet_diagnostic.SES1704.severity = error # HttpContext is used in an interactively-rendered component +dotnet_diagnostic.SES1705.severity = error # NavigateTo is called with an unverified target — open-redirect risk +dotnet_diagnostic.SES1706.severity = error # An uploaded file is read with an unbounded or client-chosen size limit +dotnet_diagnostic.SES1707.severity = error # A secret-shaped literal sits in code that downloads to the browser +dotnet_diagnostic.SES1708.severity = error # CircuitOptions.DetailedErrors ships exception detail to clients +dotnet_diagnostic.SES1709.severity = error # SerializeAllClaims exposes every claim to the client +dotnet_diagnostic.SES1710.severity = error # Antiforgery validation is disabled on a form ################### -# Microsoft.CodeAnalysis.PublicApiAnalyzers (RS) +# Public API surface tracking (PAS) ################### -# Public API surface tracking -dotnet_diagnostic.RS0016.severity = error # public symbol missing from the PublicAPI baseline -dotnet_diagnostic.RS0017.severity = error # PublicAPI baseline entry no longer in source +dotnet_diagnostic.PAS0001.severity = error # A public symbol is missing from the baseline for this target framework +dotnet_diagnostic.PAS0002.severity = error # A baseline entry no longer exists in the public API +dotnet_diagnostic.PAS0003.severity = error # A public symbol differs from its baseline entry +dotnet_diagnostic.PAS0004.severity = error # No public API baseline for this target framework +dotnet_diagnostic.PAS0005.severity = error # The public API baseline could not be read ################### # Microsoft.NET.ILLink.Analyzers (IL) ################### # Trimming # See: https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-warnings/ -dotnet_diagnostic.IL2001.severity = error # Type in UnreferencedCode attribute doesn't have matching RequiresUnreferencedCode +dotnet_diagnostic.IL2001.severity = error # Type in UnreferencedCode attribute lacks RequiresUnreferencedCode dotnet_diagnostic.IL2002.severity = error # Method with RequiresUnreferencedCode called from code without that attribute dotnet_diagnostic.IL2003.severity = error # RequiresUnreferencedCode attribute is only supported on methods dotnet_diagnostic.IL2004.severity = error # Incorrect RequiresUnreferencedCode signature @@ -2037,8 +2050,8 @@ dotnet_diagnostic.IL2016.severity = error # Could not find type from substitutio dotnet_diagnostic.IL2017.severity = error # Could not find method in type specified in substitution XML dotnet_diagnostic.IL2018.severity = error # Could not find field in type specified in substitution XML dotnet_diagnostic.IL2019.severity = error # Could not find interface implementation in type -dotnet_diagnostic.IL2022.severity = error # Type in DynamicallyAccessedMembers attribute doesn't have matching DynamicallyAccessedMembers annotation -dotnet_diagnostic.IL2023.severity = error # Method returning DynamicallyAccessedMembers annotated type requires the same annotation +dotnet_diagnostic.IL2022.severity = error # Type in DynamicallyAccessedMembers attribute lacks a matching annotation +dotnet_diagnostic.IL2023.severity = error # Method returning an annotated type requires the same annotation dotnet_diagnostic.IL2024.severity = error # Multiple DynamicallyAccessedMembers annotations on a member are not supported dotnet_diagnostic.IL2025.severity = error # Duplicate preserve attribute dotnet_diagnostic.IL2026.severity = error # Using member annotated with RequiresUnreferencedCode @@ -2049,15 +2062,15 @@ dotnet_diagnostic.IL2030.severity = error # Dynamic invocation of method requiri dotnet_diagnostic.IL2031.severity = error # Could not resolve dependency assembly from embedded resource dotnet_diagnostic.IL2032.severity = error # Error reading debug symbols dotnet_diagnostic.IL2033.severity = error # Trying to modify a sealed type -dotnet_diagnostic.IL2034.severity = error # Value passed to the implicit 'this' parameter does not satisfy 'DynamicallyAccessedMembersAttribute' requirements -dotnet_diagnostic.IL2035.severity = error # Unrecognized value passed to the parameter of method with 'DynamicallyAccessedMembersAttribute' requirements -dotnet_diagnostic.IL2036.severity = error # Interface implementation has different DynamicallyAccessedMembers annotations than interface +dotnet_diagnostic.IL2034.severity = error # Value passed to implicit 'this' fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2035.severity = error # Unrecognized value passed to an annotated parameter +dotnet_diagnostic.IL2036.severity = error # Interface implementation annotations differ from the interface dotnet_diagnostic.IL2037.severity = error # BaseType annotation doesn't match dotnet_diagnostic.IL2038.severity = error # Derived type doesn't have matching DynamicallyAccessedMembers annotation -dotnet_diagnostic.IL2039.severity = error # Implementation method doesn't have matching DynamicallyAccessedMembers annotation +dotnet_diagnostic.IL2039.severity = error # Implementation method lacks a matching DynamicallyAccessedMembers annotation dotnet_diagnostic.IL2040.severity = error # Interface member doesn't have matching DynamicallyAccessedMembers annotation dotnet_diagnostic.IL2041.severity = error # GetType call on DynamicallyAccessedMembers annotated generic parameter -dotnet_diagnostic.IL2042.severity = error # The DynamicallyAccessedMembersAttribute value used in a custom attribute is not compatible +dotnet_diagnostic.IL2042.severity = error # DynamicallyAccessedMembers value in a custom attribute is incompatible dotnet_diagnostic.IL2043.severity = error # DynamicallyAccessedMembersAttribute on property conflicts with base property dotnet_diagnostic.IL2044.severity = error # DynamicallyAccessedMembersAttribute on event conflicts with base event dotnet_diagnostic.IL2045.severity = error # Field type doesn't satisfy 'DynamicallyAccessedMembersAttribute' requirements @@ -2068,71 +2081,71 @@ dotnet_diagnostic.IL2050.severity = error # Correctness of COM interop cannot be dotnet_diagnostic.IL2051.severity = error # COM related type is trimmed dotnet_diagnostic.IL2052.severity = error # Resolving member reference for P/Invoke into type that is trimmed dotnet_diagnostic.IL2053.severity = error # Target method is trimmed -dotnet_diagnostic.IL2054.severity = error # Generic constraint type is annotated with DynamicallyAccessedMembersAttribute which requires unreferenced code +dotnet_diagnostic.IL2054.severity = error # Generic constraint type annotation requires unreferenced code dotnet_diagnostic.IL2055.severity = error # Type implements COM visible type but has no GUID -dotnet_diagnostic.IL2056.severity = error # Generic parameter with DynamicallyAccessedMembers annotation is not publicly visible -dotnet_diagnostic.IL2057.severity = error # Unrecognized value passed to the parameter of method with DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2058.severity = error # Parameter types of method doesn't have matching DynamicallyAccessedMembers annotation +dotnet_diagnostic.IL2056.severity = error # Annotated generic parameter is not publicly visible +dotnet_diagnostic.IL2057.severity = error # Unrecognized value passed to an annotated parameter +dotnet_diagnostic.IL2058.severity = error # Parameter types lack a matching DynamicallyAccessedMembers annotation dotnet_diagnostic.IL2059.severity = error # Unrecognized reflection pattern dotnet_diagnostic.IL2060.severity = error # Unrecognized value passed to parameter with DynamicallyAccessedMembersAttribute -dotnet_diagnostic.IL2061.severity = error # Value passed to implicit this parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2062.severity = error # Value passed to parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2063.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2064.severity = error # Value assigned to field doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2065.severity = error # Value passed to implicit this parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2066.severity = error # Value stored in field doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2067.severity = error # Value passed to implicit this parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2068.severity = error # Value passed to parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2069.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2070.severity = error # Value stored in field doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2071.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2072.severity = error # Value passed to parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2073.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2074.severity = error # Value stored in field doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2075.severity = error # Value passed to implicit this parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2076.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2077.severity = error # Value passed to parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2078.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2079.severity = error # Value stored in field doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2080.severity = error # Value passed to implicit this parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2081.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2082.severity = error # Value passed to parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2083.severity = error # Value stored in field doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2084.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2085.severity = error # Value passed to implicit this parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2087.severity = error # Value passed to parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2088.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2089.severity = error # Value stored in field doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2090.severity = error # Value passed to implicit this parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2091.severity = error # Target generic argument doesn't satisfy 'DynamicallyAccessedMembersAttribute' requirements -dotnet_diagnostic.IL2092.severity = error # Value passed to generic parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2093.severity = error # Value stored in field doesn't satisfy DynamicallyAccessedMembersAttribute requirements +dotnet_diagnostic.IL2061.severity = error # Value passed to implicit this fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2062.severity = error # Value passed to parameter fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2063.severity = error # Value returned from method fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2064.severity = error # Value assigned to field fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2065.severity = error # Value passed to implicit this fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2066.severity = error # Value stored in field fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2067.severity = error # Value passed to implicit this fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2068.severity = error # Value passed to parameter fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2069.severity = error # Value returned from method fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2070.severity = error # Value stored in field fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2071.severity = error # Value returned from method fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2072.severity = error # Value passed to parameter fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2073.severity = error # Value returned from method fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2074.severity = error # Value stored in field fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2075.severity = error # Value passed to implicit this fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2076.severity = error # Value returned from method fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2077.severity = error # Value passed to parameter fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2078.severity = error # Value returned from method fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2079.severity = error # Value stored in field fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2080.severity = error # Value passed to implicit this fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2081.severity = error # Value returned from method fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2082.severity = error # Value passed to parameter fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2083.severity = error # Value stored in field fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2084.severity = error # Value returned from method fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2085.severity = error # Value passed to implicit this fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2087.severity = error # Value passed to parameter fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2088.severity = error # Value returned from method fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2089.severity = error # Value stored in field fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2090.severity = error # Value passed to implicit this fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2091.severity = error # Target generic argument fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2092.severity = error # Value passed to generic parameter fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2093.severity = error # Value stored in field fails DynamicallyAccessedMembers dotnet_diagnostic.IL2094.severity = error # DynamicallyAccessedMembers on 'this' parameter doesn't match overridden member -dotnet_diagnostic.IL2095.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements +dotnet_diagnostic.IL2095.severity = error # Value returned from method fails DynamicallyAccessedMembers dotnet_diagnostic.IL2096.severity = error # Calling method on statically typed generic instance requires unreferenced code -dotnet_diagnostic.IL2097.severity = error # Value passed to parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2098.severity = error # Value stored in field doesn't satisfy DynamicallyAccessedMembersAttribute requirements -dotnet_diagnostic.IL2099.severity = error # Value returned from method doesn't satisfy DynamicallyAccessedMembersAttribute requirements +dotnet_diagnostic.IL2097.severity = error # Value passed to parameter fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2098.severity = error # Value stored in field fails DynamicallyAccessedMembers +dotnet_diagnostic.IL2099.severity = error # Value returned from method fails DynamicallyAccessedMembers dotnet_diagnostic.IL2100.severity = error # XML stream doesn't conform to the schema dotnet_diagnostic.IL2101.severity = error # Embedded XML in assembly couldn't be loaded dotnet_diagnostic.IL2102.severity = error # Invalid warning number passed to UnconditionalSuppressMessage -dotnet_diagnostic.IL2103.severity = error # Value passed to the 'propertyAccessExpression' parameter doesn't satisfy DynamicallyAccessedMembersAttribute requirements +dotnet_diagnostic.IL2103.severity = error # Value passed to 'propertyAccessExpression' fails DynamicallyAccessedMembers dotnet_diagnostic.IL2104.severity = error # Assembly that was specified through a custom step dotnet_diagnostic.IL2105.severity = error # Type from a custom step that couldn't be loaded dotnet_diagnostic.IL2106.severity = error # Method from a custom step that couldn't be loaded -dotnet_diagnostic.IL2107.severity = error # Methods in types that derive from RemotingClientProxy cannot be statically determined +dotnet_diagnostic.IL2107.severity = error # Methods on RemotingClientProxy-derived types cannot be determined dotnet_diagnostic.IL2108.severity = error # Invalid scope for UnconditionalSuppressMessage dotnet_diagnostic.IL2109.severity = error # Method doesn't have matching DynamicallyAccessedMembers annotation dotnet_diagnostic.IL2110.severity = error # Invalid member name in UnconditionalSuppressMessage -dotnet_diagnostic.IL2111.severity = error # Method with parameters or return value with DynamicallyAccessedMembersAttribute is not supported -dotnet_diagnostic.IL2112.severity = error # Reflection call to method with DynamicallyAccessedMembersAttribute requirements cannot be statically analyzed -dotnet_diagnostic.IL2113.severity = error # DynamicallyAccessedMembers on type references Type.MakeGenericType with different requirements +dotnet_diagnostic.IL2111.severity = error # Annotated parameters or return value are unsupported here +dotnet_diagnostic.IL2112.severity = error # Reflection call to an annotated method cannot be analyzed +dotnet_diagnostic.IL2113.severity = error # Annotation references MakeGenericType with different requirements dotnet_diagnostic.IL2114.severity = error # DynamicallyAccessedMembers mismatch on signature types -dotnet_diagnostic.IL2115.severity = error # DynamicallyAccessedMembers on type or base types references member which requires unreferenced code +dotnet_diagnostic.IL2115.severity = error # Annotated type or base references a member requiring unreferenced code dotnet_diagnostic.IL2116.severity = error # DynamicallyAccessedMembers on parameter types doesn't match overridden parameter dotnet_diagnostic.IL2117.severity = error # Methods with DynamicallyAccessedMembersAttribute annotations cannot be replaced -dotnet_diagnostic.IL2122.severity = error # Reflection call to method with UnreferencedCode attribute cannot be statically analyzed -dotnet_diagnostic.IL2123.severity = error # DynamicallyAccessedMembers on method or parameter doesn't match overridden member +dotnet_diagnostic.IL2122.severity = error # Reflection call to an UnreferencedCode method cannot be analyzed +dotnet_diagnostic.IL2123.severity = error # DynamicallyAccessedMembers does not match the overridden member # Native AOT # See: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/warnings/ @@ -2153,26 +2166,27 @@ dotnet_diagnostic.S1075.severity = none # Hardcoded URI — canonical SourceLink dotnet_diagnostic.S2436.severity = none # Too many generic parameters — needed for the projector overload dotnet_diagnostic.S4036.severity = none # PATH-relative process spawn — benchmark only, trusted env dotnet_diagnostic.S8969.severity = none # Nullability inference is inconsistent across the repository's target frameworks +dotnet_diagnostic.S8970.severity = none # Redundant null-forgiving operator — covered by SST2209 # Blocker bugs dotnet_diagnostic.S1048.severity = none # Finalizers should not throw exceptions — covered by SST1485 dotnet_diagnostic.S2190.severity = none # Loops and recursions should not be infinite -dotnet_diagnostic.S2275.severity = none # Composite format strings should not lead to unexpected behavior at runtime - DUPLICATE CA2241 +dotnet_diagnostic.S2275.severity = none # Composite format strings — covered by CA2241 dotnet_diagnostic.S2857.severity = none # SQL keywords should be delimited by whitespace — covered by SST2470 dotnet_diagnostic.S2930.severity = none # "IDisposables" should be disposed — covered by SST2410 -dotnet_diagnostic.S2931.severity = none # Classes with "IDisposable" members should implement "IDisposable" — covered by SST2315 +dotnet_diagnostic.S2931.severity = none # Types with IDisposable members should implement IDisposable — SST2315 dotnet_diagnostic.S3464.severity = none # Type inheritance should not be recursive — covered by SST2437 dotnet_diagnostic.S3869.severity = none # "SafeHandle.DangerousGetHandle" should not be called -> replaced by SST2484 -dotnet_diagnostic.S3889.severity = none # "Thread.Resume" and "Thread.Suspend" should not be used -> replaced by obsolete or compiler +dotnet_diagnostic.S3889.severity = none # Thread.Resume and Thread.Suspend — replaced by obsolete markers dotnet_diagnostic.S4159.severity = none # Classes should implement their "ExportAttribute" interfaces — covered by SST2472 # Critical bugs dotnet_diagnostic.S2551.severity = none # Shared resources should not be used for locking — covered by SST1902 -dotnet_diagnostic.S2952.severity = none # Classes should "Dispose" of members from the classes' own "Dispose" methods -> replaced by SST2315 +dotnet_diagnostic.S2952.severity = none # Dispose members from the type's own Dispose — covered by SST2315 dotnet_diagnostic.S3449.severity = none # Right operands of shift operators should be integers -> replaced by SST1478 dotnet_diagnostic.S4275.severity = none # Getters and setters should access the expected fields — covered by SST2422 dotnet_diagnostic.S4277.severity = none # "Shared" parts should not be created with "new" — covered by SST2473 -dotnet_diagnostic.S4583.severity = none # Calls to delegate's method "BeginInvoke" should be paired with calls to "EndInvoke" -> replaced by obsolete (APM BeginInvoke/EndInvoke) +dotnet_diagnostic.S4583.severity = none # BeginInvoke should be paired with EndInvoke — replaced by obsolete dotnet_diagnostic.S4586.severity = none # Non-async "Task/Task" methods should not return null — covered by PSH1312 dotnet_diagnostic.S5856.severity = none # Regular expressions should be syntactically valid — covered by SST2444 dotnet_diagnostic.S6674.severity = none # Log message template should be syntactically correct — covered by SST2441 @@ -2181,89 +2195,90 @@ dotnet_diagnostic.S6674.severity = none # Log message template should be syntact dotnet_diagnostic.S1244.severity = none # Floating point numbers should not be tested for equality — covered by SST1473 dotnet_diagnostic.S1656.severity = none # Variables should not be self-assigned — covered by SST1189 dotnet_diagnostic.S1751.severity = none # Loops with at most one iteration should be refactored - covered by SST1444 -dotnet_diagnostic.S1764.severity = none # Identical expressions should not be used on both sides of operators — covered by SST1474 -dotnet_diagnostic.S1848.severity = none # Objects should not be created to be dropped immediately without being used -> replaced by SST1480 -dotnet_diagnostic.S1862.severity = none # Related "if/else if" statements should not have the same condition — covered by SST1475 -dotnet_diagnostic.S2114.severity = none # Collections should not be passed as arguments to their own methods — covered by SST2419 +dotnet_diagnostic.S1764.severity = none # Identical expressions on both sides of an operator — covered by SST1474 +dotnet_diagnostic.S1848.severity = none # Objects created and dropped immediately — covered by SST1480 +dotnet_diagnostic.S1862.severity = none # if/else if statements with the same condition — covered by SST1475 +dotnet_diagnostic.S2114.severity = none # Collections passed to their own methods — covered by SST2419 dotnet_diagnostic.S2123.severity = none # Values should not be uselessly incremented -> replaced by SST2222 -dotnet_diagnostic.S2201.severity = none # Methods without side effects should not have their return values ignored — covered by SST2418 +dotnet_diagnostic.S2201.severity = none # Side-effect-free return values ignored — covered by SST2418 dotnet_diagnostic.S2225.severity = none # "ToString()" method should not return null — covered by SST2431 -dotnet_diagnostic.S2251.severity = none # A "for" loop update clause should move the counter in the right direction — covered by SST2412 +dotnet_diagnostic.S2251.severity = none # A for loop counter moving the wrong way — covered by SST2412 dotnet_diagnostic.S2252.severity = none # For-loop conditions should be true at least once — covered by SST2413 dotnet_diagnostic.S2445.severity = none # Blocks should be synchronized on read-only fields — covered by SST1904 dotnet_diagnostic.S2688.severity = none # "NaN" should not be used in comparisons — covered by SST1473 dotnet_diagnostic.S2757.severity = none # Non-existent operators like "=+" should not be used — covered by SST2417 dotnet_diagnostic.S2761.severity = none # Doubled prefix operators "!!" and "~~" should not be used — covered by SST1190 -dotnet_diagnostic.S2995.severity = none # "Object.ReferenceEquals" should not be used for value types -> replaced by CA2013 +dotnet_diagnostic.S2995.severity = none # ReferenceEquals on value types — covered by CA2013 dotnet_diagnostic.S2996.severity = none # "ThreadStatic" fields should not be initialized -> replaced by CA2019 -dotnet_diagnostic.S2997.severity = none # "IDisposables" created in a "using" statement should not be returned — covered by SST2423 +dotnet_diagnostic.S2997.severity = none # IDisposables created in a using should not be returned — SST2423 dotnet_diagnostic.S3005.severity = none # "ThreadStatic" should not be used on non-static fields -> replaced by CA2259 dotnet_diagnostic.S3168.severity = none # "async" methods should not return "void" — covered by SST1905 dotnet_diagnostic.S3172.severity = none # Delegates should not be subtracted — covered by SST2448 -dotnet_diagnostic.S3244.severity = none # Anonymous delegates should not be used to unsubscribe from Events — covered by SST2449 +dotnet_diagnostic.S3244.severity = none # Anonymous delegates used to unsubscribe from events — SST2449 dotnet_diagnostic.S3249.severity = none # Covered by SST1447 (canonical) -dotnet_diagnostic.S3263.severity = none # Static fields should appear in the order they must be initialized — covered by SST2428 -dotnet_diagnostic.S3343.severity = none # Caller information parameters should come at the end of the parameter list — covered by SST2433 -dotnet_diagnostic.S3346.severity = none # Expressions used in "Debug.Assert" should not produce side effects — covered by SST2450 +dotnet_diagnostic.S3263.severity = none # Static fields ordered by initialization need — covered by SST2428 +dotnet_diagnostic.S3343.severity = none # Caller-info parameters should come last — covered by SST2433 +dotnet_diagnostic.S3346.severity = none # Debug.Assert expressions with side effects — covered by SST2450 dotnet_diagnostic.S3453.severity = none # Classes should not have only "private" constructors — covered by SST2451 dotnet_diagnostic.S3466.severity = none # Optional parameters should be passed to "base" calls — covered by SST2425 -dotnet_diagnostic.S3598.severity = none # One-way "OperationContract" methods should have "void" return type -> replaced by obsolete (WCF) +dotnet_diagnostic.S3598.severity = none # One-way OperationContract should return void — replaced by obsolete dotnet_diagnostic.S3603.severity = none # Methods with "Pure" attribute should return a value — covered by SST2452 dotnet_diagnostic.S3610.severity = none # Nullable type comparison should not be redundant -> replaced by compiler CS0472 dotnet_diagnostic.S3903.severity = none # Types should be defined in named namespaces — covered by SST2312 -dotnet_diagnostic.S3923.severity = none # All branches in a conditional structure should not have exactly the same implementation — covered by SST1476 -dotnet_diagnostic.S3926.severity = none # Deserialization methods should be provided for "OptionalField" members -> replaced by obsolete (legacy binary serialization) -dotnet_diagnostic.S3927.severity = none # Serialization event handlers should be implemented correctly — covered by SST2430 -dotnet_diagnostic.S3981.severity = none # Collection sizes and array length comparisons should make sense — covered by SST1479 +dotnet_diagnostic.S3923.severity = none # All branches with the same implementation — covered by SST1476 +dotnet_diagnostic.S3926.severity = none # Deserialization methods for OptionalField — replaced by obsolete +dotnet_diagnostic.S3927.severity = none # Serialization event handlers — covered by SST2430 +dotnet_diagnostic.S3981.severity = none # Collection size and array length comparisons — covered by SST1479 dotnet_diagnostic.S3984.severity = none # Exceptions should not be created without being thrown — covered by SST1480 dotnet_diagnostic.S4143.severity = none # Collection elements should not be replaced unconditionally — covered by SST1487 -dotnet_diagnostic.S4210.severity = none # Windows Forms entry points should be marked with STAThread -> replaced by SST2706 -dotnet_diagnostic.S4260.severity = none # "ConstructorArgument" parameters should exist in constructors -> replaced by SST2487 -dotnet_diagnostic.S4428.severity = none # "PartCreationPolicyAttribute" should be used with "ExportAttribute" — covered by SST2474 +dotnet_diagnostic.S4210.severity = none # Windows Forms entry points need STAThread — replaced by SST2706 +dotnet_diagnostic.S4260.severity = none # ConstructorArgument parameters must exist — replaced by SST2487 +dotnet_diagnostic.S4428.severity = none # PartCreationPolicy needs Export — covered by SST2474 dotnet_diagnostic.S6507.severity = none # Blocks should not be synchronized on local variables — covered by SST1903 dotnet_diagnostic.S6677.severity = none # Message template placeholders should be unique — covered by SST2442 dotnet_diagnostic.S6797.severity = none # Blazor query parameter type should be supported -> replaced by SST2702 -dotnet_diagnostic.S6798.severity = none # [JSInvokable] attribute should only be used on public methods -> replaced by SST2701 -dotnet_diagnostic.S6800.severity = none # Component parameter type should match the route parameter type constraint -> replaced by SST2703 +dotnet_diagnostic.S6798.severity = none # [JSInvokable] only on public methods — replaced by SST2701 +dotnet_diagnostic.S6800.severity = none # Component parameter must match the route constraint — SST2703 dotnet_diagnostic.S6930.severity = none # Backslash should be avoided in route templates -> replaced by SST2700 +dotnet_diagnostic.S8949.severity = none # A CancellationToken should be forwarded to the overload that takes one — covered by CA2016 # Minor bugs -dotnet_diagnostic.S1206.severity = none # "Equals(Object)" and "GetHashCode()" should be overridden in pairs - DUPLICATE CA2218 -dotnet_diagnostic.S1226.severity = none # Method parameters, caught exceptions and foreach variables' initial values should not be ignored -dotnet_diagnostic.S2183.severity = none # Integral numbers should not be shifted by zero or more than their number of bits-1 — covered by SST1478 -dotnet_diagnostic.S2184.severity = none # Results of integer division should not be assigned to floating point variables — covered by SST1477 +dotnet_diagnostic.S1206.severity = none # Equals and GetHashCode overridden in pairs — covered by CA2218 +dotnet_diagnostic.S1226.severity = none # Parameter and foreach initial values should not be ignored +dotnet_diagnostic.S2183.severity = none # Shift counts beyond the operand width — covered by SST1478 +dotnet_diagnostic.S2184.severity = none # Integer division assigned to a floating point value — SST1477 dotnet_diagnostic.S2328.severity = none # "GetHashCode" should not reference mutable fields — covered by SST1482 -dotnet_diagnostic.S2345.severity = none # Flags enumerations should explicitly initialize all their members — covered by SST2303 +dotnet_diagnostic.S2345.severity = none # Flags enums should initialize all members — covered by SST2303 dotnet_diagnostic.S2674.severity = none # The length returned from a stream read should be checked — covered by SST2446 -dotnet_diagnostic.S2934.severity = none # Property assignments should not be made for "readonly" fields not constrained to reference types — covered by SST2421 -dotnet_diagnostic.S2955.severity = none # Generic parameters not constrained to reference types should not be compared to "null" -> replaced by compiler CS0019/CS0037 +dotnet_diagnostic.S2934.severity = none # Assignment to a readonly field of a type parameter — SST2421 +dotnet_diagnostic.S2955.severity = none # Unconstrained generic compared to null — replaced by the compiler dotnet_diagnostic.S3363.severity = none # Date and time should not be used as a type for primary keys — covered by SST2475 -dotnet_diagnostic.S3397.severity = none # "base.Equals" should not be used to check for reference equality in "Equals" if "base" is not "object" — covered by SST2435 -dotnet_diagnostic.S3456.severity = none # "string.ToCharArray()" and "ReadOnlySpan.ToArray()" should not be called redundantly — covered by PSH1217 +dotnet_diagnostic.S3397.severity = none # base.Equals used for reference equality — covered by SST2435 +dotnet_diagnostic.S3456.severity = none # Redundant ToCharArray and ToArray calls — covered by PSH1217 dotnet_diagnostic.S3887.severity = none # Mutable, non-private fields should not be "readonly" — covered by SST2322 # Blocker vulnerabilities -dotnet_diagnostic.S2115.severity = none # A secure password should be used when connecting to a database -> replaced by SES1203 +dotnet_diagnostic.S2115.severity = none # A secure database password should be used — replaced by SES1203 dotnet_diagnostic.S2755.severity = none # XML parsers should not be vulnerable to XXE attacks -> replaced by CA3075 -dotnet_diagnostic.S3884.severity = none # "CoSetProxyBlanket" and "CoInitializeSecurity" should not be used -> replaced by obsolete (COM interop security) +dotnet_diagnostic.S3884.severity = none # CoSetProxyBlanket and CoInitializeSecurity — replaced by obsolete dotnet_diagnostic.S6418.severity = none # Secrets should not be hard-coded — covered by SES1201 # Critical vulnerabilities dotnet_diagnostic.S4423.severity = none # Weak SSL/TLS protocols should not be used -> replaced by CA5397/CA5398 dotnet_diagnostic.S4426.severity = none # Cryptographic keys should be robust -> replaced by CA5385 (RSA) / CA5384 (DSA) dotnet_diagnostic.S4433.severity = none # LDAP connections should be authenticated -> replaced by SES1310 -dotnet_diagnostic.S4830.severity = none # Server certificates should be verified during SSL/TLS connections -> replaced by SES1102 or SES1108 -dotnet_diagnostic.S5344.severity = none # Passwords should not be stored in plaintext or with a fast hashing algorithm -> replaced by SES1009 -dotnet_diagnostic.S5445.severity = none # Insecure temporary file creation methods should not be used -> replaced by SES1307 -dotnet_diagnostic.S5542.severity = none # Encryption algorithms should be used with secure mode and padding scheme -> replaced by CA5358 +dotnet_diagnostic.S4830.severity = none # Server certificates should be verified — replaced by SES1102/SES1108 +dotnet_diagnostic.S5344.severity = none # Passwords stored with a fast hash — replaced by SES1009 +dotnet_diagnostic.S5445.severity = none # Insecure temporary file creation — replaced by SES1307 +dotnet_diagnostic.S5542.severity = none # Encryption mode and padding scheme — replaced by CA5358 dotnet_diagnostic.S5547.severity = none # Cipher algorithms should be robust -> replaced by CA5351 -dotnet_diagnostic.S5659.severity = none # JWT should be signed and verified with strong cipher algorithms -> replaced by SES1503 +dotnet_diagnostic.S5659.severity = none # JWT signed with strong cipher algorithms — replaced by SES1503 # Major vulnerabilities dotnet_diagnostic.S2068.severity = none # Credentials should not be hard-coded -> replaced by SES1201 -dotnet_diagnostic.S2612.severity = none # File permissions should not be set to world-accessible values -> replaced by SES1308 -dotnet_diagnostic.S4211.severity = none # Members should not have conflicting transparency annotations -> replaced by obsolete (Code Access Security) -dotnet_diagnostic.S4212.severity = none # Serialization constructors should be secured -> replaced by obsolete (Code Access Security) +dotnet_diagnostic.S2612.severity = none # World-accessible file permissions — replaced by SES1308 +dotnet_diagnostic.S4211.severity = none # Conflicting transparency annotations — replaced by obsolete +dotnet_diagnostic.S4212.severity = none # Serialization constructors should be secured — replaced by obsolete dotnet_diagnostic.S6377.severity = none # XML signatures should be validated securely -> replaced by SES1008 dotnet_diagnostic.S7039.severity = none # Content Security Policies should be restrictive -> replaced by SES1515 @@ -2272,86 +2287,86 @@ dotnet_diagnostic.S1147.severity = none # Exit methods should not be called — dotnet_diagnostic.S1451.severity = none # Track lack of copyright and license headers dotnet_diagnostic.S2178.severity = none # Short-circuit logic should be used in boolean contexts — covered by SST2415 dotnet_diagnostic.S2187.severity = none # Test classes should contain at least one test case — covered by SST2504 -dotnet_diagnostic.S2306.severity = none # "async" and "await" should not be used as identifiers -> replaced by compiler (contextual keyword) -dotnet_diagnostic.S2368.severity = none # Public methods should not have multidimensional array parameters — jagged arrays are the chosen layout for hot-path lookup tables +dotnet_diagnostic.S2306.severity = none # async and await as identifiers — replaced by the compiler +dotnet_diagnostic.S2368.severity = none # Public multidimensional array parameters — jagged is our layout dotnet_diagnostic.S2387.severity = none # Child class fields should not shadow parent class fields — covered by SST1484 dotnet_diagnostic.S2437.severity = none # Unnecessary bit operations should not be performed — covered by SST1481 dotnet_diagnostic.S2699.severity = none # Tests should include assertions -> replaced by SST2500 -dotnet_diagnostic.S2953.severity = none # Methods named "Dispose" should implement "IDisposable.Dispose" — covered by SST2316 +dotnet_diagnostic.S2953.severity = none # Methods named Dispose should implement IDisposable — SST2316 dotnet_diagnostic.S2970.severity = none # Assertions should be complete -> replaced by SST2508 dotnet_diagnostic.S3060.severity = none # "is" should not be used with "this" -> replaced by SST2327 dotnet_diagnostic.S3237.severity = none # "value" contextual keyword should be used — covered by SST2429 -dotnet_diagnostic.S3427.severity = none # Method overloads with default parameter values should not overlap — covered by SST2319 +dotnet_diagnostic.S3427.severity = none # Overlapping default parameter overloads — covered by SST2319 dotnet_diagnostic.S3433.severity = none # Test method signatures should be correct -> replaced by SST2509 dotnet_diagnostic.S3443.severity = none # Type should not be examined on "System.Type" instances — covered by SST2432 dotnet_diagnostic.S3875.severity = none # "operator==" should not be overloaded on reference types -> replaced by SST2464 dotnet_diagnostic.S3877.severity = none # Exceptions should not be thrown from unexpected methods — covered by SST1485 dotnet_diagnostic.S4462.severity = none # Calls to "async" methods should not be blocking - covered by PSH1315 -dotnet_diagnostic.S6422.severity = none # Calls to "async" methods should not be blocking in Azure Functions — covered by PSH1315 -dotnet_diagnostic.S6424.severity = none # Interfaces for durable entities should satisfy the restrictions -> off: Durable Entity-specific; not used in this library +dotnet_diagnostic.S6422.severity = none # Blocking async calls in Azure Functions — covered by PSH1315 +dotnet_diagnostic.S6424.severity = none # Durable entity interface restrictions — not used in this library # Critical code smells dotnet_diagnostic.S1006.severity = none # Method overrides should not change parameter defaults — covered by SST2424 dotnet_diagnostic.S1067.severity = none # Expressions should not be too complex dotnet_diagnostic.S1163.severity = none # Exceptions should not be thrown in finally blocks -> replaced by CA2219 dotnet_diagnostic.S1186.severity = none # Methods should not be empty — covered by SST1438 -dotnet_diagnostic.S121.severity = none # Control structures should use curly braces (kept over SA1503 — Sonar 20ms vs SA1503 50ms) -> replaced by SST1503 +dotnet_diagnostic.S121.severity = none # Control structures should use braces — replaced by SST1503 dotnet_diagnostic.S1215.severity = none # "GC.Collect" should not be called — covered by PSH1021 dotnet_diagnostic.S126.severity = none # "if ... else if" constructs should end with "else" clauses dotnet_diagnostic.S131.severity = none # "switch/Select" statements should contain a "default/Case Else" clauses -dotnet_diagnostic.S134.severity = none # Control flow statements "if", "switch", "for", "foreach", "while", "do" and "try" should not be nested too deeply +dotnet_diagnostic.S134.severity = none # Control flow statements should not be nested too deeply dotnet_diagnostic.S1541.severity = none # Methods and properties should not be too complex - covered by SST1442 dotnet_diagnostic.S1699.severity = none # Constructors should only call non-overridable methods — covered by SST1483 dotnet_diagnostic.S1821.severity = none # "switch" statements should not be nested -> replaced by SST2252 dotnet_diagnostic.S1944.severity = none # Invalid casts should be avoided -> replaced by compiler CS0030 -dotnet_diagnostic.S1994.severity = none # "for" loop increment clauses should modify the loops' counters — covered by SST2411 +dotnet_diagnostic.S1994.severity = none # A for loop increment should modify the counter — covered by SST2411 dotnet_diagnostic.S2197.severity = none # Modulus results should not be checked for direct equality — covered by SST2416 dotnet_diagnostic.S2198.severity = none # Unnecessary mathematical comparisons should not be made -> replaced by SST2489 dotnet_diagnostic.S2223.severity = none # Non-constant static fields should not be visible - DUPLICATE CA2211 dotnet_diagnostic.S2290.severity = none # Field-like events should not be virtual -> replaced by SST2456 -dotnet_diagnostic.S2291.severity = none # Overflow checking should not be disabled for "Enumerable.Sum" — covered by SST2457 +dotnet_diagnostic.S2291.severity = none # Overflow checking disabled for Enumerable.Sum — covered by SST2457 dotnet_diagnostic.S2302.severity = none # "nameof" should be used — covered by SST1415 dotnet_diagnostic.S2330.severity = none # Array covariance should not be used — covered by SST2434 dotnet_diagnostic.S2339.severity = none # Public constant members should not be used — covered by SST2311 dotnet_diagnostic.S2346.severity = none # Flags enumerations zero-value members should be named "None" - DUPLICATE CA1008 -dotnet_diagnostic.S2360.severity = none # Optional parameters should not be used — conflicts with SST2433, which owns caller-info parameters requiring a default +dotnet_diagnostic.S2360.severity = none # Optional parameters should not be used — conflicts with SST2433 dotnet_diagnostic.S2365.severity = none # Properties should not make collection or array copies — covered by PSH1017 -dotnet_diagnostic.S2479.severity = none # Whitespace and control characters in string literals should be explicit — covered by SST1192 +dotnet_diagnostic.S2479.severity = none # Control characters in string literals — covered by SST1192 dotnet_diagnostic.S2692.severity = none # "IndexOf" checks should not be for positive numbers — covered by SST2420 dotnet_diagnostic.S2696.severity = none # Instance members should not write to "static" fields -> replaced by SST2402 dotnet_diagnostic.S2701.severity = none # Literal boolean values should not be used in assertions — covered by SST2503 -dotnet_diagnostic.S3215.severity = none # "interface" instances should not be cast to concrete types -> deliberately unenforced, same reason as SST2326 +dotnet_diagnostic.S3215.severity = none # Interfaces cast to concrete types — unenforced, as with SST2326 dotnet_diagnostic.S3216.severity = none # "ConfigureAwait(false)" should be used -> replaced by CA2007 -dotnet_diagnostic.S3217.severity = none # "Explicit" conversions of "foreach" loops should not be used — covered by SST2225 -dotnet_diagnostic.S3218.severity = none # Inner class members should not shadow outer class "static" or type members — covered by SST1484 +dotnet_diagnostic.S3217.severity = none # Explicit conversions in foreach loops — covered by SST2225 +dotnet_diagnostic.S3218.severity = none # Inner members shadowing outer members — covered by SST1484 dotnet_diagnostic.S3265.severity = none # Non-flags enums should not be used in bitwise operations — covered by SST2458 dotnet_diagnostic.S3353.severity = none # Unchanged variables should be marked as "const" — covered by PSH1402 -dotnet_diagnostic.S3447.severity = none # "[Optional]" should not be used on "ref" or "out" parameters — covered by SST2459 -dotnet_diagnostic.S3451.severity = none # "[DefaultValue]" should not be used when "[DefaultParameterValue]" is meant — covered by SST2460 +dotnet_diagnostic.S3447.severity = none # [Optional] on ref or out parameters — covered by SST2459 +dotnet_diagnostic.S3451.severity = none # [DefaultValue] where [DefaultParameterValue] is meant — SST2460 dotnet_diagnostic.S3600.severity = none # "params" should not be introduced on overrides — covered by SST2426 dotnet_diagnostic.S3776.severity = none # Cognitive Complexity of methods should not be too high - covered by SST1443 dotnet_diagnostic.S3871.severity = none # Exception types should be "public" -> replaced by CA1064 dotnet_diagnostic.S3874.severity = none # "out" and "ref" parameters — repo idiom is TryX(..., out T value) -dotnet_diagnostic.S3904.severity = none # Assemblies should have version information -> replaced by obsolete (SDK supplies assembly version) +dotnet_diagnostic.S3904.severity = none # Assemblies should have version information — the SDK supplies it dotnet_diagnostic.S3937.severity = none # Number patterns should be regular — covered by SST1119 dotnet_diagnostic.S3972.severity = none # Conditionals should start on new lines — covered by SST1146 -dotnet_diagnostic.S3973.severity = none # A conditionally executed single line should be denoted by indentation -> replaced by SST1503 +dotnet_diagnostic.S3973.severity = none # A conditional single line should be indented — replaced by SST1503 dotnet_diagnostic.S3998.severity = none # Threads should not lock on objects with weak identity -> replaced by SST1902 dotnet_diagnostic.S4000.severity = none # Pointers to unmanaged memory should not be visible -> replaced by SST2328 dotnet_diagnostic.S4015.severity = none # Inherited member visibility should not be decreased — covered by SST2462 dotnet_diagnostic.S4019.severity = none # Base class methods should not be hidden — covered by SST2427 -dotnet_diagnostic.S4025.severity = none # Child class fields should not differ from parent class fields only by capitalization — covered by SST2463 +dotnet_diagnostic.S4025.severity = none # Child fields differing from parent only by case — covered by SST2463 dotnet_diagnostic.S4039.severity = none # Interface methods should be callable by derived types - DUPLICATE CA1033 dotnet_diagnostic.S4487.severity = none # Unread "private" fields should be removed dotnet_diagnostic.S4524.severity = none # "default" clauses should be first or last — covered by SST1219 dotnet_diagnostic.S4635.severity = none # Start index should be used instead of calling Substring — covered by PSH1218 dotnet_diagnostic.S5034.severity = none # "ValueTask" should be consumed correctly — covered by PSH1316 -dotnet_diagnostic.S6967.severity = none # ModelState.IsValid should be called in controller actions -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S8367.severity = none # Identifiers should not conflict with the C# 14 "field" contextual keyword - the C# 14 compiler reports this: CS9273 (error) for a local named field in an accessor, CS9258 (warning) for a rebinding read -dotnet_diagnostic.S8368.severity = none # Identifiers should not conflict with the C# 14 "extension" contextual keyword - the C# 14 compiler reports this as CS9306, and SST1300 already flags the lowercase type name -dotnet_diagnostic.S8380.severity = none # Return types named "partial" should be escaped with "@" - the compiler reports this as CS8981, and SST1300 already flags the lowercase type name -dotnet_diagnostic.S8381.severity = none # "scoped" should be escaped when used as an identifier or type name in parenthesized lambda parameter lists -> replaced by compiler -dotnet_diagnostic.S927.severity = none # Parameter names should match base declaration and other partial definitions - DUPLICATE CA1725 +dotnet_diagnostic.S6967.severity = none # ModelState.IsValid in controller actions — no controllers here +dotnet_diagnostic.S8367.severity = none # Identifiers conflicting with the field keyword — the compiler reports it +dotnet_diagnostic.S8368.severity = none # Identifiers conflicting with the extension keyword — the compiler reports it +dotnet_diagnostic.S8380.severity = none # Return types named partial need @ — the compiler reports it +dotnet_diagnostic.S8381.severity = none # scoped should be escaped as an identifier — replaced by the compiler +dotnet_diagnostic.S927.severity = none # Parameter names should match the base declaration — covered by CA1725 # Major code smells dotnet_diagnostic.S103.severity = none # Lines should not be too long — covered by SST1521 @@ -2363,15 +2378,15 @@ dotnet_diagnostic.S108.severity = none # Nested blocks of code should not be lef dotnet_diagnostic.S109.severity = none # Magic numbers should not be used — covered by SST1471 dotnet_diagnostic.S110.severity = none # Inheritance tree of classes should not be too deep — covered by SST1446 dotnet_diagnostic.S1110.severity = none # Redundant pairs of parentheses should be removed — covered by SST1459 -dotnet_diagnostic.S1117.severity = none # Local variables should not shadow class fields or properties — covered by SST1484 +dotnet_diagnostic.S1117.severity = none # Locals shadowing fields or properties — covered by SST1484 dotnet_diagnostic.S1118.severity = none # Utility classes should not have public constructors - DUPLICATE CA1052 dotnet_diagnostic.S112.severity = none # General or reserved exceptions should never be thrown — covered by SST2409 dotnet_diagnostic.S1121.severity = none # Assignments should not be made from within sub-expressions — covered by SST1187 dotnet_diagnostic.S1123.severity = none # "Obsolete" attributes should include explanations — covered by SST2308 dotnet_diagnostic.S1134.severity = none # Track uses of "FIXME" tags -> off: TODO comment tracker; not enforced here dotnet_diagnostic.S1144.severity = none # Covered by SST1440 (canonical) -dotnet_diagnostic.S1151.severity = none # "switch case" clauses should not have too many lines of code — covered by SST1524 -dotnet_diagnostic.S1168.severity = none # Empty arrays and collections should be returned instead of null — covered by SST2306 +dotnet_diagnostic.S1151.severity = none # switch case clauses with too many lines — covered by SST1524 +dotnet_diagnostic.S1168.severity = none # Empty collections should be returned over null — covered by SST2306 dotnet_diagnostic.S1172.severity = none # Unused method parameters should be removed — covered by SST1461 dotnet_diagnostic.S1200.severity = none # Classes should not be coupled to too many other classes dotnet_diagnostic.S122.severity = none # Statements should be on separate lines — covered by SST1107 @@ -2382,27 +2397,27 @@ dotnet_diagnostic.S1479.severity = none # "switch" statements with many "case" c dotnet_diagnostic.S1607.severity = none # Tests should not be ignored -> off: ignored-test tracker; not enforced here dotnet_diagnostic.S1696.severity = none # NullReferenceException should not be caught — covered by SST2401 dotnet_diagnostic.S1854.severity = none # Unused assignments should be removed - DUPLICATE IDE0059 -dotnet_diagnostic.S1871.severity = none # Two branches in a conditional structure should not have exactly the same implementation — covered by SST2414 -dotnet_diagnostic.S2139.severity = none # Exceptions should be either logged or rethrown but not both -> replaced by SST2488 -dotnet_diagnostic.S2166.severity = none # Classes named like "Exception" should extend "Exception" or a subclass - DUPLICATE CA1710 -dotnet_diagnostic.S2234.severity = none # Arguments should be passed in the same order as the method parameters -> replaced by SST2400 +dotnet_diagnostic.S1871.severity = none # Two branches with the same implementation — covered by SST2414 +dotnet_diagnostic.S2139.severity = none # Exceptions logged and rethrown — replaced by SST2488 +dotnet_diagnostic.S2166.severity = none # Exception-named classes should extend Exception — covered by CA1710 +dotnet_diagnostic.S2234.severity = none # Arguments passed in parameter order — replaced by SST2400 dotnet_diagnostic.S2326.severity = none # Covered by SST1452 (canonical) -dotnet_diagnostic.S2327.severity = none # "try" statements with identical "catch" and/or "finally" blocks should be merged -> replaced by SST2490 -dotnet_diagnostic.S2357.severity = none # Fields should be private — duplicate of SST1401 (canonical); fields intentionally exposed (e.g. public test fields for reflection) already carry per-site SST1401 suppressions +dotnet_diagnostic.S2327.severity = none # try statements with identical catch or finally — replaced by SST2490 +dotnet_diagnostic.S2357.severity = none # Fields should be private — covered by SST1401; exposed fields are suppressed dotnet_diagnostic.S2372.severity = none # Exceptions should not be thrown from property getters — covered by SST1485 dotnet_diagnostic.S2376.severity = none # Write-only properties should not be used — covered by SST1421 dotnet_diagnostic.S2629.severity = none # Logging templates should be constant -> replaced by CA2254 dotnet_diagnostic.S2681.severity = none # Multiline blocks should be enclosed in curly braces — covered by SST1503 -dotnet_diagnostic.S2743.severity = none # Static fields should not be used in generic types - DUPLICATE CA1000 — covered by SST1431 +dotnet_diagnostic.S2743.severity = none # Static fields in generic types — covered by SST1431 dotnet_diagnostic.S2925.severity = none # "Thread.Sleep" should not be used in tests — covered by SST2506 -dotnet_diagnostic.S2933.severity = none # Fields that are only assigned in the constructor should be "readonly" - DUPLICATE IDE0044 +dotnet_diagnostic.S2933.severity = none # Constructor-only assigned fields should be readonly — IDE0044 dotnet_diagnostic.S2971.severity = none # LINQ expressions should be simplified — covered by PSH1101/PSH1102 dotnet_diagnostic.S3010.severity = none # Static fields should not be updated in constructors — covered by SST2402 -dotnet_diagnostic.S3011.severity = none # Reflection should not be used to increase accessibility of classes, methods, or fields -> replaced by SES1406 -dotnet_diagnostic.S3059.severity = none # Types should not have members with visibility set higher than the type's visibility +dotnet_diagnostic.S3011.severity = none # Reflection used to increase accessibility — replaced by SES1406 +dotnet_diagnostic.S3059.severity = none # Members more visible than their containing type dotnet_diagnostic.S3063.severity = none # "StringBuilder" data should be used — covered by SST2408 dotnet_diagnostic.S3169.severity = none # Multiple "OrderBy" calls should not be used — covered by PSH1108 -dotnet_diagnostic.S3246.severity = none # Generic type parameters should be co/contravariant when possible -> off: low-precision variance suggestion; not enforced +dotnet_diagnostic.S3246.severity = none # Generic parameters should be co/contravariant — low precision dotnet_diagnostic.S3262.severity = none # "params" should be used on overrides — covered by SST2426 dotnet_diagnostic.S3264.severity = none # Events should be invoked — covered by SST2407 dotnet_diagnostic.S3358.severity = none # Ternary operators should not be nested — covered by SST1147 @@ -2412,7 +2427,7 @@ dotnet_diagnostic.S3431.severity = none # "[ExpectedException]" should not be us dotnet_diagnostic.S3442.severity = none # "abstract" classes should not have "public" constructors — covered by SST1428 dotnet_diagnostic.S3445.severity = none # Exceptions should not be explicitly rethrown — covered by SST1430 dotnet_diagnostic.S3457.severity = none # Composite format strings should be used correctly — covered by SST1454 -dotnet_diagnostic.S3597.severity = none # "ServiceContract" and "OperationContract" attributes should be used together -> replaced by obsolete (WCF) +dotnet_diagnostic.S3597.severity = none # ServiceContract and OperationContract together — replaced by obsolete dotnet_diagnostic.S3880.severity = none # Finalizers should not be empty — covered by PSH1002 dotnet_diagnostic.S3881.severity = none # "IDisposable" should be implemented correctly — covered by SST2300 dotnet_diagnostic.S3885.severity = none # "Assembly.Load" should be used -> replaced by SST2486 @@ -2421,17 +2436,17 @@ dotnet_diagnostic.S3902.severity = none # Covered by PSH1404 (canonical) dotnet_diagnostic.S3906.severity = none # Event Handlers should have the correct signature — covered by SST2304 dotnet_diagnostic.S3908.severity = none # Generic event handlers should be used -> replaced by SST2304 dotnet_diagnostic.S3909.severity = none # Collections should implement the generic interface -> replaced by CA1010 -dotnet_diagnostic.S3925.severity = none # "ISerializable" should be implemented correctly - BinaryFormatter / ISerializable serialization is obsoleted (SYSLIB0050/0051) in modern .NET; we do not opt into legacy serialization for any exception type -dotnet_diagnostic.S3928.severity = none # Parameter names used into ArgumentException constructors should match an existing one - DUPLICATE CA2208 +dotnet_diagnostic.S3925.severity = none # ISerializable should be implemented correctly — legacy path is obsolete +dotnet_diagnostic.S3928.severity = none # ArgumentException parameter names should exist — covered by CA2208 dotnet_diagnostic.S3956.severity = none # "Generic.List" instances should not be part of public APIs -dotnet_diagnostic.S3971.severity = none # "GC.SuppressFinalize" should not be called — conflicts with PSH1008, which owns the pointless-SuppressFinalize direction and exempts unsealed types +dotnet_diagnostic.S3971.severity = none # GC.SuppressFinalize should not be called — conflicts with PSH1008 dotnet_diagnostic.S3990.severity = none # Assemblies should be marked as CLS compliant -> replaced by CA1014 dotnet_diagnostic.S3992.severity = none # Assemblies should explicitly specify COM visibility -> replaced by CA1017 -dotnet_diagnostic.S3993.severity = none # Custom attributes should be marked with "System.AttributeUsageAttribute" -> replaced by CA1018 +dotnet_diagnostic.S3993.severity = none # Custom attributes need AttributeUsage — replaced by CA1018 dotnet_diagnostic.S3994.severity = none # URI Parameters should not be strings dotnet_diagnostic.S3995.severity = none # URI return values should not be strings dotnet_diagnostic.S3996.severity = none # URI properties should not be strings -dotnet_diagnostic.S3997.severity = none # String URI overloads should call "System.Uri" overloads -> replaced by CA1054/CA1056/CA1057 +dotnet_diagnostic.S3997.severity = none # String URI overloads should call Uri overloads — replaced by CA1054 dotnet_diagnostic.S4002.severity = none # Disposable types should declare finalizers — covered by SST2317 dotnet_diagnostic.S4004.severity = none # Collection properties should be readonly — covered by SST2305 dotnet_diagnostic.S4005.severity = none # "System.Uri" arguments should be used instead of strings @@ -2448,34 +2463,34 @@ dotnet_diagnostic.S4200.severity = none # Native methods should be wrapped -> re dotnet_diagnostic.S4214.severity = none # "P/Invoke" methods should not be visible - DUPLICATE CA1401 dotnet_diagnostic.S4220.severity = none # Events should have proper arguments — covered by SST2436 dotnet_diagnostic.S4456.severity = none # Parameter validation in yielding methods should be wrapped — covered by SST2404 -dotnet_diagnostic.S4457.severity = none # Parameter validation in "async"/"await" methods should be wrapped — covered by SST2325 -dotnet_diagnostic.S4545.severity = none # "DebuggerDisplayAttribute" strings should reference existing members — covered by SST2405 +dotnet_diagnostic.S4457.severity = none # Parameter validation in async methods — covered by SST2325 +dotnet_diagnostic.S4545.severity = none # DebuggerDisplay should name real members — covered by SST2405 dotnet_diagnostic.S4581.severity = none # "new Guid()" should not be used — covered by SST2012 dotnet_diagnostic.S6354.severity = none # Use a testable date/time provider — covered by SST2010 -dotnet_diagnostic.S6419.severity = none # Azure Functions should be stateless -> off: Azure Functions-specific; not used in this library -dotnet_diagnostic.S6420.severity = none # Client instances should not be recreated on each Azure Function invocation — covered by PSH1418 -dotnet_diagnostic.S6421.severity = none # Azure Functions should use Structured Error Handling -> off: Azure Functions-specific; not used in this library -dotnet_diagnostic.S6423.severity = none # Azure Functions should log all failures -> off: Azure Functions-specific; not used in this library -dotnet_diagnostic.S6561.severity = none # Avoid using "DateTime.Now" for benchmarking or timing operations — covered by PSH1408 +dotnet_diagnostic.S6419.severity = none # Azure Functions should be stateless — not used in this library +dotnet_diagnostic.S6420.severity = none # Clients recreated per Azure Function call — covered by PSH1418 +dotnet_diagnostic.S6421.severity = none # Azure Functions structured error handling — not used in this library +dotnet_diagnostic.S6423.severity = none # Azure Functions should log all failures — not used in this library +dotnet_diagnostic.S6561.severity = none # DateTime.Now used for timing — covered by PSH1408 dotnet_diagnostic.S6562.severity = none # Covered by SST1451 (canonical) dotnet_diagnostic.S6563.severity = none # Use UTC when recording DateTime instants — covered by SST2011 dotnet_diagnostic.S6566.severity = none # Use "DateTimeOffset" instead of "DateTime" — covered by SST2016 -dotnet_diagnostic.S6575.severity = none # Use "TimeZoneInfo.FindSystemTimeZoneById" without converting the timezones with "TimezoneConverter" -> replaced by PSH1419 +dotnet_diagnostic.S6575.severity = none # FindSystemTimeZoneById conversions — replaced by PSH1419 dotnet_diagnostic.S6580.severity = none # Use a format provider when parsing date and time - DUPLICATE CA1305 -dotnet_diagnostic.S6673.severity = none # Log message template placeholders should be in the right order — covered by SST2440 -dotnet_diagnostic.S6802.severity = none # Using lambda expressions in loops should be avoided in Blazor markup section -> replaced by PSH1600 -dotnet_diagnostic.S6803.severity = none # Parameters with SupplyParameterFromQuery attribute should be used only in routable components -> off: Blazor-specific; no Blazor surface in this library -dotnet_diagnostic.S6931.severity = none # ASP.NET controller actions should not have a route template starting with "/" -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6932.severity = none # Use model binding instead of reading raw request data -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6934.severity = none # A Route attribute should be added to the controller when a route template is specified at the action level -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6960.severity = none # Controllers should not have mixed responsibilities -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6961.severity = none # API Controllers should derive from ControllerBase instead of Controller -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6673.severity = none # Log template placeholders in the right order — covered by SST2440 +dotnet_diagnostic.S6802.severity = none # Lambdas in Blazor markup loops — replaced by PSH1600 +dotnet_diagnostic.S6803.severity = none # SupplyParameterFromQuery outside routable components — no Blazor here +dotnet_diagnostic.S6931.severity = none # Controller routes starting with / — no controllers in this library +dotnet_diagnostic.S6932.severity = none # Model binding over raw request data — no controllers in this library +dotnet_diagnostic.S6934.severity = none # Route attribute on the controller — no controllers in this library +dotnet_diagnostic.S6960.severity = none # Controllers with mixed responsibilities — no controllers here +dotnet_diagnostic.S6961.severity = none # API controllers should derive from ControllerBase — none here dotnet_diagnostic.S6962.severity = none # You should pool HTTP connections with HttpClientFactory — covered by PSH1418 -dotnet_diagnostic.S6964.severity = none # Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting. -> replaced by SST2705 (opt-in) -dotnet_diagnostic.S6965.severity = none # REST API actions should be annotated with an HTTP verb attribute -> replaced by SST2704 +dotnet_diagnostic.S6964.severity = none # Value-type inputs should be nullable or required — replaced by SST2705 +dotnet_diagnostic.S6965.severity = none # REST actions need an HTTP verb attribute — replaced by SST2704 dotnet_diagnostic.S6966.severity = none # Awaitable method should be used — covered by PSH1313 -dotnet_diagnostic.S6968.severity = none # Actions that return a value should be annotated with ProducesResponseTypeAttribute containing the return type -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S881.severity = none # Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression — covered by SST2015 +dotnet_diagnostic.S6968.severity = none # Actions should declare ProducesResponseType — no controllers here +dotnet_diagnostic.S881.severity = none # ++ or -- mixed into a larger expression — covered by SST2015 dotnet_diagnostic.S907.severity = none # "goto" statement should not be used — covered by SST2014 # Minor code smells @@ -2483,26 +2498,26 @@ dotnet_diagnostic.S100.severity = none # Methods and properties should be named dotnet_diagnostic.S101.severity = none # Types should be named in PascalCase — covered by SST1300 dotnet_diagnostic.S105.severity = none # Tabulation characters should not be used — covered by SST1027 dotnet_diagnostic.S1104.severity = none # Fields should not have public accessibility - DUPLICATE CA1051 -dotnet_diagnostic.S1109.severity = none # A close curly brace should be located at the beginning of a line — covered by SST1500 +dotnet_diagnostic.S1109.severity = none # A close brace should start its line — covered by SST1500 dotnet_diagnostic.S1116.severity = none # Empty statements should be removed - DUPLICATE SA1106 dotnet_diagnostic.S1125.severity = none # Boolean literals should not be redundant — covered by SST1182 dotnet_diagnostic.S1128.severity = none # Covered by SST1445 (canonical) dotnet_diagnostic.S113.severity = none # Files should end with a newline dotnet_diagnostic.S1155.severity = none # "Any()" should be used to test for emptiness — covered by PSH1119 -dotnet_diagnostic.S1185.severity = none # Overriding members should do more than simply call the same member in the base class - DUPLICATE RCS1132 +dotnet_diagnostic.S1185.severity = none # Overrides that only call the base — covered by RCS1132 dotnet_diagnostic.S1192.severity = none # String literals should not be duplicated — covered by SST1486 dotnet_diagnostic.S1199.severity = none # Nested code blocks should not be used — covered by SST1138 -dotnet_diagnostic.S1210.severity = none # "Equals" and the comparison operators should be overridden when implementing "IComparable" - DUPLICATE CA1036 +dotnet_diagnostic.S1210.severity = none # IComparable types should override Equals and operators — CA1036 dotnet_diagnostic.S1227.severity = none # break statements should not be used except for switch cases dotnet_diagnostic.S1264.severity = none # A "while" loop should be used instead of a "for" loop — covered by SST2245 dotnet_diagnostic.S1301.severity = none # "switch" statements should have at least 3 "case" clauses dotnet_diagnostic.S1312.severity = none # Logger fields should be "private static readonly" dotnet_diagnostic.S1449.severity = none # Culture should be specified for "string" operations — covered by PSH1207 -dotnet_diagnostic.S1450.severity = none # Private fields only used as local variables in methods should become local variables — covered by SST1422 +dotnet_diagnostic.S1450.severity = none # Private fields used only as locals — covered by SST1422 dotnet_diagnostic.S1481.severity = none # Unused local variables should be removed — covered by SST1497 dotnet_diagnostic.S1643.severity = none # Covered by PSH1206 (canonical) dotnet_diagnostic.S1659.severity = none # Multiple variables should not be declared on the same line — covered by SST1132 -dotnet_diagnostic.S1694.severity = none # An abstract class should have both abstract and concrete methods — covered by SST2323 +dotnet_diagnostic.S1694.severity = none # Abstract classes need abstract and concrete methods — SST2323 dotnet_diagnostic.S1698.severity = none # "==" should not be used when "Equals" is overridden — covered by SST1495 dotnet_diagnostic.S1858.severity = none # "ToString()" calls should not be redundant — covered by PSH1211 dotnet_diagnostic.S1905.severity = none # Redundant casts should not be used - DUPLICATE IDE0004 — covered by SST1175 @@ -2514,95 +2529,95 @@ dotnet_diagnostic.S2156.severity = none # "sealed" classes should not have "prot dotnet_diagnostic.S2219.severity = none # Runtime type checking should be simplified — covered by SST2007 dotnet_diagnostic.S2221.severity = none # "Exception" should not be caught dotnet_diagnostic.S2292.severity = none # Trivial properties should be auto-implemented — covered by SST1420 -dotnet_diagnostic.S2325.severity = none # Methods and properties that don't access instance data should be static - DUPLICATE CA1822 +dotnet_diagnostic.S2325.severity = none # Members not touching instance data should be static — CA1822 dotnet_diagnostic.S2333.severity = none # Redundant modifiers should not be used — covered by SST1419/SST1491 dotnet_diagnostic.S2342.severity = none # Enumeration types should comply with a naming convention — covered by SST1319 -dotnet_diagnostic.S2344.severity = none # Enumeration type names should not have "Flags" or "Enum" suffixes - DUPLICATE CA1711 +dotnet_diagnostic.S2344.severity = none # Enum names should not end in Flags or Enum — covered by CA1711 dotnet_diagnostic.S2386.severity = none # Mutable fields should not be "public static" — covered by SST1499 dotnet_diagnostic.S2486.severity = none # Generic exceptions should not be ignored — covered by SST1429 dotnet_diagnostic.S2737.severity = none # "catch" clauses should do more than rethrow — covered by SST1470 dotnet_diagnostic.S2760.severity = none # Sequential tests should not check the same condition — covered by SST1475 dotnet_diagnostic.S3052.severity = none # Covered by PSH1403 (canonical) -dotnet_diagnostic.S3220.severity = none # Method calls should not resolve ambiguously to overloads with "params" — covered by SST2467 +dotnet_diagnostic.S3220.severity = none # Ambiguous resolution to params overloads — covered by SST2467 dotnet_diagnostic.S3234.severity = none # Covered by PSH1008 (canonical) dotnet_diagnostic.S3235.severity = none # Redundant parentheses should not be used — covered by SST1459 dotnet_diagnostic.S3236.severity = none # Covered by SST1448 (canonical) dotnet_diagnostic.S3240.severity = none # The simplest possible condition syntax should be used - duplicate of SST1198 -dotnet_diagnostic.S3241.severity = none # Methods should not return values that are never used -> off: needs whole-program analysis; not enforced here +dotnet_diagnostic.S3241.severity = none # Return values never used — needs whole-program analysis dotnet_diagnostic.S3242.severity = none # Method parameters should be declared with base types dotnet_diagnostic.S3247.severity = none # Duplicate casts should not be made — covered by SST1175 dotnet_diagnostic.S3251.severity = none # Implementations should be provided for "partial" methods — covered by SST2468 -dotnet_diagnostic.S3253.severity = none # Constructor and destructor declarations should not be redundant — covered by SST1433 +dotnet_diagnostic.S3253.severity = none # Redundant constructor and destructor declarations — SST1433 dotnet_diagnostic.S3254.severity = none # Default parameter values should not be passed as arguments — covered by SST1494 dotnet_diagnostic.S3256.severity = none # "string.IsNullOrEmpty" should be used — covered by PSH1204 (style configurable) -dotnet_diagnostic.S3257.severity = none # Declarations and initializations should be as concise as possible -> replaced by SST2202 -dotnet_diagnostic.S3260.severity = none # Non-derived "private" classes and records should be "sealed" — covered by PSH1411 +dotnet_diagnostic.S3257.severity = none # Declarations should be as concise as possible — replaced by SST2202 +dotnet_diagnostic.S3260.severity = none # Non-derived private classes should be sealed — covered by PSH1411 dotnet_diagnostic.S3261.severity = none # Namespaces should not be empty — covered by SST1435 dotnet_diagnostic.S3267.severity = none # Loops should be simplified with "LINQ" expressions -dotnet_diagnostic.S3376.severity = none # Attribute, EventArgs, and Exception type names should end with the type being extended - DUPLICATE CA1710 -dotnet_diagnostic.S3398.severity = none # "private" methods called only by inner classes should be moved to those classes — covered by SST1498 +dotnet_diagnostic.S3376.severity = none # Attribute and Exception type name suffixes — covered by CA1710 +dotnet_diagnostic.S3398.severity = none # Private methods used only by inner classes — covered by SST1498 dotnet_diagnostic.S3400.severity = none # Methods should not return constants — covered by SST1493 dotnet_diagnostic.S3416.severity = none # Loggers should be named for their enclosing types — covered by SST2443 -dotnet_diagnostic.S3440.severity = none # Variables should not be checked against the values they're about to be assigned — covered by SST1492 -dotnet_diagnostic.S3441.severity = none # Redundant property names should be omitted in anonymous classes — covered by SST1173 -dotnet_diagnostic.S3444.severity = none # Interfaces should not simply inherit from base interfaces with colliding members — covered by SST2320 -dotnet_diagnostic.S3450.severity = none # Parameters with "[DefaultParameterValue]" attributes should also be marked "[Optional]" -> replaced by obsolete (legacy DefaultParameterValue) -dotnet_diagnostic.S3458.severity = none # Empty "case" clauses that fall through to the "default" should be omitted — covered by SST1466 -dotnet_diagnostic.S3459.severity = none # Unassigned members should be removed - the compiler reports this as CS0649; the rule only ever fires on private never-assigned fields +dotnet_diagnostic.S3440.severity = none # Variables checked against the value being assigned — SST1492 +dotnet_diagnostic.S3441.severity = none # Redundant property names in anonymous types — covered by SST1173 +dotnet_diagnostic.S3444.severity = none # Interfaces inheriting colliding members — covered by SST2320 +dotnet_diagnostic.S3450.severity = none # [DefaultParameterValue] needs [Optional] — replaced by obsolete +dotnet_diagnostic.S3458.severity = none # Empty case clauses falling through to default — covered by SST1466 +dotnet_diagnostic.S3459.severity = none # Unassigned members should be removed — the compiler reports CS0649 dotnet_diagnostic.S3532.severity = none # Empty "default" clauses should be removed — covered by SST1179 dotnet_diagnostic.S3604.severity = none # Member initializer values should not be redundant — covered by PSH1403 dotnet_diagnostic.S3626.severity = none # Jump statements should not be redundant — covered by SST1174 dotnet_diagnostic.S3717.severity = none # Track use of "NotImplementedException" -> replaced by SST2485 -dotnet_diagnostic.S3872.severity = none # Parameter names should not duplicate the names of their methods -> replaced by SST1320 +dotnet_diagnostic.S3872.severity = none # Parameter names duplicating the method name — replaced by SST1320 dotnet_diagnostic.S3876.severity = none # Strings or integral types should be used for indexers -> replaced by CA1043 dotnet_diagnostic.S3878.severity = none # Arrays should not be created for params parameters — covered by PSH1018 -dotnet_diagnostic.S3897.severity = none # Classes that provide "Equals()" should implement "IEquatable" -> replaced by CA1067 +dotnet_diagnostic.S3897.severity = none # Types with Equals(T) should implement IEquatable — CA1067 dotnet_diagnostic.S3962.severity = none # Covered by PSH1402 (canonical) dotnet_diagnostic.S3963.severity = none # "static" fields should be initialized inline - DUPLICATE CA1810 dotnet_diagnostic.S3967.severity = none # Multidimensional arrays should not be used - DUPLICATE CA1814 -dotnet_diagnostic.S4018.severity = none # All type parameters should be used in the parameter list to enable type inference — covered by SST2307 +dotnet_diagnostic.S4018.severity = none # All type parameters should appear in the parameter list — SST2307 dotnet_diagnostic.S4022.severity = none # Enumerations should have "Int32" storage — covered by SST2313 dotnet_diagnostic.S4023.severity = none # Interfaces should not be empty — covered by SST1437 -dotnet_diagnostic.S4026.severity = none # Assemblies should be marked with "NeutralResourcesLanguageAttribute" -> replaced by CA1824 +dotnet_diagnostic.S4026.severity = none # Assemblies need NeutralResourcesLanguage — replaced by CA1824 dotnet_diagnostic.S4027.severity = none # Exceptions should provide standard constructors — covered by SST1488 dotnet_diagnostic.S4040.severity = none # Strings should be normalized to uppercase - DUPLICATE CA1308 dotnet_diagnostic.S4041.severity = none # Type names should not match namespaces - DUPLICATE CA1724 -dotnet_diagnostic.S4047.severity = none # Generics should be used when appropriate -> off: fuzzy prefer-generics suggestion; not enforced +dotnet_diagnostic.S4047.severity = none # Generics should be used when appropriate — fuzzy, not enforced dotnet_diagnostic.S4049.severity = none # Properties should be preferred - DUPLICATE CA1024 dotnet_diagnostic.S4052.severity = none # Types should not extend outdated base types -> replaced by obsolete -dotnet_diagnostic.S4056.severity = none # Overloads with a "CultureInfo" or an "IFormatProvider" parameter should be used - DUPLICATE CA1305 +dotnet_diagnostic.S4056.severity = none # CultureInfo or IFormatProvider overloads — covered by CA1305 dotnet_diagnostic.S4058.severity = none # Covered by PSH1207 (canonical) dotnet_diagnostic.S4060.severity = none # Non-abstract attributes should be sealed - DUPLICATE CA1813 -dotnet_diagnostic.S4061.severity = none # "params" should be used instead of "varargs" -> replaced by obsolete (__arglist varargs) +dotnet_diagnostic.S4061.severity = none # params should be used instead of varargs — replaced by obsolete dotnet_diagnostic.S4069.severity = none # Operator overloads should have named alternatives - DUPLICATE CA2225 dotnet_diagnostic.S4136.severity = none # Method overloads should be grouped together — covered by SST1218 -dotnet_diagnostic.S4201.severity = none # Null checks should not be combined with "is" operator checks — covered by SST2018 +dotnet_diagnostic.S4201.severity = none # Null checks combined with is checks — covered by SST2018 dotnet_diagnostic.S4225.severity = none # Extension methods should not extend "object" — covered by SST1706 dotnet_diagnostic.S4226.severity = none # Extensions should be in separate namespaces -dotnet_diagnostic.S4261.severity = none # Methods should be named according to their synchronicities - Async suffix not used +dotnet_diagnostic.S4261.severity = none # Methods named for their synchronicity — no Async suffix here dotnet_diagnostic.S4663.severity = none # Covered by SST1120 (canonical) -dotnet_diagnostic.S6513.severity = none # "ExcludeFromCodeCoverage" attributes should include a justification - not available on net462 and older TFMs -dotnet_diagnostic.S6585.severity = none # Don't hardcode the format when turning dates and times to strings — covered by SST2445 -dotnet_diagnostic.S6588.severity = none # Use the "UnixEpoch" field instead of creating "DateTime" instances that point to the beginning of the Unix epoch — covered by PSH1413 +dotnet_diagnostic.S6513.severity = none # ExcludeFromCodeCoverage justification — not available on net462 +dotnet_diagnostic.S6585.severity = none # Hardcoded date and time formats — covered by SST2445 +dotnet_diagnostic.S6588.severity = none # DateTime.UnixEpoch should be used — covered by PSH1413 dotnet_diagnostic.S6594.severity = none # Covered by PSH1406 (canonical) dotnet_diagnostic.S6602.severity = none # Covered by PSH1110 (canonical) dotnet_diagnostic.S6603.severity = none # Covered by PSH1110 (canonical) dotnet_diagnostic.S6605.severity = none # Covered by PSH1110 (canonical) dotnet_diagnostic.S6607.severity = none # The collection should be filtered before sorting — covered by PSH1107 dotnet_diagnostic.S6608.severity = none # Covered by PSH1106 (canonical) -dotnet_diagnostic.S6609.severity = none # "Min/Max" properties of "Set" types should be used instead of the "Enumerable" extension methods — covered by PSH1122 +dotnet_diagnostic.S6609.severity = none # Set Min/Max properties over the extensions — covered by PSH1122 dotnet_diagnostic.S6610.severity = none # Covered by PSH1201 (canonical) -dotnet_diagnostic.S6612.severity = none # The lambda parameter should be used instead of capturing arguments in "ConcurrentDictionary" methods — covered by PSH1006 -dotnet_diagnostic.S6613.severity = none # "First" and "Last" properties of "LinkedList" should be used instead of the "First()" and "Last()" extension methods — covered by PSH1124 +dotnet_diagnostic.S6612.severity = none # ConcurrentDictionary lambda parameter over captures — PSH1006 +dotnet_diagnostic.S6613.severity = none # LinkedList First/Last properties over the extensions — PSH1124 dotnet_diagnostic.S6617.severity = none # Covered by PSH1111 (canonical) -dotnet_diagnostic.S6618.severity = none # "string.Create" should be used instead of "FormattableString" — covered by PSH1209 -dotnet_diagnostic.S6664.severity = none # The code block contains too many logging calls -> off: fuzzy too-many-logging-calls metric; not enforced -dotnet_diagnostic.S6667.severity = none # Logging in a catch clause should pass the caught exception as a parameter. — covered by SST2438 +dotnet_diagnostic.S6618.severity = none # string.Create over FormattableString — covered by PSH1209 +dotnet_diagnostic.S6664.severity = none # Too many logging calls in a block — fuzzy metric, not enforced +dotnet_diagnostic.S6667.severity = none # Catch-clause logging should pass the exception — covered by SST2438 dotnet_diagnostic.S6668.severity = none # Logging arguments should be passed to the correct parameter — covered by SST2439 -dotnet_diagnostic.S6669.severity = none # Logger field or property name should comply with a naming convention -> replaced by SST2601 +dotnet_diagnostic.S6669.severity = none # Logger field naming convention — replaced by SST2601 dotnet_diagnostic.S6670.severity = none # "Trace.Write" and "Trace.WriteLine" should not be used — covered by SST2600 dotnet_diagnostic.S6672.severity = none # Generic logger injection should match enclosing type — covered by SST2443 -dotnet_diagnostic.S6675.severity = none # "Trace.WriteLineIf" should not be used with "TraceSwitch" levels -> off: niche TraceSwitch misuse; not enforced here +dotnet_diagnostic.S6675.severity = none # Trace.WriteLineIf with TraceSwitch levels — niche, not enforced dotnet_diagnostic.S6678.severity = none # Use PascalCase for named placeholders -> replaced by CA1727 dotnet_diagnostic.S818.severity = none # Literal suffixes should be upper case — covered by SST2244 @@ -2623,38 +2638,34 @@ dotnet_diagnostic.S9999-token-type.severity = error # Token type calculator dotnet_diagnostic.S9999-warning.severity = error # Analysis Warning generator # Critical security hotspots -dotnet_diagnostic.S2245.severity = none # Using pseudorandom number generators (PRNGs) is security-sensitive - DUPLICATE CA5394 -dotnet_diagnostic.S2257.severity = none # Using non-standard cryptographic algorithms is security-sensitive -> replaced by SES1007 -dotnet_diagnostic.S4502.severity = none # Disabling CSRF protections is security-sensitive -> replaced by in-box ASP.NET antiforgery analyzer +dotnet_diagnostic.S2245.severity = none # Pseudorandom number generators are sensitive — covered by CA5394 +dotnet_diagnostic.S2257.severity = none # Non-standard cryptographic algorithms — replaced by SES1007 +dotnet_diagnostic.S4502.severity = none # Disabling CSRF protections — replaced by the in-box antiforgery analyzer dotnet_diagnostic.S4790.severity = none # Using weak hashing algorithms is security-sensitive -> replaced by CA5350/CA5351 -dotnet_diagnostic.S4792.severity = none # Configuring loggers is security-sensitive -> off: logging-configuration audit hotspot; not enforced here -dotnet_diagnostic.S5042.severity = none # Expanding archive files without controlling resource consumption is security-sensitive -> off: unbounded decompression; needs taint analysis, out of scope +dotnet_diagnostic.S4792.severity = none # Configuring loggers is security-sensitive — not enforced here +dotnet_diagnostic.S5042.severity = none # Unbounded archive expansion — needs taint analysis, out of scope dotnet_diagnostic.S5332.severity = none # Using clear-text protocols is security-sensitive -> replaced by SES1106 dotnet_diagnostic.S5443.severity = none # Using publicly writable directories is security-sensitive -> replaced by SES1308 # Major security hotspots -dotnet_diagnostic.S1313.severity = none # Using hardcoded IP addresses is security-sensitive -> off: hardcoded-IP heuristic; too noisy to enforce +dotnet_diagnostic.S1313.severity = none # Hardcoded IP addresses — too noisy to enforce dotnet_diagnostic.S2077.severity = none # Formatting SQL queries is security-sensitive -> replaced by CA2100 -dotnet_diagnostic.S5693.severity = none # Allowing requests with excessive content length is security-sensitive -> replaced by SES1505 -dotnet_diagnostic.S5753.severity = none # Disabling ASP.NET "Request Validation" feature is security-sensitive -> replaced by obsolete (legacy ASP.NET request validation) -dotnet_diagnostic.S5766.severity = none # Creating Serializable objects without data validation checks is security-sensitive -> off: legacy BinaryFormatter deserialization; obsolete path, not used here -dotnet_diagnostic.S6444.severity = none # Not specifying a timeout for regular expressions is security-sensitive -> replaced by SES1509 -dotnet_diagnostic.S6640.severity = none # Using unsafe code blocks is security-sensitive -> off: unsafe-code audit; not enforced here +dotnet_diagnostic.S5693.severity = none # Excessive request content length — replaced by SES1505 +dotnet_diagnostic.S5753.severity = none # Disabling ASP.NET request validation — replaced by obsolete +dotnet_diagnostic.S5766.severity = none # Serializable objects without validation — obsolete path, unused +dotnet_diagnostic.S6444.severity = none # Regular expressions without a timeout — replaced by SES1509 +dotnet_diagnostic.S6640.severity = none # Unsafe code blocks — not enforced here # Minor security hotspots -dotnet_diagnostic.S2092.severity = none # Creating cookies without the "secure" flag is security-sensitive -> replaced by CA5382 -dotnet_diagnostic.S3330.severity = none # Creating cookies without the "HttpOnly" flag is security-sensitive -> replaced by CA5383 -dotnet_diagnostic.S4507.severity = none # Delivering code in production with debug features activated is security-sensitive -> off: debug features in production; partly covered by SES1506, rest not enforced -dotnet_diagnostic.S5122.severity = none # Having a permissive Cross-Origin Resource Sharing policy is security-sensitive -> replaced by SES1501 +dotnet_diagnostic.S2092.severity = none # Cookies without the secure flag — replaced by CA5382 +dotnet_diagnostic.S3330.severity = none # Cookies without the HttpOnly flag — replaced by CA5383 +dotnet_diagnostic.S4507.severity = none # Debug features in production — partly covered by SES1506 +dotnet_diagnostic.S5122.severity = none # Permissive CORS policy — replaced by SES1501 ############################################# # JetBrains ReSharper / Rider Inspections ############################################# -# Mirrors the CA / SA / RCS choices above for Rider and ReSharper users. Only -# inspections with a clear mapping to our Roslyn analyzer rules are listed; -# every other ReSharper inspection keeps its default severity. The goal is to -# avoid Rider double-reporting things the Roslyn analyzers already catch and -# to keep IDE severities in sync with CI-enforced severities. +# Mirrors the choices above so the IDE does not double-report; unlisted keep their defaults. ################### # ReSharper - Layout / Formatting (covered by StyleCop SA) @@ -2713,7 +2724,7 @@ resharper_redundant_to_string_call_highlighting = none # handled by RCS1097 ################### # ReSharper - Naming (matches SA/CA naming rules) ################### -resharper_inconsistent_naming_highlighting = none # too many false positives on test/fixture naming; SA1300 family covers the real cases +resharper_inconsistent_naming_highlighting = none # too many false positives; the naming rules above cover the real cases ################### # ReSharper - Unused code (matches CA1801 / CA1823 / IDE0051-0052) @@ -2829,10 +2840,3 @@ end_of_line = lf [*.{cmd, bat}] end_of_line = lf - -############################################# -# Test projects (TUnit) -############################################# -# TUnit instantiates test classes per test, so they must remain instance classes and -# cannot be marked static — even when a partial declaration happens to hold only static -# members (the instance [Test] methods live in sibling partial files). diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 321613c2..b829cf21 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -7,13 +7,13 @@ 10.0.90 - 11.0.0-preview.6.26360.8 + 11.0.0-preview.7.26406.9 - 3.39.2 + 3.45.0 diff --git a/src/ReactiveUI.Binding.Analyzer/Analyzers/AnalyzerHelpers.cs b/src/ReactiveUI.Binding.Analyzer/Analyzers/AnalyzerHelpers.cs index 8a8b22c1..13f0d23c 100644 --- a/src/ReactiveUI.Binding.Analyzer/Analyzers/AnalyzerHelpers.cs +++ b/src/ReactiveUI.Binding.Analyzer/Analyzers/AnalyzerHelpers.cs @@ -15,18 +15,9 @@ internal static class AnalyzerHelpers /// The method symbol to check. /// true if the method is from our generated extension class. [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static bool IsBindingExtensionMethod(IMethodSymbol methodSymbol) - { - var containingType = methodSymbol.ContainingType; - if (containingType is null) - { - return false; - } - - var name = containingType.Name; - return name is SourceGenerators.Constants.GeneratedExtensionClassName + internal static bool IsBindingExtensionMethod(IMethodSymbol methodSymbol) => + methodSymbol.ContainingType?.Name is SourceGenerators.Constants.GeneratedExtensionClassName or SourceGenerators.Constants.StubExtensionClassName; - } /// Checks if an expression is an inline lambda (not a variable reference or method call). /// The expression to check. @@ -125,7 +116,7 @@ internal static bool LacksObservableMechanism( out INamedTypeSymbol? sourceType) { sourceType = ExtractFirstTypeArgument(methodSymbol); - return sourceType is null ? false : !TypeAnalyzer.HasObservableMechanism(sourceType, compilation); + return sourceType is not null && !TypeAnalyzer.HasObservableMechanism(sourceType, compilation); } /// @@ -145,7 +136,7 @@ internal static bool LacksBeforeChangeSupport( { mechanism = string.Empty; receiverType = ExtractFirstTypeArgument(methodSymbol); - return receiverType is null ? false : !HasBeforeChangeSupport(receiverType, compilation, out mechanism); + return receiverType is not null && !HasBeforeChangeSupport(receiverType, compilation, out mechanism); } /// @@ -171,7 +162,7 @@ internal static bool ImplementsDataErrorInfo( var dataErrorInfo = compilation.GetTypeByMetadataName(SourceGenerators.Constants.INotifyDataErrorInfoMetadataName); - return dataErrorInfo is null ? false : ImplementsInterface(sourceType, dataErrorInfo); + return dataErrorInfo is not null && ImplementsInterface(sourceType, dataErrorInfo); } /// Determines whether a type implements a specific interface. diff --git a/src/ReactiveUI.Binding.Analyzer/Analyzers/BindingInvocationAnalyzer.cs b/src/ReactiveUI.Binding.Analyzer/Analyzers/BindingInvocationAnalyzer.cs index 271d0fa3..0f9c10d2 100644 --- a/src/ReactiveUI.Binding.Analyzer/Analyzers/BindingInvocationAnalyzer.cs +++ b/src/ReactiveUI.Binding.Analyzer/Analyzers/BindingInvocationAnalyzer.cs @@ -57,7 +57,7 @@ internal static void AnalyzeInvocation(in OperationAnalysisContext context) var arguments = invocationOp.Arguments; // Check RXUIBIND001: Non-inline lambda - CheckNonInlineLambda(context, arguments, methodName); + CheckNonInlineLambda(context, arguments); // Check RXUIBIND003: Private/protected member access CheckPrivateMember(context, arguments); @@ -95,11 +95,9 @@ internal static void AnalyzeInvocation(in OperationAnalysisContext context) /// Checks for RXUIBIND001: Expression arguments that are not inline lambdas. /// The operation analysis context. /// The invocation arguments to inspect. - /// The name of the method being invoked. internal static void CheckNonInlineLambda( in OperationAnalysisContext context, - ImmutableArray arguments, - string methodName) + ImmutableArray arguments) { // Find the Expression> arguments for (var i = 0; i < arguments.Length; i++) @@ -458,22 +456,13 @@ internal static void WalkForUnsupportedSegments( } /// Extracts the body expression from a lambda expression syntax node. - /// Only and exist in Roslyn's C# syntax model. /// The lambda expression syntax node to extract the body from. /// /// The body as an , or null if the lambda body is a block statement. /// [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static ExpressionSyntax? GetLambdaBody(LambdaExpressionSyntax lambda) - { - if (lambda is SimpleLambdaExpressionSyntax simple) - { - return simple.Body as ExpressionSyntax; - } - - var parenthesized = (ParenthesizedLambdaExpressionSyntax)lambda; - return parenthesized.Body as ExpressionSyntax; - } + internal static ExpressionSyntax? GetLambdaBody(LambdaExpressionSyntax lambda) => + lambda.Body as ExpressionSyntax; /// Determines whether a non-empty constant toEvent argument was explicitly supplied. /// The invocation arguments to inspect. diff --git a/src/ReactiveUI.Binding.Maui.Shared/BooleanToVisibilityHints.cs b/src/ReactiveUI.Binding.Maui.Shared/BooleanToVisibilityHints.cs index 935b39dd..3aacd2df 100644 --- a/src/ReactiveUI.Binding.Maui.Shared/BooleanToVisibilityHints.cs +++ b/src/ReactiveUI.Binding.Maui.Shared/BooleanToVisibilityHints.cs @@ -19,5 +19,5 @@ public enum BooleanToVisibilityHints Inverse = 1 << 1, /// Use the Hidden value rather than Collapsed (MAUI only; ignored on WinUI where Hidden is not available). - UseHidden = 1 << 2 + UseHidden = 1 << 2, } diff --git a/src/ReactiveUI.Binding.Maui.Shared/Builder/MauiBindingBuilderExtensions.cs b/src/ReactiveUI.Binding.Maui.Shared/Builder/MauiBindingBuilderExtensions.cs index e81f1e12..8a254a63 100644 --- a/src/ReactiveUI.Binding.Maui.Shared/Builder/MauiBindingBuilderExtensions.cs +++ b/src/ReactiveUI.Binding.Maui.Shared/Builder/MauiBindingBuilderExtensions.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using Splat.Builder; #if REACTIVE_SHIM @@ -22,6 +23,7 @@ public static class MauiBindingBuilderExtensions /// observation (on Windows) and Visibility converters. /// /// The builder instance for chaining. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IReactiveUIBindingBuilder WithMaui() => ((IReactiveUIBindingBuilder)builder).WithMaui(); } diff --git a/src/ReactiveUI.Binding.Maui.Shared/DependencyObjectObservableForProperty.cs b/src/ReactiveUI.Binding.Maui.Shared/DependencyObjectObservableForProperty.cs index f46b38f0..9c7d5004 100644 --- a/src/ReactiveUI.Binding.Maui.Shared/DependencyObjectObservableForProperty.cs +++ b/src/ReactiveUI.Binding.Maui.Shared/DependencyObjectObservableForProperty.cs @@ -92,9 +92,9 @@ public int GetAffinityForObject(Type type, string propertyName, bool beforeChang var dependencyProperty = dependencyPropertyFetcher(); var token = depSender.RegisterPropertyChangedCallback(dependencyProperty, handler); - return new ActionDisposable<(DependencyObject sender, DependencyProperty property, long token)>( + return new ActionDisposable<(DependencyObject Sender, DependencyProperty Property, long Token)>( (depSender, dependencyProperty, token), - static state => state.sender.UnregisterPropertyChangedCallback(state.property, state.token)); + static state => state.Sender.UnregisterPropertyChangedCallback(state.Property, state.Token)); }); } diff --git a/src/ReactiveUI.Binding.Platform.Shared/ActionDisposable{TState}.cs b/src/ReactiveUI.Binding.Platform.Shared/ActionDisposable{TState}.cs index c80e3c19..659bfb7d 100644 --- a/src/ReactiveUI.Binding.Platform.Shared/ActionDisposable{TState}.cs +++ b/src/ReactiveUI.Binding.Platform.Shared/ActionDisposable{TState}.cs @@ -12,8 +12,8 @@ namespace ReactiveUI.Binding.Observables; /// Runs a teardown action against a state value exactly once. Carrying the state lets the platform /// observers unhook with a non-capturing lambda, so no closure is allocated per subscription. /// -/// Each platform assembly compiles its own internal copy; nothing here touches the seam. /// The type of the state handed to the teardown action. +/// Each platform assembly compiles its own internal copy; nothing here touches the seam. internal sealed class ActionDisposable : IDisposable { /// The state handed to on disposal. diff --git a/src/ReactiveUI.Binding.Platform.Shared/AnonymousObservable.cs b/src/ReactiveUI.Binding.Platform.Shared/AnonymousObservable.cs index 50a11db4..eb0c0ed0 100644 --- a/src/ReactiveUI.Binding.Platform.Shared/AnonymousObservable.cs +++ b/src/ReactiveUI.Binding.Platform.Shared/AnonymousObservable.cs @@ -12,11 +12,11 @@ namespace ReactiveUI.Binding.Observables; /// An observable whose subscription logic is supplied as a delegate, for the platform observers that /// hook an event on subscribe and hand back the unhook as the subscription. /// +/// The type of the elements in the sequence. /// /// Each platform assembly compiles its own internal copy, so this stays off the public surface of every /// package and out of the seam: it names no scheduler and no notification type. /// -/// The type of the elements in the sequence. internal sealed class AnonymousObservable : IObservable { /// Produces the subscription for an observer, returning the resource that tears it down. diff --git a/src/ReactiveUI.Binding.Shared/Bindings/BindingTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/BindingTypeConverter.cs index 4aa54ef4..d7865742 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/BindingTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/BindingTypeConverter.cs @@ -16,6 +16,7 @@ namespace ReactiveUI.Binding; /// object-based shim (), allowing the dispatch /// layer to avoid reflection. /// +[DebuggerDisplay("{FromType.Name,nq} -> {ToType.Name,nq} converter")] public abstract class BindingTypeConverter : IBindingTypeConverter { /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/ByteToNullableByteTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/ByteToNullableByteTypeConverter.cs index f926203c..a139cb21 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/ByteToNullableByteTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/ByteToNullableByteTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -9,6 +11,7 @@ namespace ReactiveUI.Binding; #endif /// Converts to a nullable . +[DebuggerDisplay("byte -> byte? (affinity {Affinity})")] public sealed class ByteToNullableByteTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -21,6 +24,7 @@ public sealed class ByteToNullableByteTypeConverter : IBindingTypeConverter typeof(byte?); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/DecimalToNullableDecimalTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/DecimalToNullableDecimalTypeConverter.cs index 3c82fc95..9f0ea480 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/DecimalToNullableDecimalTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/DecimalToNullableDecimalTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -9,6 +11,7 @@ namespace ReactiveUI.Binding; #endif /// Converts to a nullable . +[DebuggerDisplay("decimal -> decimal? (affinity {Affinity})")] public sealed class DecimalToNullableDecimalTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -21,6 +24,7 @@ public sealed class DecimalToNullableDecimalTypeConverter : IBindingTypeConverte public Type ToType => typeof(decimal?); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/DoubleToNullableDoubleTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/DoubleToNullableDoubleTypeConverter.cs index c5f97e05..a0e992bc 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/DoubleToNullableDoubleTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/DoubleToNullableDoubleTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -9,6 +11,7 @@ namespace ReactiveUI.Binding; #endif /// Converts to a nullable . +[DebuggerDisplay("double -> double? (affinity {Affinity})")] public sealed class DoubleToNullableDoubleTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -21,6 +24,7 @@ public sealed class DoubleToNullableDoubleTypeConverter : IBindingTypeConverter< public Type ToType => typeof(double?); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/EqualityTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/EqualityTypeConverter.cs index 7ebe7b6c..baa606ef 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/EqualityTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/EqualityTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -19,6 +21,7 @@ namespace ReactiveUI.Binding; /// Example: Convert an enum value to bool by comparing with a specific enum member. /// /// +[DebuggerDisplay("{FromType.Name,nq} -> {ToType.Name,nq} by equality with the conversion hint")] public sealed class EqualityTypeConverter : IBindingTypeConverter { /// @@ -28,6 +31,7 @@ public sealed class EqualityTypeConverter : IBindingTypeConverter public Type ToType => typeof(bool); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => 1; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/IntegerToNullableIntegerTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/IntegerToNullableIntegerTypeConverter.cs index c4cbec57..80558f8d 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/IntegerToNullableIntegerTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/IntegerToNullableIntegerTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -9,6 +11,7 @@ namespace ReactiveUI.Binding; #endif /// Converts to a nullable . +[DebuggerDisplay("int -> int? (affinity {Affinity})")] public sealed class IntegerToNullableIntegerTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -21,6 +24,7 @@ public sealed class IntegerToNullableIntegerTypeConverter : IBindingTypeConverte public Type ToType => typeof(int?); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/LongToNullableLongTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/LongToNullableLongTypeConverter.cs index 2a5925dd..623b63a5 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/LongToNullableLongTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/LongToNullableLongTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -9,6 +11,7 @@ namespace ReactiveUI.Binding; #endif /// Converts to a nullable . +[DebuggerDisplay("long -> long? (affinity {Affinity})")] public sealed class LongToNullableLongTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -21,6 +24,7 @@ public sealed class LongToNullableLongTypeConverter : IBindingTypeConverter typeof(long?); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableByteToByteTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableByteToByteTypeConverter.cs index 84439505..4f90bff8 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableByteToByteTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableByteToByteTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -12,6 +14,7 @@ namespace ReactiveUI.Binding; /// /// When the nullable value is null, the conversion fails and returns false. /// +[DebuggerDisplay("byte? -> byte (affinity {Affinity})")] public sealed class NullableByteToByteTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -24,6 +27,7 @@ public sealed class NullableByteToByteTypeConverter : IBindingTypeConverter typeof(byte); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableDecimalToDecimalTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableDecimalToDecimalTypeConverter.cs index f97fa7f4..79da74e8 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableDecimalToDecimalTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableDecimalToDecimalTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -12,6 +14,7 @@ namespace ReactiveUI.Binding; /// /// When the nullable value is null, the conversion fails and returns false. /// +[DebuggerDisplay("decimal? -> decimal (affinity {Affinity})")] public sealed class NullableDecimalToDecimalTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -24,6 +27,7 @@ public sealed class NullableDecimalToDecimalTypeConverter : IBindingTypeConverte public Type ToType => typeof(decimal); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableDoubleToDoubleTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableDoubleToDoubleTypeConverter.cs index a186f9ae..92b4e48b 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableDoubleToDoubleTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableDoubleToDoubleTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -12,6 +14,7 @@ namespace ReactiveUI.Binding; /// /// When the nullable value is null, the conversion fails and returns false. /// +[DebuggerDisplay("double? -> double (affinity {Affinity})")] public sealed class NullableDoubleToDoubleTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -24,6 +27,7 @@ public sealed class NullableDoubleToDoubleTypeConverter : IBindingTypeConverter< public Type ToType => typeof(double); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableIntegerToIntegerTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableIntegerToIntegerTypeConverter.cs index f2990cdd..e0fae7ff 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableIntegerToIntegerTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableIntegerToIntegerTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -12,6 +14,7 @@ namespace ReactiveUI.Binding; /// /// When the nullable value is null, the conversion fails and returns false. /// +[DebuggerDisplay("int? -> int (affinity {Affinity})")] public sealed class NullableIntegerToIntegerTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -24,6 +27,7 @@ public sealed class NullableIntegerToIntegerTypeConverter : IBindingTypeConverte public Type ToType => typeof(int); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableLongToLongTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableLongToLongTypeConverter.cs index efe88cc0..f7a0983a 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableLongToLongTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableLongToLongTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -12,6 +14,7 @@ namespace ReactiveUI.Binding; /// /// When the nullable value is null, the conversion fails and returns false. /// +[DebuggerDisplay("long? -> long (affinity {Affinity})")] public sealed class NullableLongToLongTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -24,6 +27,7 @@ public sealed class NullableLongToLongTypeConverter : IBindingTypeConverter typeof(long); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableShortToShortTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableShortToShortTypeConverter.cs index 738bd1f4..cc0266a3 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableShortToShortTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableShortToShortTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -12,6 +14,7 @@ namespace ReactiveUI.Binding; /// /// When the nullable value is null, the conversion fails and returns false. /// +[DebuggerDisplay("short? -> short (affinity {Affinity})")] public sealed class NullableShortToShortTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -24,6 +27,7 @@ public sealed class NullableShortToShortTypeConverter : IBindingTypeConverter typeof(short); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableSingleToSingleTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableSingleToSingleTypeConverter.cs index 1e4f0507..87acad90 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableSingleToSingleTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/NullableSingleToSingleTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -12,6 +14,7 @@ namespace ReactiveUI.Binding; /// /// When the nullable value is null, the conversion fails and returns false. /// +[DebuggerDisplay("float? -> float (affinity {Affinity})")] public sealed class NullableSingleToSingleTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -24,6 +27,7 @@ public sealed class NullableSingleToSingleTypeConverter : IBindingTypeConverter< public Type ToType => typeof(float); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/ShortToNullableShortTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/ShortToNullableShortTypeConverter.cs index 97031ad9..0e5372a1 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/ShortToNullableShortTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/ShortToNullableShortTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -9,6 +11,7 @@ namespace ReactiveUI.Binding; #endif /// Converts to a nullable . +[DebuggerDisplay("short -> short? (affinity {Affinity})")] public sealed class ShortToNullableShortTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -21,6 +24,7 @@ public sealed class ShortToNullableShortTypeConverter : IBindingTypeConverter typeof(short?); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/SingleToNullableSingleTypeConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/SingleToNullableSingleTypeConverter.cs index b3a2f354..87f68afb 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/SingleToNullableSingleTypeConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/SingleToNullableSingleTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -9,6 +11,7 @@ namespace ReactiveUI.Binding; #endif /// Converts to a nullable . +[DebuggerDisplay("float -> float? (affinity {Affinity})")] public sealed class SingleToNullableSingleTypeConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -21,6 +24,7 @@ public sealed class SingleToNullableSingleTypeConverter : IBindingTypeConverter< public Type ToType => typeof(float?); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converter/StringConverter.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converter/StringConverter.cs index 938f6e74..c435e27a 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converter/StringConverter.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converter/StringConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -13,6 +15,7 @@ namespace ReactiveUI.Binding; /// This converter provides a fast path for string-to-string bindings without /// requiring reflection or TypeDescriptor. /// +[DebuggerDisplay("string -> string identity (affinity {Affinity})")] public sealed class StringConverter : IBindingTypeConverter { /// The affinity returned by indicating a strong match. @@ -25,6 +28,7 @@ public sealed class StringConverter : IBindingTypeConverter public Type ToType => typeof(string); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => Affinity; /// diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converters/BindingFallbackConverterRegistry.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converters/BindingFallbackConverterRegistry.cs index 76780c82..d19b50b4 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converters/BindingFallbackConverterRegistry.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converters/BindingFallbackConverterRegistry.cs @@ -34,6 +34,7 @@ namespace ReactiveUI.Binding; /// They provide runtime type checking and conversion using techniques like reflection or type descriptors. /// /// +[DebuggerDisplay("{_snapshot.Converters.Count} fallback converters registered")] public sealed class BindingFallbackConverterRegistry { /// Synchronization gate for serializing write operations. @@ -103,11 +104,13 @@ public void Register(IBindingFallbackConverter converter) { var converter = converters[i]; var score = converter.GetAffinityForObjects(fromType, toType); - if (score > bestScore && score > 0) + if (score <= bestScore || score <= 0) { - bestScore = score; - best = converter; + continue; } + + bestScore = score; + best = converter; } return best; diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converters/BindingTypeConverterRegistry.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converters/BindingTypeConverterRegistry.cs index 759776fc..30d4c06d 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converters/BindingTypeConverterRegistry.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converters/BindingTypeConverterRegistry.cs @@ -32,6 +32,7 @@ namespace ReactiveUI.Binding; /// application startup, then looked up many times during binding operations. /// /// +[DebuggerDisplay("Typed converters for {_snapshot.ConvertersByTypePair.Count} type pairs")] public sealed class BindingTypeConverterRegistry { /// Synchronization gate for serializing write operations. @@ -122,11 +123,13 @@ public void Register(IBindingTypeConverter converter) { var converter = list[i]; var score = converter.GetAffinityForObjects(); - if (score > bestScore && score > 0) + if (score <= bestScore || score <= 0) { - bestScore = score; - best = converter; + continue; } + + bestScore = score; + best = converter; } return best; @@ -162,12 +165,12 @@ public IEnumerable GetAllConverters() /// The source dictionary to clone. /// A new dictionary with the same entries as . [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static Dictionary<(Type fromType, Type toType), List> CloneRegistryShallow( - Dictionary<(Type fromType, Type toType), List> source) + internal static Dictionary<(Type FromType, Type ToType), List> CloneRegistryShallow( + Dictionary<(Type FromType, Type ToType), List> source) { ArgumentExceptionHelper.ThrowIfNull(source); - var clone = new Dictionary<(Type fromType, Type toType), List>(source.Count); + var clone = new Dictionary<(Type FromType, Type ToType), List>(source.Count); foreach (var kvp in source) { clone[kvp.Key] = kvp.Value; @@ -179,5 +182,5 @@ public IEnumerable GetAllConverters() /// Immutable snapshot of the registry state for lock-free reads. /// The converters indexed by source and target type pair. private sealed record Snapshot( - Dictionary<(Type fromType, Type toType), List> ConvertersByTypePair); + Dictionary<(Type FromType, Type ToType), List> ConvertersByTypePair); } diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converters/ConverterService.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converters/ConverterService.cs index 626264d1..0e279cc6 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converters/ConverterService.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converters/ConverterService.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -44,6 +46,7 @@ namespace ReactiveUI.Binding; /// /// /// +[DebuggerDisplay("Typed: {TypedConverters}; fallback: {FallbackConverters}; set-method: {SetMethodConverters}")] public sealed class ConverterService { /// Initializes a new instance of the class. @@ -101,6 +104,7 @@ public ConverterService() /// /// The best set-method converter for the type pair, or if no converter is available. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public ISetMethodBindingConverter? ResolveSetMethodConverter( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? fromType, diff --git a/src/ReactiveUI.Binding.Shared/Bindings/Converters/SetMethodBindingConverterRegistry.cs b/src/ReactiveUI.Binding.Shared/Bindings/Converters/SetMethodBindingConverterRegistry.cs index 546e592c..55a147fe 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/Converters/SetMethodBindingConverterRegistry.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/Converters/SetMethodBindingConverterRegistry.cs @@ -34,6 +34,7 @@ namespace ReactiveUI.Binding; /// set behavior, such as populating collections or handling platform-specific controls. /// /// +[DebuggerDisplay("{_snapshot.Converters.Count} set-method converters registered")] public sealed class SetMethodBindingConverterRegistry { /// Synchronization gate for serializing write operations. @@ -90,11 +91,13 @@ public void Register(ISetMethodBindingConverter converter) { var converter = converters[i]; var score = converter.GetAffinityForObjects(fromType, toType); - if (score > bestScore && score > 0) + if (score <= bestScore || score <= 0) { - bestScore = score; - best = converter; + continue; } + + bestScore = score; + best = converter; } return best; diff --git a/src/ReactiveUI.Binding.Shared/Bindings/ReactiveBinding.cs b/src/ReactiveUI.Binding.Shared/Bindings/ReactiveBinding.cs index fbcd7311..65e36771 100644 --- a/src/ReactiveUI.Binding.Shared/Bindings/ReactiveBinding.cs +++ b/src/ReactiveUI.Binding.Shared/Bindings/ReactiveBinding.cs @@ -11,6 +11,7 @@ namespace ReactiveUI.Binding; /// Default implementation of used by generated view-first bindings. /// The type of the view. /// The type of the bound value. +[DebuggerDisplay("{Direction} binding on {View}")] public sealed class ReactiveBinding : IReactiveBinding where TView : IViewFor { diff --git a/src/ReactiveUI.Binding.Shared/Builder/ReactiveUIBindingBuilder.cs b/src/ReactiveUI.Binding.Shared/Builder/ReactiveUIBindingBuilder.cs index 2f816db5..1e5816bb 100644 --- a/src/ReactiveUI.Binding.Shared/Builder/ReactiveUIBindingBuilder.cs +++ b/src/ReactiveUI.Binding.Shared/Builder/ReactiveUIBindingBuilder.cs @@ -28,6 +28,7 @@ namespace ReactiveUI.Binding.Builder; /// /// /// +[DebuggerDisplay("CoreServicesRegistered = {_coreRegistered}")] public sealed class ReactiveUIBindingBuilder : AppBuilder, IReactiveUIBindingBuilder, IReactiveUIBindingInstance { /// Tracks whether core services have already been registered to prevent duplicate registration. @@ -182,6 +183,7 @@ public IReactiveUIBindingInstance BuildApp() /// always sets Current. /// /// The built app instance to validate. + /// has no Current resolver, so the build did not produce a usable instance. [ExcludeFromCodeCoverage] private static void ThrowIfCurrentNull(IReactiveUIBindingInstance appInstance) { diff --git a/src/ReactiveUI.Binding.Shared/Builder/RxBindingBuilderMixins.cs b/src/ReactiveUI.Binding.Shared/Builder/RxBindingBuilderMixins.cs index 7fe108da..21b7e2e4 100644 --- a/src/ReactiveUI.Binding.Shared/Builder/RxBindingBuilderMixins.cs +++ b/src/ReactiveUI.Binding.Shared/Builder/RxBindingBuilderMixins.cs @@ -21,8 +21,7 @@ public ReactiveUIBindingBuilder CreateReactiveUIBindingBuilder() { ArgumentExceptionHelper.ThrowIfNull(resolver); - var readonlyResolver = resolver as IReadonlyDependencyResolver ?? AppLocator.Current; - return new(resolver, readonlyResolver); + return new(resolver, resolver as IReadonlyDependencyResolver ?? AppLocator.Current); } } } diff --git a/src/ReactiveUI.Binding.Shared/CommandBinding/CommandBinderService.cs b/src/ReactiveUI.Binding.Shared/CommandBinding/CommandBinderService.cs index 9719302c..352c870e 100644 --- a/src/ReactiveUI.Binding.Shared/CommandBinding/CommandBinderService.cs +++ b/src/ReactiveUI.Binding.Shared/CommandBinding/CommandBinderService.cs @@ -28,8 +28,7 @@ public static ICreatesCommandBinding? GetBinder< | DynamicallyAccessedMemberTypes.PublicProperties)] T>(bool hasEventTarget) { - var resolver = Locator.Current; - var binders = resolver.GetServices(); + var binders = Locator.Current.GetServices(); ICreatesCommandBinding? bestBinder = null; var bestAffinity = 0; @@ -37,11 +36,13 @@ public static ICreatesCommandBinding? GetBinder< foreach (var binder in binders) { var affinity = binder.GetAffinityForObject(hasEventTarget); - if (affinity > bestAffinity) + if (affinity <= bestAffinity) { - bestAffinity = affinity; - bestBinder = binder; + continue; } + + bestAffinity = affinity; + bestBinder = binder; } return bestBinder; diff --git a/src/ReactiveUI.Binding.Shared/Expression/ExpressionMixins.cs b/src/ReactiveUI.Binding.Shared/Expression/ExpressionMixins.cs index 3f9318aa..e235b7c3 100644 --- a/src/ReactiveUI.Binding.Shared/Expression/ExpressionMixins.cs +++ b/src/ReactiveUI.Binding.Shared/Expression/ExpressionMixins.cs @@ -53,6 +53,8 @@ public IEnumerable GetExpressionChain() /// going through the Conversion Expressions. /// /// The member info from the expression. + /// The expression is . + /// The expression is not an index, member access, or conversion node, so it names no member. public MemberInfo? GetMemberInfo() { while (true) @@ -90,6 +92,8 @@ public IEnumerable GetExpressionChain() /// Gets the parent Expression of the current Expression object. /// The parent expression. + /// The expression is . + /// The expression is not an index or member access node, so nothing precedes it in a chain. public Expression? GetParent() { ArgumentExceptionHelper.ThrowIfNull(expression); diff --git a/src/ReactiveUI.Binding.Shared/Expression/Reflection.cs b/src/ReactiveUI.Binding.Shared/Expression/Reflection.cs index 0aeef972..c4a1c2a0 100644 --- a/src/ReactiveUI.Binding.Shared/Expression/Reflection.cs +++ b/src/ReactiveUI.Binding.Shared/Expression/Reflection.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reflection; +using System.Runtime.CompilerServices; using System.Text; #if REACTIVE_SHIM @@ -23,6 +24,7 @@ public static class Reflection /// Uses the expression re-writer to simplify the expression down to its simplest expression. /// The expression to rewrite. /// The rewritten expression. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Expression Rewrite(Expression? expression) => ExpressionRewriterInstance.Visit(expression); /// Converts an expression that points to a property chain into a dotted path string. @@ -98,6 +100,8 @@ public static string ExpressionToPropertyNames(Expression? expression) /// Converts a into a delegate which fetches the value for the member. Throws if the member is not a field or property. /// The member info to convert. /// A delegate that fetches the value. + /// is . + /// is neither a nor a , so no fetcher can be built for it. public static Func GetValueFetcherOrThrow(MemberInfo? member) { ArgumentExceptionHelper.ThrowIfNull(member); @@ -125,6 +129,8 @@ public static string ExpressionToPropertyNames(Expression? expression) /// Converts a into a delegate which sets the value for the member. Throws if the member is not a field or property. /// The member info to convert. /// A delegate that sets the value. + /// is . + /// is neither a nor a , so no setter can be built for it. public static Action GetValueSetterOrThrow(MemberInfo? member) { ArgumentExceptionHelper.ThrowIfNull(member); @@ -140,6 +146,7 @@ public static string ExpressionToPropertyNames(Expression? expression) /// The object that starts the property chain. /// A sequence of expressions that point to properties/fields. /// True if the value was successfully retrieved; otherwise false. + /// is empty, so there is no member to read a value from. [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] public static bool TryGetValueForPropertyChain( out TValue changeValue, @@ -185,6 +192,7 @@ public static bool TryGetValueForPropertyChain( /// The object that starts the property chain. /// A sequence of expressions that point to properties/fields. /// True if all values were successfully retrieved; otherwise false. + /// is empty, so there is no member to read a value from. [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] public static bool TryGetAllValuesForPropertyChain( out IObservedChange[] changeValues, @@ -239,6 +247,7 @@ public static bool TryGetAllValuesForPropertyChain( /// The value to set on the last property in the chain. /// True if the value was successfully set; otherwise false. [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool TrySetValueToPropertyChain( object? target, IEnumerable expressionChain, @@ -252,6 +261,8 @@ public static bool TrySetValueToPropertyChain( /// The value to set on the last property in the chain. /// If true, throw when reflection members are missing. /// True if the value was successfully set; otherwise false. + /// is empty, so there is no member to set a value on. + /// is at a link of the chain that still has to be read through. [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] public static bool TrySetValueToPropertyChain( object? target, diff --git a/src/ReactiveUI.Binding.Shared/Helpers/ArgumentExceptionHelper.cs b/src/ReactiveUI.Binding.Shared/Helpers/ArgumentExceptionHelper.cs index 450ef8ce..15472194 100644 --- a/src/ReactiveUI.Binding.Shared/Helpers/ArgumentExceptionHelper.cs +++ b/src/ReactiveUI.Binding.Shared/Helpers/ArgumentExceptionHelper.cs @@ -22,6 +22,7 @@ internal static class ArgumentExceptionHelper /// Throws an if is null. /// The reference type argument to validate as non-null. /// The name of the parameter with which corresponds. + /// is null. internal static void ThrowIfNull( [ValidatedNotNull][NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] @@ -39,6 +40,7 @@ internal static void ThrowIfNull( /// The reference type argument to validate as non-null. /// The exception message. /// The name of the parameter with which corresponds. + /// is null. internal static void ThrowIfNullWithMessage( [ValidatedNotNull][NotNull] object? argument, string message, @@ -104,6 +106,7 @@ internal static void ThrowIfNullOrWhiteSpace( /// Throws an if is negative. /// The argument to validate as non-negative. /// The name of the parameter with which corresponds. + /// is negative. internal static void ThrowIfNegative(int value, [CallerArgumentExpression(nameof(value))] string? paramName = null) { if (value >= 0) @@ -118,6 +121,7 @@ internal static void ThrowIfNegative(int value, [CallerArgumentExpression(nameof /// The condition to evaluate. /// The exception message. /// The name of the parameter with which corresponds. + /// is true. internal static void ThrowIf( [DoesNotReturnIf(true)] bool condition, string message, @@ -135,6 +139,7 @@ internal static void ThrowIf( /// Throws an if is zero. /// The argument to validate. /// The name of the parameter with which corresponds. + /// is zero. internal static void ThrowIfZero(int value, [CallerArgumentExpression(nameof(value))] string? paramName = null) { if (value != 0) @@ -148,6 +153,7 @@ internal static void ThrowIfZero(int value, [CallerArgumentExpression(nameof(val /// Throws an if is negative or zero. /// The argument to validate. /// The name of the parameter with which corresponds. + /// is negative or zero. internal static void ThrowIfNegativeOrZero( int value, [CallerArgumentExpression(nameof(value))] @@ -166,6 +172,7 @@ internal static void ThrowIfNegativeOrZero( /// The argument to validate. /// The value to compare with. /// The name of the parameter with which corresponds. + /// is equal to . internal static void ThrowIfEqual( T value, T other, @@ -186,6 +193,7 @@ internal static void ThrowIfEqual( /// The argument to validate. /// The value to compare with. /// The name of the parameter with which corresponds. + /// is not equal to . internal static void ThrowIfNotEqual( T value, T other, @@ -206,6 +214,7 @@ internal static void ThrowIfNotEqual( /// The argument to validate. /// The value to compare with. /// The name of the parameter with which corresponds. + /// is greater than . internal static void ThrowIfGreaterThan( T value, T other, @@ -226,6 +235,7 @@ internal static void ThrowIfGreaterThan( /// The argument to validate. /// The value to compare with. /// The name of the parameter with which corresponds. + /// is greater than or equal to . internal static void ThrowIfGreaterThanOrEqual( T value, T other, @@ -246,6 +256,7 @@ internal static void ThrowIfGreaterThanOrEqual( /// The argument to validate. /// The value to compare with. /// The name of the parameter with which corresponds. + /// is less than . internal static void ThrowIfLessThan( T value, T other, @@ -266,6 +277,7 @@ internal static void ThrowIfLessThan( /// The argument to validate. /// The value to compare with. /// The name of the parameter with which corresponds. + /// is less than or equal to . internal static void ThrowIfLessThanOrEqual( T value, T other, @@ -285,6 +297,7 @@ internal static void ThrowIfLessThanOrEqual( /// The argument to validate. /// The value to compare with. /// The name of the parameter with which corresponds. + /// is less than or equal to . internal static void ThrowIfLessThanOrEqual( int value, int other, @@ -303,6 +316,7 @@ internal static void ThrowIfLessThanOrEqual( /// The struct type. /// The argument to validate. /// The name of the parameter with which corresponds. + /// is the default value of . internal static void ThrowIfDefault( T argument, [CallerArgumentExpression(nameof(argument))] diff --git a/src/ReactiveUI.Binding.Shared/Interactions/IInteraction.cs b/src/ReactiveUI.Binding.Shared/Interactions/IInteraction.cs index 1aa7473e..20322243 100644 --- a/src/ReactiveUI.Binding.Shared/Interactions/IInteraction.cs +++ b/src/ReactiveUI.Binding.Shared/Interactions/IInteraction.cs @@ -9,6 +9,8 @@ namespace ReactiveUI.Binding; #endif /// Represents an interaction between collaborating application components. +/// The interaction's input type. +/// The interaction's output type. /// /// /// Interactions allow collaborating components in an application to ask each other questions. Typically, @@ -21,8 +23,6 @@ namespace ReactiveUI.Binding; /// they require to ask a question. The handler then provides the interaction with an output as the answer. /// /// -/// The interaction's input type. -/// The interaction's output type. public interface IInteraction { /// Registers a synchronous interaction handler. diff --git a/src/ReactiveUI.Binding.Shared/Interactions/IInteractionContext.cs b/src/ReactiveUI.Binding.Shared/Interactions/IInteractionContext.cs index be3740ce..883934dc 100644 --- a/src/ReactiveUI.Binding.Shared/Interactions/IInteractionContext.cs +++ b/src/ReactiveUI.Binding.Shared/Interactions/IInteractionContext.cs @@ -9,6 +9,8 @@ namespace ReactiveUI.Binding; #endif /// Contains contextual information for an interaction. +/// The type of the interaction's input. +/// The type of the interaction's output. /// /// /// Instances of this interface are passed into interaction handlers. The property exposes @@ -20,8 +22,6 @@ namespace ReactiveUI.Binding; /// throw. Check before invoking long-running logic if only one handler should respond. /// /// -/// The type of the interaction's input. -/// The type of the interaction's output. public interface IInteractionContext { /// Gets the input for the interaction. diff --git a/src/ReactiveUI.Binding.Shared/Interactions/Interaction.cs b/src/ReactiveUI.Binding.Shared/Interactions/Interaction.cs index 9032fe23..fc82830c 100644 --- a/src/ReactiveUI.Binding.Shared/Interactions/Interaction.cs +++ b/src/ReactiveUI.Binding.Shared/Interactions/Interaction.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -9,6 +11,8 @@ namespace ReactiveUI.Binding; #endif /// Represents an interaction between collaborating application components. +/// The interaction's input type. +/// The interaction's output type. /// /// /// Interactions allow collaborating components in an application to ask each other questions. Typically, @@ -25,8 +29,7 @@ namespace ReactiveUI.Binding; /// if no handler handles the interaction. /// /// -/// The interaction's input type. -/// The interaction's output type. +[DebuggerDisplay("Handlers = {_handlers.Count}")] public class Interaction : IInteraction { /// The list of registered interaction handlers, invoked in reverse order during . @@ -139,9 +142,11 @@ private sealed class ObservableToTaskObserver : IObserver public ObservableToTaskObserver(TaskCompletionSource tcs) => _tcs = tcs; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => _tcs.TrySetResult(true); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => _tcs.TrySetException(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Interactions/InteractionContext.cs b/src/ReactiveUI.Binding.Shared/Interactions/InteractionContext.cs index 873cc630..ff0fde4e 100644 --- a/src/ReactiveUI.Binding.Shared/Interactions/InteractionContext.cs +++ b/src/ReactiveUI.Binding.Shared/Interactions/InteractionContext.cs @@ -9,6 +9,8 @@ namespace ReactiveUI.Binding; #endif /// Contains contextual information for an interaction. +/// The type of the interaction's input. +/// The type of the interaction's output. /// /// /// Instances of this class are passed into interaction handlers. The property exposes @@ -21,8 +23,7 @@ namespace ReactiveUI.Binding; /// to guard logic that should only execute once. /// /// -/// The type of the interaction's input. -/// The type of the interaction's output. +[DebuggerDisplay("Input = {Input}, Handled = {_outputSet == 1}, Output = {_output}")] public sealed class InteractionContext : IOutputContext { /// The output value set by a handler via . diff --git a/src/ReactiveUI.Binding.Shared/Interactions/UnhandledInteractionException.cs b/src/ReactiveUI.Binding.Shared/Interactions/UnhandledInteractionException.cs index d02916a7..f4a69338 100644 --- a/src/ReactiveUI.Binding.Shared/Interactions/UnhandledInteractionException.cs +++ b/src/ReactiveUI.Binding.Shared/Interactions/UnhandledInteractionException.cs @@ -11,6 +11,7 @@ namespace ReactiveUI.Binding; /// Indicates that an interaction has gone unhandled. /// The type of the interaction's input. /// The type of the interaction's output. +[DebuggerDisplay("Input = {Input}, Interaction = {Interaction}")] public class UnhandledInteractionException : Exception { /// Initializes a new instance of the class. diff --git a/src/ReactiveUI.Binding.Shared/Interfaces/BindingDirection.cs b/src/ReactiveUI.Binding.Shared/Interfaces/BindingDirection.cs index 0a4b9bdd..13838b14 100644 --- a/src/ReactiveUI.Binding.Shared/Interfaces/BindingDirection.cs +++ b/src/ReactiveUI.Binding.Shared/Interfaces/BindingDirection.cs @@ -12,11 +12,11 @@ namespace ReactiveUI.Binding; public enum BindingDirection { /// One-way binding from source to target. - OneWay, + OneWay = 0, /// Two-way binding between source and target. - TwoWay, + TwoWay = 1, /// One-way asynchronous binding from source to target. - AsyncOneWay + AsyncOneWay = 2, } diff --git a/src/ReactiveUI.Binding.Shared/Interfaces/IPropertyBindingHook.cs b/src/ReactiveUI.Binding.Shared/Interfaces/IPropertyBindingHook.cs index 3ee5b904..003b5187 100644 --- a/src/ReactiveUI.Binding.Shared/Interfaces/IPropertyBindingHook.cs +++ b/src/ReactiveUI.Binding.Shared/Interfaces/IPropertyBindingHook.cs @@ -15,12 +15,12 @@ namespace ReactiveUI.Binding; public interface IPropertyBindingHook { /// Called when any binding is set up. - /// If false, the binding is cancelled. /// The source ViewModel. /// The target View (not the actual control). /// Get current view model properties. /// Get current view properties. /// The Binding direction. + /// If false, the binding is cancelled. bool ExecuteHook( object? source, object target, diff --git a/src/ReactiveUI.Binding.Shared/Interfaces/ObservedChange.cs b/src/ReactiveUI.Binding.Shared/Interfaces/ObservedChange.cs index 272d37a9..188bbfba 100644 --- a/src/ReactiveUI.Binding.Shared/Interfaces/ObservedChange.cs +++ b/src/ReactiveUI.Binding.Shared/Interfaces/ObservedChange.cs @@ -11,6 +11,7 @@ namespace ReactiveUI.Binding; /// Concrete implementation of . /// The type of the object that raised the change. /// The type of the property value. +[DebuggerDisplay("Expression = {Expression}, Sender = {Sender}, Value = {Value}")] public class ObservedChange : IObservedChange { /// Initializes a new instance of the class. diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ObservableChainHelpers.cs b/src/ReactiveUI.Binding.Shared/Mixins/ObservableChainHelpers.cs index 01b0d23f..aac26154 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ObservableChainHelpers.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ObservableChainHelpers.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; @@ -28,6 +29,7 @@ internal static class ObservableChainHelpers /// An expression selecting the observable-valued property. /// An observable that switches to the latest non-null inner observable. [RequiresUnreferencedCode("Runtime observation fallback uses reflection-based expression analysis.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static IObservable SwitchLatest( TSender sender, Expression?>> observable) diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveSchedulerExtensions.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveSchedulerExtensions.cs index 3d2354ca..970436e5 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveSchedulerExtensions.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveSchedulerExtensions.cs @@ -44,6 +44,8 @@ public static class ReactiveSchedulerExtensions /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IDisposable BindOneWay( TTarget target, Expression> sourceProperty, @@ -67,6 +69,8 @@ public IDisposable BindOneWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IDisposable BindOneWay( TTarget target, Expression> sourceProperty, @@ -97,6 +101,8 @@ public IDisposable BindOneWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IDisposable BindOneWay( TTarget target, Expression> sourceProperty, @@ -125,6 +131,8 @@ public IDisposable BindOneWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IDisposable BindOneWay( TTarget target, Expression> sourceProperty, @@ -152,6 +160,8 @@ public IDisposable BindOneWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage( "Design", "SST2309:Optional parameters should be overloads", @@ -181,6 +191,8 @@ public IDisposable BindOneWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IDisposable BindTwoWay( TTarget target, Expression> sourceProperty, @@ -204,6 +216,8 @@ public IDisposable BindTwoWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IDisposable BindTwoWay( TTarget target, Expression> sourceProperty, @@ -235,6 +249,8 @@ public IDisposable BindTwoWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IDisposable BindTwoWay( TTarget target, Expression> sourceProperty, @@ -265,6 +281,8 @@ public IDisposable BindTwoWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IDisposable BindTwoWay( TTarget target, Expression> sourceProperty, @@ -294,6 +312,8 @@ public IDisposable BindTwoWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage( "Design", "SST2309:Optional parameters should be overloads", @@ -334,6 +354,8 @@ public IDisposable BindTwoWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IReactiveBinding OneWayBind( TViewModel viewModel, Expression> viewModelProperty, @@ -360,6 +382,8 @@ public IReactiveBinding OneWayBind( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public IReactiveBinding OneWayBind( TViewModel viewModel, Expression> viewModelProperty, @@ -387,6 +411,8 @@ public IReactiveBinding OneWayBind( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage( "Design", "SST2309:Optional parameters should be overloads", @@ -421,7 +447,9 @@ public IReactiveBinding OneWayBind( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. - public IReactiveBinding Bind( + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. + public IReactiveBinding Bind( TViewModel viewModel, Expression> viewModelProperty, Expression> viewProperty, @@ -451,7 +479,9 @@ public IReactiveBinding OneWayBind( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. - public IReactiveBinding Bind( + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. + public IReactiveBinding Bind( TViewModel viewModel, Expression> viewModelProperty, Expression> viewProperty, @@ -480,11 +510,13 @@ public IReactiveBinding OneWayBind( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated binding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage( "Design", "SST2309:Optional parameters should be overloads", Justification = "Part of the CallerInfo dispatch contract; overloads would exceed the parameter limit.")] - public IReactiveBinding Bind( + public IReactiveBinding Bind( TViewModel viewModel, Expression> viewModelProperty, Expression> viewProperty, diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindCommand.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindCommand.cs index 7dcafd71..f4456d40 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindCommand.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindCommand.cs @@ -30,6 +30,8 @@ public static partial class ReactiveUIBindingExtensions /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindCommand dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST2309", Justification = "the CallerInfo and toEvent defaults must stay optional; overloads would shadow the generated overloads")] public static IDisposable BindCommand( @@ -60,6 +62,8 @@ public static IDisposable BindCommand( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindCommand dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST2309", Justification = "the CallerInfo defaults must stay optional; overloads would shadow the generated overloads")] [SuppressMessage("Design", "SST2309", Justification = "the CallerInfo and toEvent defaults must stay optional; overloads would shadow the generated overloads")] public static IDisposable BindCommand( @@ -97,6 +101,8 @@ public static IDisposable BindCommand( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindCommand dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST2309", Justification = "the CallerInfo and toEvent defaults must stay optional; overloads would shadow the generated overloads")] public static IDisposable BindCommand( @@ -130,6 +136,8 @@ public static IDisposable BindCommandThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindCommand dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST2309", Justification = "the CallerInfo defaults must stay optional; overloads would shadow the generated overloads")] [SuppressMessage("Design", "SST2309", Justification = "the CallerInfo and toEvent defaults must stay optional; overloads would shadow the generated overloads")] @@ -170,6 +178,8 @@ public static IDisposable BindCommandThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindCommand dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST2309", Justification = "the CallerInfo and toEvent defaults must stay optional; overloads would shadow the generated overloads")] public static IDisposable BindCommand( @@ -204,6 +214,8 @@ public static IDisposable BindCommandThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindCommand dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST2309", Justification = "the CallerInfo defaults must stay optional; overloads would shadow the generated overloads")] [SuppressMessage("Design", "SST2309", Justification = "the CallerInfo and toEvent defaults must stay optional; overloads would shadow the generated overloads")] diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindInteraction.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindInteraction.cs index eae4915d..76b06653 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindInteraction.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindInteraction.cs @@ -25,6 +25,8 @@ public static partial class ReactiveUIBindingExtensions /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindInteraction dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindInteraction( this TView view, TViewModel? viewModel, @@ -49,6 +51,8 @@ public static IDisposable BindInteraction( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindInteraction dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindInteraction( this TView view, TViewModel? viewModel, @@ -78,6 +82,8 @@ public static IDisposable BindInteraction( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindInteraction dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindInteraction( this TView view, TViewModel? viewModel, @@ -103,6 +109,8 @@ public static IDisposable BindInteractionThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindInteraction dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindInteraction( this TView view, TViewModel? viewModel, diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindTo.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindTo.cs index aa956c19..c977ddb2 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindTo.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.BindTo.cs @@ -27,6 +27,8 @@ public static partial class ReactiveUIBindingExtensions /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTo dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindTo( this IObservable source, TTarget? target, @@ -46,6 +48,8 @@ public static IDisposable BindTo( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTo dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindTo( this IObservable source, TTarget? target, @@ -74,6 +78,8 @@ public static IDisposable BindTo( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTo dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindTo( this IObservable source, TTarget? target, @@ -98,6 +104,8 @@ public static IDisposable BindTo( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTo dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindTo( this IObservable source, TTarget? target, @@ -127,6 +135,8 @@ public static IDisposable BindTo( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTo dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindTo( this IObservable source, TTarget? target, @@ -151,6 +161,8 @@ public static IDisposable BindTo( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTo dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindTo( this IObservable source, TTarget? target, @@ -181,6 +193,8 @@ public static IDisposable BindTo( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTo dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] public static IDisposable BindTo( this IObservable source, @@ -208,6 +222,8 @@ public static IDisposable BindTo( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTo dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindTo( this IObservable source, TTarget? target, diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.Binding.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.Binding.cs index 87e155c9..7b147156 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.Binding.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.Binding.cs @@ -25,6 +25,8 @@ public static partial class ReactiveUIBindingExtensions /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindOneWay dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] public static IDisposable BindOneWay( this TSource source, @@ -51,6 +53,8 @@ public static IDisposable BindOneWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindOneWay dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindOneWay( this TSource source, TTarget target, @@ -81,6 +85,8 @@ public static IDisposable BindOneWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindOneWay dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] public static IDisposable BindOneWay( this TSource source, @@ -110,6 +116,8 @@ public static IDisposable BindOneWay /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindOneWay dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindOneWay( this TSource source, TTarget target, @@ -139,6 +147,8 @@ public static IDisposable BindOneWay /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTwoWay dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] public static IDisposable BindTwoWay( this TSource source, @@ -165,6 +175,8 @@ public static IDisposable BindTwoWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTwoWay dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IDisposable BindTwoWay( this TSource source, TTarget target, @@ -196,6 +208,8 @@ public static IDisposable BindTwoWay( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTwoWay dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] public static IDisposable BindTwoWay( this TSource source, @@ -227,6 +241,8 @@ public static IDisposable BindTwoWay /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A disposable that, when disposed, disconnects the binding. + /// No generated BindTwoWay dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] public static IDisposable BindTwoWay( this TSource source, @@ -259,6 +275,8 @@ public static IDisposable BindTwoWay /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated IReactiveBinding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] public static IReactiveBinding OneWayBind( this TView view, @@ -286,6 +304,8 @@ public static IReactiveBinding OneWayBindThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated IReactiveBinding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IReactiveBinding OneWayBind( this TView view, TViewModel viewModel, @@ -316,6 +336,8 @@ public static IReactiveBinding OneWayBindThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated IReactiveBinding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] public static IReactiveBinding OneWayBind( this TView view, @@ -345,6 +367,8 @@ public static IReactiveBinding OneWayBindThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated IReactiveBinding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. public static IReactiveBinding OneWayBind( this TView view, TViewModel viewModel, @@ -375,8 +399,10 @@ public static IReactiveBinding OneWayBindThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated IReactiveBinding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IReactiveBinding Bind( + public static IReactiveBinding Bind( this TView view, TViewModel viewModel, Expression> viewModelProperty, @@ -402,7 +428,9 @@ public static IReactiveBinding OneWayBindThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. - public static IReactiveBinding Bind( + /// No generated IReactiveBinding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. + public static IReactiveBinding Bind( this TView view, TViewModel viewModel, Expression> viewModelProperty, @@ -433,8 +461,10 @@ public static IReactiveBinding OneWayBindThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated IReactiveBinding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IReactiveBinding Bind( + public static IReactiveBinding Bind( this TView view, TViewModel viewModel, Expression> viewModelProperty, @@ -464,8 +494,10 @@ public static IReactiveBinding OneWayBindThe source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// A reactive binding that can be disposed to disconnect the binding. + /// No generated IReactiveBinding dispatch matched this call + /// site; the expressions must be inline lambdas for the generator to emit a concrete overload. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IReactiveBinding Bind( + public static IReactiveBinding Bind( this TView view, TViewModel viewModel, Expression> viewModelProperty, diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenAnyValue.Selectors.WideArity.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenAnyValue.Selectors.WideArity.cs index f7fdf292..0d71a4db 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenAnyValue.Selectors.WideArity.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenAnyValue.Selectors.WideArity.cs @@ -117,7 +117,7 @@ public static IObservable WhenAnyValue( where TSender : class #endif => sender.WhenAnyValue(property1, property2, callerFilePath: callerFilePath, callerLineNumber: callerLineNumber) - .Select(t => selector(t.property1, t.property2)); + .Select(t => selector(t.Property1, t.Property2)); #if NET8_0_OR_GREATER /// @@ -187,7 +187,7 @@ public static IObservable WhenAnyValue( property2, property3, callerFilePath: callerFilePath, - callerLineNumber: callerLineNumber).Select(t => selector(t.property1, t.property2, t.property3)); + callerLineNumber: callerLineNumber).Select(t => selector(t.Property1, t.Property2, t.Property3)); #if NET8_0_OR_GREATER /// @@ -268,7 +268,7 @@ public static IObservable WhenAnyValue( property3, property4, callerFilePath: callerFilePath, - callerLineNumber: callerLineNumber).Select(t => selector(t.property1, t.property2, t.property3, t.property4)); + callerLineNumber: callerLineNumber).Select(t => selector(t.Property1, t.Property2, t.Property3, t.Property4)); #if NET8_0_OR_GREATER /// @@ -360,7 +360,7 @@ public static IObservable WhenAnyValue( property4, property5, callerFilePath: callerFilePath, - callerLineNumber: callerLineNumber).Select(t => selector(t.property1, t.property2, t.property3, t.property4, t.property5)); + callerLineNumber: callerLineNumber).Select(t => selector(t.Property1, t.Property2, t.Property3, t.Property4, t.Property5)); #if NET8_0_OR_GREATER /// @@ -462,7 +462,7 @@ public static IObservable WhenAnyValue selector(t.property1, t.property2, t.property3, t.property4, t.property5, t.property6)); + callerLineNumber: callerLineNumber).Select(t => selector(t.Property1, t.Property2, t.Property3, t.Property4, t.Property5, t.Property6)); #if NET8_0_OR_GREATER /// @@ -575,13 +575,13 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7)); #if NET8_0_OR_GREATER /// @@ -704,14 +704,14 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8)); #if NET8_0_OR_GREATER /// @@ -844,15 +844,15 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9)); #if NET8_0_OR_GREATER /// @@ -995,16 +995,16 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10)); #if NET8_0_OR_GREATER /// @@ -1157,17 +1157,17 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11)); #if NET8_0_OR_GREATER /// @@ -1330,18 +1330,18 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12)); #if NET8_0_OR_GREATER /// @@ -1514,19 +1514,19 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13)); #if NET8_0_OR_GREATER /// @@ -1725,20 +1725,20 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13, - t.property14)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13, + t.Property14)); #if NET8_0_OR_GREATER /// @@ -1948,21 +1948,21 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13, - t.property14, - t.property15)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13, + t.Property14, + t.Property15)); #if NET8_0_OR_GREATER /// @@ -2183,20 +2183,20 @@ public static IObservable WhenAnyValue selector( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13, - t.property14, - t.property15, - t.property16)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13, + t.Property14, + t.Property15, + t.Property16)); } diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenAnyValue.WideArity.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenAnyValue.WideArity.cs index cbd7f1b1..db3f9873 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenAnyValue.WideArity.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenAnyValue.WideArity.cs @@ -73,7 +73,7 @@ public static IObservable WhenAnyValue( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. - public static IObservable<(T1 property1, T2 property2)> WhenAnyValue( + public static IObservable<(T1 Property1, T2 Property2)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -97,7 +97,7 @@ public static IObservable WhenAnyValue( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. - public static IObservable<(T1 property1, T2 property2)> WhenAnyValue( + public static IObservable<(T1 Property1, T2 Property2)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -135,7 +135,7 @@ public static IObservable WhenAnyValue( /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3)> WhenAnyValue( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -164,7 +164,7 @@ public static IObservable WhenAnyValue( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. - public static IObservable<(T1 property1, T2 property2, T3 property3)> WhenAnyValue( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -209,7 +209,7 @@ public static IObservable WhenAnyValue( /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4)> WhenAnyValue< + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4)> WhenAnyValue< TSender, T1, T2, @@ -248,7 +248,7 @@ public static IObservable WhenAnyValue( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4)> WhenAnyValue( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -299,7 +299,7 @@ public static IObservable WhenAnyValue( /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5)> WhenAnyValue< + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5)> WhenAnyValue< TSender, T1, T2, @@ -345,7 +345,7 @@ public static IObservable WhenAnyValue( /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5)> WhenAnyValue( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -402,7 +402,7 @@ public static IObservable WhenAnyValue( /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6)> + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6)> WhenAnyValue( this TSender sender, Expression> property1, @@ -448,7 +448,7 @@ public static IObservable WhenAnyValue( /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6)> WhenAnyValue( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -512,7 +512,7 @@ public static IObservable WhenAnyValue( [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7)> + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7)> WhenAnyValue( this TSender sender, Expression> property1, @@ -563,7 +563,7 @@ public static /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7)> WhenAnyValue( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -633,9 +633,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8)> WhenAnyValue( + Property8)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -690,7 +690,7 @@ public static /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, T8 property8)> WhenAnyValue( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 Property8)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -766,9 +766,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9)> WhenAnyValue( + Property8, T9 Property9)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -829,15 +829,15 @@ public static /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9)> WhenAnyValue( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -919,9 +919,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10)> WhenAnyValue( + Property8, T9 Property9, T10 Property10)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -987,16 +987,16 @@ public static /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10)> WhenAnyValue( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -1084,9 +1084,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11)> WhenAnyValue< + Property8, T9 Property9, T10 Property10, T11 Property11)> WhenAnyValue< TSender, T1, T2, @@ -1169,17 +1169,17 @@ public static /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11)> WhenAnyValue( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -1273,9 +1273,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12)> WhenAnyValue< + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12)> WhenAnyValue< TSender, T1, T2, @@ -1365,18 +1365,18 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12)> WhenAnyValue( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -1476,9 +1476,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13)> WhenAnyValue< + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13)> WhenAnyValue< TSender, T1, T2, @@ -1574,19 +1574,19 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13)> WhenAnyValue( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -1693,9 +1693,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13, T14 property14)> + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13, T14 Property14)> WhenAnyValue( this TSender sender, Expression> property1, @@ -1783,20 +1783,20 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13, - T14 property14)> WhenAnyValue( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13, + T14 Property14)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -1909,10 +1909,10 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13, T14 property14, T15 - property15)> WhenAnyValue( + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13, T14 Property14, T15 + Property15)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -2004,21 +2004,21 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13, - T14 property14, - T15 property15)> WhenAnyValue( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13, + T14 Property14, + T15 Property15)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, @@ -2137,10 +2137,10 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13, T14 property14, T15 - property15, T16 property16)> WhenAnyValue< + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13, T14 Property14, T15 + Property15, T16 Property16)> WhenAnyValue< TSender, T1, T2, @@ -2254,22 +2254,22 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13, - T14 property14, - T15 property15, - T16 property16)> WhenAnyValue( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13, + T14 Property14, + T15 Property15, + T16 Property16)> WhenAnyValue( this TSender sender, Expression> property1, Expression> property2, diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanged.Selectors.WideArity.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanged.Selectors.WideArity.cs index c9f04dc5..cb12ea04 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanged.Selectors.WideArity.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanged.Selectors.WideArity.cs @@ -71,7 +71,7 @@ public static IObservable WhenChanged( property1, property2, callerFilePath: callerFilePath, - callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.property1, t.property2)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2)); #if NET8_0_OR_GREATER /// @@ -141,7 +141,7 @@ public static IObservable WhenChanged( property2, property3, callerFilePath: callerFilePath, - callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.property1, t.property2, t.property3)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2, t.Property3)); #if NET8_0_OR_GREATER /// @@ -222,7 +222,7 @@ public static IObservable WhenChanged( property3, property4, callerFilePath: callerFilePath, - callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.property1, t.property2, t.property3, t.property4)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2, t.Property3, t.Property4)); #if NET8_0_OR_GREATER /// @@ -314,7 +314,7 @@ public static IObservable WhenChanged conversionFunc(t.property1, t.property2, t.property3, t.property4, t.property5)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2, t.Property3, t.Property4, t.Property5)); #if NET8_0_OR_GREATER /// @@ -416,7 +416,7 @@ public static IObservable WhenChanged conversionFunc(t.property1, t.property2, t.property3, t.property4, t.property5, t.property6)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2, t.Property3, t.Property4, t.Property5, t.Property6)); #if NET8_0_OR_GREATER /// @@ -529,13 +529,13 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7)); #if NET8_0_OR_GREATER /// @@ -658,14 +658,14 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8)); #if NET8_0_OR_GREATER /// @@ -798,15 +798,15 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9)); #if NET8_0_OR_GREATER /// @@ -949,16 +949,16 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10)); #if NET8_0_OR_GREATER /// @@ -1111,17 +1111,17 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11)); #if NET8_0_OR_GREATER /// @@ -1284,18 +1284,18 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12)); #if NET8_0_OR_GREATER /// @@ -1483,19 +1483,19 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13)); #if NET8_0_OR_GREATER /// @@ -1694,20 +1694,20 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13, - t.property14)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13, + t.Property14)); #if NET8_0_OR_GREATER /// @@ -1917,21 +1917,21 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13, - t.property14, - t.property15)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13, + t.Property14, + t.Property15)); #if NET8_0_OR_GREATER /// @@ -2152,20 +2152,20 @@ public static IObservable WhenChanged conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13, - t.property14, - t.property15, - t.property16)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13, + t.Property14, + t.Property15, + t.Property16)); } diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanged.WideArity.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanged.WideArity.cs index e5dee155..5ce33e4a 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanged.WideArity.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanged.WideArity.cs @@ -67,7 +67,7 @@ public static IObservable WhenChanged( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. - public static IObservable<(T1 property1, T2 property2)> WhenChanged( + public static IObservable<(T1 Property1, T2 Property2)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -89,7 +89,7 @@ public static IObservable WhenChanged( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. - public static IObservable<(T1 property1, T2 property2)> WhenChanged( + public static IObservable<(T1 Property1, T2 Property2)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -122,7 +122,7 @@ public static IObservable WhenChanged( /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3)> WhenChanged( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -149,7 +149,7 @@ public static IObservable WhenChanged( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. - public static IObservable<(T1 property1, T2 property2, T3 property3)> WhenChanged( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -188,7 +188,7 @@ public static IObservable WhenChanged( /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4)> WhenChanged< + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4)> WhenChanged< TObj, T1, T2, @@ -225,7 +225,7 @@ public static IObservable WhenChanged( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4)> WhenChanged( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -274,7 +274,7 @@ public static IObservable WhenChanged( /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5)> WhenChanged< + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5)> WhenChanged< TObj, T1, T2, @@ -318,7 +318,7 @@ public static IObservable WhenChanged( /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5)> WhenChanged( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -373,7 +373,7 @@ public static IObservable WhenChanged( /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6)> + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6)> WhenChanged( this TObj objectToMonitor, Expression> property1, @@ -417,7 +417,7 @@ public static IObservable WhenChanged( /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6)> WhenChanged( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -479,7 +479,7 @@ public static IObservable WhenChanged( [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7)> + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7)> WhenChanged( this TObj objectToMonitor, Expression> property1, @@ -528,7 +528,7 @@ public static /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7)> WhenChanged( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -596,9 +596,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8)> WhenChanged( + Property8)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -651,7 +651,7 @@ public static /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, T8 property8)> WhenChanged( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 Property8)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -725,9 +725,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9)> WhenChanged( + Property8, T9 Property9)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -786,15 +786,15 @@ public static /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9)> WhenChanged( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -874,9 +874,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10)> WhenChanged( + Property8, T9 Property9, T10 Property10)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -940,16 +940,16 @@ public static /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10)> WhenChanged( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1035,9 +1035,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11)> WhenChanged< + Property8, T9 Property9, T10 Property10, T11 Property11)> WhenChanged< TObj, T1, T2, @@ -1118,17 +1118,17 @@ public static /// An observable sequence that emits a tuple of all observed property values when any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11)> WhenChanged( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1220,9 +1220,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12)> WhenChanged< + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12)> WhenChanged< TObj, T1, T2, @@ -1310,18 +1310,18 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12)> WhenChanged( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1419,9 +1419,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13)> WhenChanged< + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13)> WhenChanged< TObj, T1, T2, @@ -1515,19 +1515,19 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13)> WhenChanged( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1632,9 +1632,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13, T14 property14)> + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13, T14 Property14)> WhenChanged( this TObj objectToMonitor, Expression> property1, @@ -1720,20 +1720,20 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13, - T14 property14)> WhenChanged( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13, + T14 Property14)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1844,10 +1844,10 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13, T14 property14, T15 - property15)> WhenChanged( + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13, T14 Property14, T15 + Property15)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1937,21 +1937,21 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13, - T14 property14, - T15 property15)> WhenChanged( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13, + T14 Property14, + T15 Property15)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -2068,10 +2068,10 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13, T14 property14, T15 - property15, T16 property16)> WhenChanged< + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13, T14 Property14, T15 + Property15, T16 Property16)> WhenChanged< TObj, T1, T2, @@ -2183,22 +2183,22 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13, - T14 property14, - T15 property15, - T16 property16)> WhenChanged( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13, + T14 Property14, + T15 Property15, + T16 Property16)> WhenChanged( this TObj objectToMonitor, Expression> property1, Expression> property2, diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanging.Selectors.WideArity.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanging.Selectors.WideArity.cs index 1706ad04..422ccaec 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanging.Selectors.WideArity.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanging.Selectors.WideArity.cs @@ -73,7 +73,7 @@ public static IObservable WhenChanging( property1, property2, callerFilePath: callerFilePath, - callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.property1, t.property2)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2)); #if NET8_0_OR_GREATER /// @@ -143,7 +143,7 @@ public static IObservable WhenChanging( property2, property3, callerFilePath: callerFilePath, - callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.property1, t.property2, t.property3)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2, t.Property3)); #if NET8_0_OR_GREATER /// @@ -224,7 +224,7 @@ public static IObservable WhenChanging( property3, property4, callerFilePath: callerFilePath, - callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.property1, t.property2, t.property3, t.property4)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2, t.Property3, t.Property4)); #if NET8_0_OR_GREATER /// @@ -316,7 +316,7 @@ public static IObservable WhenChanging conversionFunc(t.property1, t.property2, t.property3, t.property4, t.property5)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2, t.Property3, t.Property4, t.Property5)); #if NET8_0_OR_GREATER /// @@ -418,7 +418,7 @@ public static IObservable WhenChanging conversionFunc(t.property1, t.property2, t.property3, t.property4, t.property5, t.property6)); + callerLineNumber: callerLineNumber).Select(t => conversionFunc(t.Property1, t.Property2, t.Property3, t.Property4, t.Property5, t.Property6)); #if NET8_0_OR_GREATER /// @@ -531,13 +531,13 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7)); #if NET8_0_OR_GREATER /// @@ -660,14 +660,14 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8)); #if NET8_0_OR_GREATER /// @@ -800,15 +800,15 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9)); #if NET8_0_OR_GREATER /// @@ -951,16 +951,16 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10)); #if NET8_0_OR_GREATER /// @@ -1113,17 +1113,17 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11)); #if NET8_0_OR_GREATER /// @@ -1286,18 +1286,18 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12)); #if NET8_0_OR_GREATER /// @@ -1485,19 +1485,19 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13)); #if NET8_0_OR_GREATER /// @@ -1696,20 +1696,20 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13, - t.property14)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13, + t.Property14)); #if NET8_0_OR_GREATER /// @@ -1919,21 +1919,21 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13, - t.property14, - t.property15)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13, + t.Property14, + t.Property15)); #if NET8_0_OR_GREATER /// @@ -2154,20 +2154,20 @@ public static IObservable WhenChanging conversionFunc( - t.property1, - t.property2, - t.property3, - t.property4, - t.property5, - t.property6, - t.property7, - t.property8, - t.property9, - t.property10, - t.property11, - t.property12, - t.property13, - t.property14, - t.property15, - t.property16)); + t.Property1, + t.Property2, + t.Property3, + t.Property4, + t.Property5, + t.Property6, + t.Property7, + t.Property8, + t.Property9, + t.Property10, + t.Property11, + t.Property12, + t.Property13, + t.Property14, + t.Property15, + t.Property16)); } diff --git a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanging.WideArity.cs b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanging.WideArity.cs index 4edc3251..73f8354d 100644 --- a/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanging.WideArity.cs +++ b/src/ReactiveUI.Binding.Shared/Mixins/ReactiveUIBindingExtensions.WhenChanging.WideArity.cs @@ -67,7 +67,7 @@ public static IObservable WhenChanging( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values before any of them changes. - public static IObservable<(T1 property1, T2 property2)> WhenChanging( + public static IObservable<(T1 Property1, T2 Property2)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -89,7 +89,7 @@ public static IObservable WhenChanging( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values before any of them changes. - public static IObservable<(T1 property1, T2 property2)> WhenChanging( + public static IObservable<(T1 Property1, T2 Property2)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -125,7 +125,7 @@ public static IObservable WhenChanging( /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3)> WhenChanging( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -152,7 +152,7 @@ public static IObservable WhenChanging( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values before any of them changes. - public static IObservable<(T1 property1, T2 property2, T3 property3)> WhenChanging( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -195,7 +195,7 @@ public static IObservable WhenChanging( /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4)> WhenChanging< + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4)> WhenChanging< TObj, T1, T2, @@ -232,7 +232,7 @@ public static IObservable WhenChanging( /// The source file path of the caller. Auto-populated by the compiler. /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values before any of them changes. - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4)> WhenChanging( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -281,7 +281,7 @@ public static IObservable WhenChanging( /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5)> WhenChanging< + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5)> WhenChanging< TObj, T1, T2, @@ -325,7 +325,7 @@ public static IObservable WhenChanging( /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5)> WhenChanging( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -380,7 +380,7 @@ public static IObservable WhenChanging( /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6)> + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6)> WhenChanging( this TObj objectToMonitor, Expression> property1, @@ -424,7 +424,7 @@ public static IObservable WhenChanging( /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6)> WhenChanging( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -486,7 +486,7 @@ public static IObservable WhenChanging( [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7)> + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7)> WhenChanging( this TObj objectToMonitor, Expression> property1, @@ -535,7 +535,7 @@ public static /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7)> WhenChanging( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -603,9 +603,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8)> WhenChanging( + Property8)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -658,7 +658,7 @@ public static /// The source line number of the caller. Auto-populated by the compiler. /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] - public static IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, T8 property8)> WhenChanging( + public static IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 Property8)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -732,9 +732,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9)> WhenChanging( + Property8, T9 Property9)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -793,15 +793,15 @@ public static /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9)> WhenChanging( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -881,9 +881,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10)> WhenChanging( + Property8, T9 Property9, T10 Property10)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -947,16 +947,16 @@ public static /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10)> WhenChanging( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1042,9 +1042,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11)> WhenChanging< + Property8, T9 Property9, T10 Property10, T11 Property11)> WhenChanging< TObj, T1, T2, @@ -1125,17 +1125,17 @@ public static /// An observable sequence that emits a tuple of all observed property values before any of them changes. [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11)> WhenChanging( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1227,9 +1227,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12)> WhenChanging< + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12)> WhenChanging< TObj, T1, T2, @@ -1317,18 +1317,18 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12)> WhenChanging( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1426,9 +1426,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13)> WhenChanging< + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13)> WhenChanging< TObj, T1, T2, @@ -1522,19 +1522,19 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13)> WhenChanging( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1639,9 +1639,9 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13, T14 property14)> + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13, T14 Property14)> WhenChanging( this TObj objectToMonitor, Expression> property1, @@ -1727,20 +1727,20 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13, - T14 property14)> WhenChanging( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13, + T14 Property14)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1851,10 +1851,10 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13, T14 property14, T15 - property15)> WhenChanging( + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13, T14 Property14, T15 + Property15)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -1944,21 +1944,21 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13, - T14 property14, - T15 property15)> WhenChanging( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13, + T14 Property14, + T15 Property15)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, @@ -2075,10 +2075,10 @@ public static [SuppressMessage("Design", "SST1472", Justification = "one selector per observed property; the parameter count is the shape of this overload")] [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] public static - IObservable<(T1 property1, T2 property2, T3 property3, T4 property4, T5 property5, T6 property6, T7 property7, + IObservable<(T1 Property1, T2 Property2, T3 Property3, T4 Property4, T5 Property5, T6 Property6, T7 Property7, T8 - property8, T9 property9, T10 property10, T11 property11, T12 property12, T13 property13, T14 property14, T15 - property15, T16 property16)> WhenChanging< + Property8, T9 Property9, T10 Property10, T11 Property11, T12 Property12, T13 Property13, T14 Property14, T15 + Property15, T16 Property16)> WhenChanging< TObj, T1, T2, @@ -2190,22 +2190,22 @@ public static [SuppressMessage("Design", "SST1523", Justification = "one observation step per observed property; the length is the shape of this overload")] [SuppressMessage("Design", "SST1472", Justification = "parameter count is inherent to the N-property dispatch stub and its CallerInfo contract")] public static IObservable<( - T1 property1, - T2 property2, - T3 property3, - T4 property4, - T5 property5, - T6 property6, - T7 property7, - T8 property8, - T9 property9, - T10 property10, - T11 property11, - T12 property12, - T13 property13, - T14 property14, - T15 property15, - T16 property16)> WhenChanging( + T1 Property1, + T2 Property2, + T3 Property3, + T4 Property4, + T5 Property5, + T6 Property6, + T7 Property7, + T8 Property8, + T9 Property9, + T10 Property10, + T11 Property11, + T12 Property12, + T13 Property13, + T14 Property14, + T15 Property15, + T16 Property16)> WhenChanging( this TObj objectToMonitor, Expression> property1, Expression> property2, diff --git a/src/ReactiveUI.Binding.Shared/ObservableForProperty/ExpressionChainSink.cs b/src/ReactiveUI.Binding.Shared/ObservableForProperty/ExpressionChainSink.cs index a394b759..48670027 100644 --- a/src/ReactiveUI.Binding.Shared/ObservableForProperty/ExpressionChainSink.cs +++ b/src/ReactiveUI.Binding.Shared/ObservableForProperty/ExpressionChainSink.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.ObservableForProperty; @@ -20,6 +21,7 @@ namespace ReactiveUI.Binding.ObservableForProperty; /// /// The root sender type surfaced on the emitted change. /// The leaf value type. +[DebuggerDisplay("{_expression}, Links = {_links.Length}, BeforeChange = {_beforeChange}, SkipInitial = {_skipInitial}, Distinct = {_isDistinct}")] [EditorBrowsable(EditorBrowsableState.Never)] [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] public sealed class ExpressionChainSink : IObservable> @@ -184,6 +186,7 @@ public void Dispose() /// Sets the parent value of the level after . /// The level index that produced the value. /// The value the link produced (the parent for the next level). + [MethodImpl(MethodImplOptions.AggressiveInlining)] private void SetNextParent(int level, object? value) => _levels[level + 1].SetParent(value); /// Handles a leaf raw emission: applies skip-initial, the non-null-parent filter, the cast and the distinct gate. @@ -291,6 +294,7 @@ public void SetParent(object? parent) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Dispose() => _subscription.Dispose(); /// Handles a notification for this link by re-reading the value and propagating it. @@ -310,11 +314,13 @@ private void OnNotification(IObservedChange change) /// Forwards a link-subscription error to the downstream observer. /// The error to forward. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private void ForwardError(Exception error) => _sink._downstream.OnError(error); /// Reads the current value of this link from a parent using the cached fetcher. /// The object the link is read from. /// The link's current value, or the default when the parent is null. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private object? ReadValue(object? parent) => ChainLinkReader.ReadValue(parent, _getter, _arguments, _sink._links[_index]); @@ -343,9 +349,11 @@ private sealed class Observer : IObserver> public Observer(Level level) => _level = level; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(IObservedChange value) => _level.OnNotification(value); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => _level.ForwardError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/ObservableForProperty/INPCObservableForProperty.cs b/src/ReactiveUI.Binding.Shared/ObservableForProperty/INPCObservableForProperty.cs index d33662d5..a91132ee 100644 --- a/src/ReactiveUI.Binding.Shared/ObservableForProperty/INPCObservableForProperty.cs +++ b/src/ReactiveUI.Binding.Shared/ObservableForProperty/INPCObservableForProperty.cs @@ -19,11 +19,10 @@ public class INPCObservableForProperty : ICreatesObservableForProperty /// [RequiresUnreferencedCode("Uses reflection over runtime types which is not trim- or AOT-safe.")] - public int GetAffinityForObject(Type type, string propertyName, bool beforeChanged) - { - var target = beforeChanged ? typeof(INotifyPropertyChanging) : typeof(INotifyPropertyChanged); - return target.GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()) ? SupportedAffinity : 0; - } + public int GetAffinityForObject(Type type, string propertyName, bool beforeChanged) => + (beforeChanged ? typeof(INotifyPropertyChanging) : typeof(INotifyPropertyChanged)).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()) + ? SupportedAffinity + : 0; /// [RequiresUnreferencedCode("Uses reflection over runtime types which is not trim- or AOT-safe.")] diff --git a/src/ReactiveUI.Binding.Shared/ObservableForProperty/ObservableForPropertySink.cs b/src/ReactiveUI.Binding.Shared/ObservableForProperty/ObservableForPropertySink.cs index 865157c7..a8a6ad46 100644 --- a/src/ReactiveUI.Binding.Shared/ObservableForProperty/ObservableForPropertySink.cs +++ b/src/ReactiveUI.Binding.Shared/ObservableForProperty/ObservableForPropertySink.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.ObservableForProperty; @@ -18,6 +19,7 @@ namespace ReactiveUI.Binding.ObservableForProperty; /// /// The type of the observed object surfaced on the emitted change. /// The property value type. +[DebuggerDisplay("{_expression}, Sender = {_sender}, SkipInitial = {_skipInitial}, Distinct = {_isDistinct}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class ObservableForPropertySink : IObservable> { @@ -123,12 +125,15 @@ public IDisposable Run(IObservable> notificatio } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(IObservedChange value) => Emit(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => _downstream.OnError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => _downstream.OnCompleted(); /// Reads the current property value and forwards it as an observed change, honoring the distinct gate. diff --git a/src/ReactiveUI.Binding.Shared/ObservableForProperty/ObservedChangedMixins.cs b/src/ReactiveUI.Binding.Shared/ObservableForProperty/ObservedChangedMixins.cs index 55cdae7a..56408c73 100644 --- a/src/ReactiveUI.Binding.Shared/ObservableForProperty/ObservedChangedMixins.cs +++ b/src/ReactiveUI.Binding.Shared/ObservableForProperty/ObservedChangedMixins.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.ObservableForProperty; #else @@ -23,6 +25,7 @@ public static class ObservedChangedMixins /// /// An Observable representing the stream of current values. [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IObservable Value() => new SelectObservable, TValue>(stream, GetValue); } @@ -43,6 +46,8 @@ public string GetPropertyName() /// Returns the current value of a property given a notification that it has changed. /// The current value of the property. + /// The observed change is . + /// A property partway along the observed change's expression is , so the chain cannot be followed to the value. [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] public TValue GetValue() { diff --git a/src/ReactiveUI.Binding.Shared/ObservableForProperty/ReactiveNotifyPropertyChangedMixins.cs b/src/ReactiveUI.Binding.Shared/ObservableForProperty/ReactiveNotifyPropertyChangedMixins.cs index f754d8c4..d6e89c8d 100644 --- a/src/ReactiveUI.Binding.Shared/ObservableForProperty/ReactiveNotifyPropertyChangedMixins.cs +++ b/src/ReactiveUI.Binding.Shared/ObservableForProperty/ReactiveNotifyPropertyChangedMixins.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.ObservableForProperty; @@ -38,7 +39,7 @@ public static class ReactiveNotifyPropertyChangedMixins /// and property permanently unobservable. /// private static readonly MemoizingMRUCache< - (Type senderType, string propertyName, bool beforeChange), + (Type SenderType, string PropertyName, bool BeforeChange), ICreatesObservableForProperty> NotifyFactoryCache = new( @@ -57,6 +58,7 @@ private static readonly MemoizingMRUCache< [SuppressMessage("Design", "SST2307:Type parameters should be inferable", Justification = "Specified explicitly by the caller; it identifies the observed shape.")] [RequiresUnreferencedCode( "Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IObservable> ObservableForProperty( string propertyName) => ObservableForProperty(item, propertyName, false, true, true); @@ -69,6 +71,7 @@ public IObservable> ObservableForProperty> ObservableForProperty( string propertyName, bool skipInitial) => @@ -85,6 +88,11 @@ public IObservable> ObservableForPropertyIf true, the Observable will not notify with the initial value. /// If set to true, values are filtered with DistinctUntilChanged. /// An Observable representing the property change notifications for the given property name. + /// The source object or is . + /// + /// No registered bids a positive affinity for + /// on the source object's type. + /// [SuppressMessage("Design", "SST2307:Type parameters should be inferable", Justification = "Specified explicitly by the caller; it identifies the observed shape.")] [RequiresUnreferencedCode( "Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")] @@ -149,6 +157,7 @@ static TValue GetCurrentValue(object sender, string name) /// An Expression representing the property. /// An Observable representing the property change notifications for the given property. [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IObservable> ObservableForProperty( Expression> property) => ObservableForProperty(item, property, false, true, true); @@ -159,6 +168,7 @@ public IObservable> ObservableForPropertyIf true, the Observable will not notify with the initial value. /// An Observable representing the property change notifications for the given property. [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IObservable> ObservableForProperty( Expression> property, bool skipInitial) => @@ -198,6 +208,7 @@ public IObservable> ObservableForPropertyAn observable which notifies about observed changes. [SuppressMessage("Design", "SST2307:Type parameters should be inferable", Justification = "Specified explicitly by the caller; it identifies the observed shape.")] [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IObservable> SubscribeToExpressionChain( Expression? expression) => SubscribeToExpressionChain(item, expression, false, true, true); @@ -209,6 +220,7 @@ public IObservable> SubscribeToExpressionChain< /// An observable which notifies about observed changes. [SuppressMessage("Design", "SST2307:Type parameters should be inferable", Justification = "Specified explicitly by the caller; it identifies the observed shape.")] [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IObservable> SubscribeToExpressionChain( Expression? expression, bool skipInitial) => @@ -271,6 +283,9 @@ public IObservable> SubscribeToExpressionChain< /// The expression identifying the property to observe. /// If , subscribes to before-change notifications. /// An observable of observed changes for the property. + /// is . + /// does not point at a member, so no property name can be resolved from it. + /// No registered bids a positive affinity for the property on 's type. [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")] internal static IObservable> NotifyForProperty( object sender, @@ -300,7 +315,7 @@ public IObservable> SubscribeToExpressionChain< /// The sender type, property name and before-change flag being resolved. /// The best implementation, or when nothing bids a positive affinity. private static ICreatesObservableForProperty? ResolveNotifyFactory( - (Type senderType, string propertyName, bool beforeChange) key) + (Type SenderType, string PropertyName, bool BeforeChange) key) { if (NotifyFactoryCache.TryGet(key, out var memoized)) { @@ -311,12 +326,14 @@ public IObservable> SubscribeToExpressionChain< ICreatesObservableForProperty? best = null; foreach (var candidate in AppLocator.Current.GetServices()) { - var score = candidate.GetAffinityForObject(key.senderType, key.propertyName, key.beforeChange); - if (score > bestScore) + var score = candidate.GetAffinityForObject(key.SenderType, key.PropertyName, key.BeforeChange); + if (score <= bestScore) { - bestScore = score; - best = candidate; + continue; } + + bestScore = score; + best = candidate; } return best is null ? null : NotifyFactoryCache.Get(key, best); diff --git a/src/ReactiveUI.Binding.Shared/Observables/ActionDisposable.cs b/src/ReactiveUI.Binding.Shared/Observables/ActionDisposable.cs index d9820966..0ea27077 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/ActionDisposable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/ActionDisposable.cs @@ -14,6 +14,7 @@ namespace ReactiveUI.Binding.Observables; /// A thread-safe that invokes a delegate exactly once on disposal. /// Lightweight replacement for System.Reactive.Disposables.Disposable.Create(Action). /// +[DebuggerDisplay("Disposed = {_action == null}, Action = {_action}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class ActionDisposable : IDisposable { diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest10Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest10Observable.cs index cd3d8bac..99ef463d 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest10Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest10Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -319,6 +320,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -340,6 +342,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -361,6 +364,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -382,6 +386,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -403,6 +408,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -424,6 +430,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -445,6 +452,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -466,6 +474,7 @@ public void OnNext(T8 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -487,6 +496,7 @@ public void OnNext(T9 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -508,6 +518,7 @@ public void OnNext(T10 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest11Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest11Observable.cs index dbbec253..ecd9297c 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest11Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest11Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -343,6 +344,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -364,6 +366,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -385,6 +388,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -406,6 +410,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -427,6 +432,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -448,6 +454,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -469,6 +476,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -490,6 +498,7 @@ public void OnNext(T8 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -511,6 +520,7 @@ public void OnNext(T9 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -532,6 +542,7 @@ public void OnNext(T10 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -553,6 +564,7 @@ public void OnNext(T11 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest12Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest12Observable.cs index b9fbff83..77fb9150 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest12Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest12Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -366,6 +367,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -387,6 +389,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -408,6 +411,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -429,6 +433,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -450,6 +455,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -471,6 +477,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -492,6 +499,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -513,6 +521,7 @@ public void OnNext(T8 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -534,6 +543,7 @@ public void OnNext(T9 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -555,6 +565,7 @@ public void OnNext(T10 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -576,6 +587,7 @@ public void OnNext(T11 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -597,6 +609,7 @@ public void OnNext(T12 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest13Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest13Observable.cs index c5e2cf69..240581e0 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest13Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest13Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -389,6 +390,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -410,6 +412,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -431,6 +434,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -452,6 +456,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -473,6 +478,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -494,6 +500,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -515,6 +522,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -536,6 +544,7 @@ public void OnNext(T8 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -557,6 +566,7 @@ public void OnNext(T9 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -578,6 +588,7 @@ public void OnNext(T10 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -599,6 +610,7 @@ public void OnNext(T11 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -620,6 +632,7 @@ public void OnNext(T12 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -641,6 +654,7 @@ public void OnNext(T13 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest14Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest14Observable.cs index 69b3d5b2..e4dfa8e3 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest14Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest14Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -427,6 +428,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -448,6 +450,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -469,6 +472,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -490,6 +494,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -511,6 +516,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -532,6 +538,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -553,6 +560,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -574,6 +582,7 @@ public void OnNext(T8 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -595,6 +604,7 @@ public void OnNext(T9 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -616,6 +626,7 @@ public void OnNext(T10 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -637,6 +648,7 @@ public void OnNext(T11 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -658,6 +670,7 @@ public void OnNext(T12 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -679,6 +692,7 @@ public void OnNext(T13 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -700,6 +714,7 @@ public void OnNext(T14 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest15Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest15Observable.cs index 6ae615b2..bafa78d7 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest15Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest15Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -466,6 +467,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -487,6 +489,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -508,6 +511,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -529,6 +533,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -550,6 +555,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -571,6 +577,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -592,6 +599,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -613,6 +621,7 @@ public void OnNext(T8 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -634,6 +643,7 @@ public void OnNext(T9 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -655,6 +665,7 @@ public void OnNext(T10 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -676,6 +687,7 @@ public void OnNext(T11 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -697,6 +709,7 @@ public void OnNext(T12 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -718,6 +731,7 @@ public void OnNext(T13 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -739,6 +753,7 @@ public void OnNext(T14 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -760,6 +775,7 @@ public void OnNext(T15 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest16Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest16Observable.cs index c58a009b..fc338bb8 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest16Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest16Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -492,6 +493,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -513,6 +515,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -534,6 +537,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -555,6 +559,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -576,6 +581,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -597,6 +603,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -618,6 +625,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -639,6 +647,7 @@ public void OnNext(T8 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -660,6 +669,7 @@ public void OnNext(T9 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -681,6 +691,7 @@ public void OnNext(T10 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -702,6 +713,7 @@ public void OnNext(T11 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -723,6 +735,7 @@ public void OnNext(T12 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -744,6 +757,7 @@ public void OnNext(T13 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -765,6 +779,7 @@ public void OnNext(T14 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -786,6 +801,7 @@ public void OnNext(T15 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -807,6 +823,7 @@ public void OnNext(T16 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest2Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest2Observable.cs index 51114483..da843bb8 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest2Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest2Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -135,6 +136,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -156,6 +158,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest3Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest3Observable.cs index cc9e3268..4dd345af 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest3Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest3Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -161,6 +162,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -182,6 +184,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -203,6 +206,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest4Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest4Observable.cs index 0bba10b4..5154f4eb 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest4Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest4Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -187,6 +188,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -208,6 +210,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -229,6 +232,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -250,6 +254,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest5Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest5Observable.cs index 7ec05303..cce17236 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest5Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest5Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -213,6 +214,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -234,6 +236,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -255,6 +258,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -276,6 +280,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -297,6 +302,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest6Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest6Observable.cs index 25c209d8..94d739e3 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest6Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest6Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -239,6 +240,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -260,6 +262,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -281,6 +284,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -302,6 +306,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -323,6 +328,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -344,6 +350,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest7Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest7Observable.cs index d7cb0478..c6ee5102 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest7Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest7Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -266,6 +267,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -287,6 +289,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -308,6 +311,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -329,6 +333,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -350,6 +355,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -371,6 +377,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -392,6 +399,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest8Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest8Observable.cs index f9346ebc..5c464d84 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest8Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest8Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -292,6 +293,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -313,6 +315,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -334,6 +337,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -355,6 +359,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -376,6 +381,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -397,6 +403,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -418,6 +425,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -439,6 +447,7 @@ public void OnNext(T8 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest9Observable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest9Observable.cs index 3673403b..bdc6a4c4 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatest9Observable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatest9Observable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -296,6 +297,7 @@ public void OnNext(T1 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -317,6 +319,7 @@ public void OnNext(T2 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -338,6 +341,7 @@ public void OnNext(T3 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -359,6 +363,7 @@ public void OnNext(T4 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -380,6 +385,7 @@ public void OnNext(T5 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -401,6 +407,7 @@ public void OnNext(T6 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -422,6 +429,7 @@ public void OnNext(T7 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -443,6 +451,7 @@ public void OnNext(T8 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// @@ -464,6 +473,7 @@ public void OnNext(T9 value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => parent._observer?.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/CombineLatestObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/CombineLatestObservable.cs index 98b645eb..78f99bb4 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CombineLatestObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CombineLatestObservable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -26,6 +27,7 @@ public static class CombineLatestObservable /// Source observable 2. /// The function to combine the latest values. /// An observable of combined results. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -42,6 +44,7 @@ public static IObservable Create( /// Source observable 3. /// The function to combine the latest values. /// An observable of combined results. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -61,6 +64,7 @@ public static IObservable Create( /// Source observable 4. /// The function to combine the latest values. /// An observable of combined results. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -83,6 +87,7 @@ public static IObservable Create( /// Source observable 5. /// The function to combine the latest values. /// An observable of combined results. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -114,6 +119,7 @@ public static IObservable Create( /// Source observable 6. /// The function to combine the latest values. /// An observable of combined results. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -150,6 +156,7 @@ public static IObservable Create( /// The function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -190,6 +197,7 @@ public static IObservable Create( /// The function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -234,6 +242,7 @@ public static IObservable CreateThe function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -282,6 +291,7 @@ public static IObservable CreateThe function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -334,6 +344,7 @@ public static IObservable CreateThe function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -390,6 +401,7 @@ public static IObservable CreateThe function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -450,6 +462,7 @@ public static IObservable CreateThe function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -514,6 +527,7 @@ public static IObservable CreateThe function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create( IObservable source1, IObservable source2, @@ -582,6 +596,7 @@ public static IObservable CreateThe function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create< T1, T2, @@ -670,6 +685,7 @@ public static IObservable Create< /// The function to combine the latest values. /// An observable of combined results. [SuppressMessage("Design", "SST1472:Signatures should not declare too many parameters", Justification = "Parameter count is intrinsic to the fixed CombineLatest arity.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Create< T1, T2, diff --git a/src/ReactiveUI.Binding.Shared/Observables/CompositeDisposable2.cs b/src/ReactiveUI.Binding.Shared/Observables/CompositeDisposable2.cs index 5782ef74..c4eed1ac 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/CompositeDisposable2.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/CompositeDisposable2.cs @@ -14,6 +14,7 @@ namespace ReactiveUI.Binding.Observables; /// A fixed two-slot composite disposable. Disposes both contained disposables exactly once. /// Lightweight replacement for System.Reactive.Disposables.CompositeDisposable(d1, d2). /// +[DebuggerDisplay("Disposed = {_disposed == 1}, First = {_d1}, Second = {_d2}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class CompositeDisposable2 : IDisposable { diff --git a/src/ReactiveUI.Binding.Shared/Observables/DistinctUntilChangedByObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/DistinctUntilChangedByObservable.cs index ef28b194..92c0ea39 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/DistinctUntilChangedByObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/DistinctUntilChangedByObservable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -16,6 +17,7 @@ namespace ReactiveUI.Binding.Observables; /// /// The element type. /// The key type used for comparison. +[DebuggerDisplay("Source = {_source}, KeySelector = {_keySelector}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class DistinctUntilChangedByObservable : IObservable { @@ -94,9 +96,11 @@ public void OnNext(TSource value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => _observer.OnError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => _observer.OnCompleted(); } } diff --git a/src/ReactiveUI.Binding.Shared/Observables/DistinctUntilChangedObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/DistinctUntilChangedObservable.cs index ff31c2d5..4c460da3 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/DistinctUntilChangedObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/DistinctUntilChangedObservable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -15,6 +16,7 @@ namespace ReactiveUI.Binding.Observables; /// Replacement for System.Reactive.Linq.Observable.DistinctUntilChanged. /// /// The element type. +[DebuggerDisplay("Source = {_source}, Comparer = {_comparer}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class DistinctUntilChangedObservable : IObservable { @@ -81,9 +83,11 @@ public void OnNext(T value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => _observer.OnError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => _observer.OnCompleted(); } } diff --git a/src/ReactiveUI.Binding.Shared/Observables/EventObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/EventObservable.cs index 7d20452b..98905f24 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/EventObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/EventObservable.cs @@ -18,6 +18,7 @@ namespace ReactiveUI.Binding.Observables; /// {PropertyName}Changed event observation. /// /// The type of the property value. +[DebuggerDisplay("Getter = {_getter}, DistinctUntilChanged = {_distinctUntilChanged}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class EventObservable : IObservable { diff --git a/src/ReactiveUI.Binding.Shared/Observables/GrowableCompositeDisposable.cs b/src/ReactiveUI.Binding.Shared/Observables/GrowableCompositeDisposable.cs index 9393a9c8..47ae750d 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/GrowableCompositeDisposable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/GrowableCompositeDisposable.cs @@ -15,6 +15,7 @@ namespace ReactiveUI.Binding.Observables; /// composite is already disposed are disposed immediately rather than retained, so a producer /// racing disposal cannot leak the resource it was mid-way through handing over. /// +[DebuggerDisplay("Disposed = {_disposables == null}, Resources = {_disposables}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class GrowableCompositeDisposable : IDisposable { diff --git a/src/ReactiveUI.Binding.Shared/Observables/MergeObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/MergeObservable.cs index c7b4c79e..09f55f99 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/MergeObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/MergeObservable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -15,6 +16,7 @@ namespace ReactiveUI.Binding.Observables; /// Replacement for System.Reactive.Linq.Observable.Merge. /// /// The element type. +[DebuggerDisplay("Sources = {_sources.Length}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class MergeObservable : IObservable { @@ -56,9 +58,11 @@ private sealed class MergeObserver : IObserver public MergeObserver(IObserver observer) => _observer = observer; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => _observer.OnNext(value); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => _observer.OnError(error); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/NotifyPropertyChangedObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/NotifyPropertyChangedObservable.cs index 3f188b30..ef99ff9d 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/NotifyPropertyChangedObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/NotifyPropertyChangedObservable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -17,6 +18,7 @@ namespace ReactiveUI.Binding.Observables; /// FromEvent + Where + Select operator chain with one allocation-light class. Before-change versus /// after-change is selected per instance, so a single type serves the whole purpose. /// +[DebuggerDisplay("Property = {_observedPropertyName}, Sender = {_sender}, BeforeChanged = {_beforeChanged}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class NotifyPropertyChangedObservable : IObservable> { @@ -143,11 +145,13 @@ private bool Matches(string? notifiedName) => /// Handles , forwarding the change when the name matches. /// The event sender. /// The property-changed event arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private void OnPropertyChanged(object? sender, PropertyChangedEventArgs e) => Forward(e.PropertyName); /// Handles , forwarding the change when the name matches. /// The event sender. /// The property-changing event arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private void OnPropertyChanging(object? sender, PropertyChangingEventArgs e) => Forward(e.PropertyName); /// Forwards the change to the observer when the notified name matches the observed property. diff --git a/src/ReactiveUI.Binding.Shared/Observables/ObserveOnObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/ObserveOnObservable.cs index 87ce3edf..59d62a34 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/ObserveOnObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/ObserveOnObservable.cs @@ -15,6 +15,7 @@ namespace ReactiveUI.Binding.Observables; /// Forwards all notifications from the source to observers on the specified scheduler. /// /// The type of elements in the observable sequence. +[DebuggerDisplay("Source = {_source}, Scheduler = {_scheduler}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class ObserveOnObservable : IObservable { @@ -75,10 +76,10 @@ public void OnError(Exception error) // the notification out of a closure. Its return value is the handle for any recursive work // the callback schedules; there is none, so it hands back the empty disposable. var d = _scheduler.Schedule( - (observer: _observer, error), + (Observer: _observer, Error: error), static (_, state) => { - state.observer.OnError(state.error); + state.Observer.OnError(state.Error); return EmptyDisposable.Instance; }); _disposable.Add(d); @@ -88,10 +89,10 @@ public void OnError(Exception error) public void OnNext(T value) { var d = _scheduler.Schedule( - (observer: _observer, value), + (Observer: _observer, Value: value), static (_, state) => { - state.observer.OnNext(state.value); + state.Observer.OnNext(state.Value); return EmptyDisposable.Instance; }); _disposable.Add(d); diff --git a/src/ReactiveUI.Binding.Shared/Observables/PropertyChangingObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/PropertyChangingObservable.cs index 9c8b5982..32602e74 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/PropertyChangingObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/PropertyChangingObservable.cs @@ -17,6 +17,7 @@ namespace ReactiveUI.Binding.Observables; /// when fires. /// /// The type of the property value. +[DebuggerDisplay("Property = {_propertyName}, Source = {_source}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class PropertyChangingObservable : IObservable { diff --git a/src/ReactiveUI.Binding.Shared/Observables/PropertyObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/PropertyObservable.cs index 7d440df7..57032096 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/PropertyObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/PropertyObservable.cs @@ -16,6 +16,7 @@ namespace ReactiveUI.Binding.Observables; /// Emits the current value on subscription, then emits new values when the property changes. /// /// The type of the property value. +[DebuggerDisplay("Property = {_propertyName}, Source = {_source}, DistinctUntilChanged = {_distinctUntilChanged}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class PropertyObservable : IObservable { diff --git a/src/ReactiveUI.Binding.Shared/Observables/ReturnObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/ReturnObservable.cs index 863dab25..e85ffa06 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/ReturnObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/ReturnObservable.cs @@ -12,6 +12,7 @@ namespace ReactiveUI.Binding.Observables; /// An observable that emits a single value and then completes. Lightweight replacement for Observable.Return<T>(value). /// The type of the value. +[DebuggerDisplay("Value = {_value}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class ReturnObservable : IObservable { diff --git a/src/ReactiveUI.Binding.Shared/Observables/RxBindingExtensions.cs b/src/ReactiveUI.Binding.Shared/Observables/RxBindingExtensions.cs index edfeb9c2..be55d756 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/RxBindingExtensions.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/RxBindingExtensions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -36,12 +37,14 @@ public static IDisposable Subscribe(IObservable source, Action onNext) /// The source observable. /// The number of elements to skip. /// An observable that skips elements. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Skip(IObservable source, int count) => new SkipObservable(source, count); /// Merges multiple observables into one. /// The element type. /// The source observables. /// A merged observable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Merge(params IObservable[] sources) => new MergeObservable(sources); /// Provides Switch extension members for . @@ -51,6 +54,7 @@ public static IDisposable Subscribe(IObservable source, Action onNext) { /// Flattens an observable of observables by subscribing to the most recent inner observable. /// A flattened observable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IObservable Switch() => new SwitchObservable(source); } @@ -63,11 +67,13 @@ public static IDisposable Subscribe(IObservable source, Action onNext) /// The projected element type. /// The projection function. /// A projected observable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IObservable Select(Func selector) => new SelectObservable(source, selector); /// Suppresses consecutive duplicate values. /// An observable with distinct consecutive values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IObservable DistinctUntilChanged() => new DistinctUntilChangedObservable(source); } @@ -85,6 +91,7 @@ private sealed class ActionObserver : IObserver public ActionObserver(Action onNext) => _onNext = onNext; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => _onNext(value); /// diff --git a/src/ReactiveUI.Binding.Shared/Observables/SelectObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/SelectObservable.cs index fed84661..4a4bbacf 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/SelectObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/SelectObservable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -13,6 +14,7 @@ namespace ReactiveUI.Binding.Observables; /// Lightweight Select (map/projection) operator. Replacement for System.Reactive.Linq.Observable.Select. /// The source element type. /// The projected element type. +[DebuggerDisplay("Source = {_source}, Selector = {_selector}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class SelectObservable : IObservable { @@ -53,12 +55,15 @@ private sealed class SelectObserver(IObserver observer, Func _selector = selector; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(TSource value) => _observer.OnNext(_selector(value)); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => _observer.OnError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => _observer.OnCompleted(); } } diff --git a/src/ReactiveUI.Binding.Shared/Observables/SerialDisposable.cs b/src/ReactiveUI.Binding.Shared/Observables/SerialDisposable.cs index 2165e07c..91d8bedf 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/SerialDisposable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/SerialDisposable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -14,6 +15,7 @@ namespace ReactiveUI.Binding.Observables; /// A thread-safe serial disposable that disposes the previous inner disposable when a new one is assigned. /// Lightweight replacement for System.Reactive.Disposables.SerialDisposable. /// +[DebuggerDisplay("Disposed = {_disposed == 1}, Current = {_current}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class SerialDisposable : IDisposable { @@ -80,5 +82,6 @@ public void Dispose() /// to return null because already took it. /// [ExcludeFromCodeCoverage] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private void DisposeCurrentIfRace() => TakeCurrent()?.Dispose(); } diff --git a/src/ReactiveUI.Binding.Shared/Observables/SkipObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/SkipObservable.cs index 420c0e6b..6aa4a2df 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/SkipObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/SkipObservable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -12,6 +13,7 @@ namespace ReactiveUI.Binding.Observables; /// Lightweight Skip operator that suppresses the first N elements. Replacement for System.Reactive.Linq.Observable.Skip. /// The element type. +[DebuggerDisplay("Source = {_source}, Skipping = {_count}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class SkipObservable : IObservable { @@ -63,9 +65,11 @@ public void OnNext(T value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => _observer.OnError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => _observer.OnCompleted(); } } diff --git a/src/ReactiveUI.Binding.Shared/Observables/StartWithObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/StartWithObservable.cs index ce4744d2..1101c6d9 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/StartWithObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/StartWithObservable.cs @@ -15,6 +15,7 @@ namespace ReactiveUI.Binding.Observables; /// relaying the source. Lightweight replacement for System.Reactive.Linq.Observable.StartWith. /// /// The element type. +[DebuggerDisplay("Prepended = {_value}, Source = {_source}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class StartWithObservable : IObservable { diff --git a/src/ReactiveUI.Binding.Shared/Observables/SwitchObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/SwitchObservable.cs index 3d702cda..0cb798b2 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/SwitchObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/SwitchObservable.cs @@ -16,6 +16,7 @@ namespace ReactiveUI.Binding.Observables; /// Replacement for System.Reactive.Linq.Observable.Switch. /// /// The element type of the inner observables. +[DebuggerDisplay("Source = {_source}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class SwitchObservable : IObservable { diff --git a/src/ReactiveUI.Binding.Shared/Observables/WhereObservable.cs b/src/ReactiveUI.Binding.Shared/Observables/WhereObservable.cs index c24054cd..bfb54e87 100644 --- a/src/ReactiveUI.Binding.Shared/Observables/WhereObservable.cs +++ b/src/ReactiveUI.Binding.Shared/Observables/WhereObservable.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.Observables; @@ -15,6 +16,7 @@ namespace ReactiveUI.Binding.Observables; /// Replacement for System.Reactive.Linq.Observable.Where. /// /// The element type. +[DebuggerDisplay("Source = {_source}, Predicate = {_predicate}")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class WhereObservable : IObservable { @@ -77,9 +79,11 @@ public void OnNext(T value) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => _observer.OnError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => _observer.OnCompleted(); } } diff --git a/src/ReactiveUI.Binding.Shared/Polyfills/DynamicallyAccessedMemberTypes.cs b/src/ReactiveUI.Binding.Shared/Polyfills/DynamicallyAccessedMemberTypes.cs index a703d67e..2f4a4c2a 100644 --- a/src/ReactiveUI.Binding.Shared/Polyfills/DynamicallyAccessedMemberTypes.cs +++ b/src/ReactiveUI.Binding.Shared/Polyfills/DynamicallyAccessedMemberTypes.cs @@ -14,52 +14,58 @@ namespace System.Diagnostics.CodeAnalysis; /// [Flags] [SuppressMessage("Design", "SST2303:Flags enum members should be distinct bit values", Justification = "Mirrors the framework enum bit-for-bit, including its composite members.")] +[SuppressMessage( + "Correctness", + "SST2461:A combined flags value should only set bits the enum defines", + Justification = "Bit 1 is only ever set as part of PublicConstructors, exactly as in the BCL type this mirrors." + + " Every value must stay numerically identical because the newer targets type-forward to the real" + + " enum, and naming that bit would invent a member the BCL does not have.")] internal enum DynamicallyAccessedMemberTypes { /// Specifies no members. None = 0, /// Specifies the default, parameterless public constructor. - PublicParameterlessConstructor = 0x_0001, + PublicParameterlessConstructor = 1 << 0, /// Specifies all public constructors. - PublicConstructors = 0x_0002 | PublicParameterlessConstructor, + PublicConstructors = 0x0002 | PublicParameterlessConstructor, /// Specifies all non-public constructors. - NonPublicConstructors = 0x_0004, + NonPublicConstructors = 1 << 2, /// Specifies all public methods. - PublicMethods = 0x_0008, + PublicMethods = 1 << 3, /// Specifies all non-public methods. - NonPublicMethods = 0x_0010, + NonPublicMethods = 1 << 4, /// Specifies all public fields. - PublicFields = 0x_0020, + PublicFields = 1 << 5, /// Specifies all non-public fields. - NonPublicFields = 0x_0040, + NonPublicFields = 1 << 6, /// Specifies all public nested types. - PublicNestedTypes = 0x_0080, + PublicNestedTypes = 1 << 7, /// Specifies all non-public nested types. - NonPublicNestedTypes = 0x_0100, + NonPublicNestedTypes = 1 << 8, /// Specifies all public properties. - PublicProperties = 0x_0200, + PublicProperties = 1 << 9, /// Specifies all non-public properties. - NonPublicProperties = 0x_0400, + NonPublicProperties = 1 << 10, /// Specifies all public events. - PublicEvents = 0x_0800, + PublicEvents = 1 << 11, /// Specifies all non-public events. - NonPublicEvents = 0x_1000, + NonPublicEvents = 1 << 12, /// Specifies all interfaces implemented by the type. - Interfaces = 0x_2000, + Interfaces = 1 << 13, /// Specifies all members. All = ~None, diff --git a/src/ReactiveUI.Binding.Shared/Polyfills/Index.cs b/src/ReactiveUI.Binding.Shared/Polyfills/Index.cs index ae262c16..841e0eda 100644 --- a/src/ReactiveUI.Binding.Shared/Polyfills/Index.cs +++ b/src/ReactiveUI.Binding.Shared/Polyfills/Index.cs @@ -22,6 +22,7 @@ namespace System; /// Initializes a new instance of the struct. /// The index value. Must be zero or positive. /// Indicates whether the index is counted from the start or the end. + /// is negative. public Index(int value, bool fromEnd = false) { if (value < 0) diff --git a/src/ReactiveUI.Binding.Shared/Polyfills/Range.cs b/src/ReactiveUI.Binding.Shared/Polyfills/Range.cs index ecf455a8..def9f8b4 100644 --- a/src/ReactiveUI.Binding.Shared/Polyfills/Range.cs +++ b/src/ReactiveUI.Binding.Shared/Polyfills/Range.cs @@ -68,6 +68,7 @@ public Range(Index start, Index end) /// Calculates the start offset and length of the range for a collection of the supplied length. /// The length of the collection. /// A tuple containing the start offset and the length of the range. + /// The range falls outside a collection of elements. internal (int Offset, int Length) GetOffsetAndLength(int length) { var start = Start.GetOffset(length); diff --git a/src/ReactiveUI.Binding.Shared/View/DefaultViewLocator.cs b/src/ReactiveUI.Binding.Shared/View/DefaultViewLocator.cs index 16a9c78b..e4fb4eb6 100644 --- a/src/ReactiveUI.Binding.Shared/View/DefaultViewLocator.cs +++ b/src/ReactiveUI.Binding.Shared/View/DefaultViewLocator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; @@ -15,6 +16,7 @@ namespace ReactiveUI.Binding; /// using a three-tier resolution strategy: source-generated AOT-safe dispatch, explicit runtime /// mappings, and service locator fallback. /// +[DebuggerDisplay("Mappings = {_mappings.Count}")] public sealed class DefaultViewLocator : IViewLocator { /// @@ -48,6 +50,7 @@ public static void SetGeneratedViewDispatch(Func disp /// The view model type. /// The view type. Must implement . [SuppressMessage("Design", "SST2307:Type parameters should be inferable", Justification = "Specified explicitly by the caller; it identifies the mapping.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Map() where TViewModel : class where TView : IViewFor, new() => Map(null); @@ -72,6 +75,7 @@ public void Map(string? contract) /// The view model type. /// A factory function that creates the view. [SuppressMessage("Design", "SST2307:Type parameters should be inferable", Justification = "Specified explicitly by the caller; it identifies the mapping.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Map(Func factory) where TViewModel : class => Map(factory, null); @@ -96,6 +100,7 @@ public void Map(Func factory, string? contract) /// The view model type. /// if the mapping was removed; otherwise, . [SuppressMessage("Design", "SST2307:Type parameters should be inferable", Justification = "Specified explicitly by the caller; it identifies the mapping.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Unmap() where TViewModel : class => Unmap(null); @@ -218,8 +223,7 @@ public bool Unmap(string? contract) { var viewModelType = viewModel.GetType(); var viewForType = typeof(IViewFor<>).MakeGenericType(viewModelType); - var svcContract = contract.Length == 0 ? null : contract; - var view = AppLocator.Current.GetService(viewForType, svcContract) as IViewFor; + var view = AppLocator.Current.GetService(viewForType, contract.Length == 0 ? null : contract) as IViewFor; if (view is not null) { SetViewModelOnView(view, viewModel); @@ -239,9 +243,6 @@ public bool Unmap(string? contract) /// The type of the view model. /// The normalized contract string. /// The resolved view, or . - private IViewFor? TryResolveFromMappings(Type viewModelType, string contract) - { - var mappings = _mappings; - return !mappings.TryGetValue((viewModelType, contract), out var factory) ? null : factory(); - } + private IViewFor? TryResolveFromMappings(Type viewModelType, string contract) => + !_mappings.TryGetValue((viewModelType, contract), out var factory) ? null : factory(); } diff --git a/src/ReactiveUI.Binding.Shared/View/ViewContractAttribute.cs b/src/ReactiveUI.Binding.Shared/View/ViewContractAttribute.cs index a435d7fb..bd9e1dbf 100644 --- a/src/ReactiveUI.Binding.Shared/View/ViewContractAttribute.cs +++ b/src/ReactiveUI.Binding.Shared/View/ViewContractAttribute.cs @@ -15,6 +15,7 @@ namespace ReactiveUI.Binding; /// contract, enabling selection between different Views for a single ViewModel. /// /// The contract value for view resolution. +[DebuggerDisplay("Contract = {Contract}")] [AttributeUsage(AttributeTargets.Class)] public sealed class ViewContractAttribute(string contract) : Attribute { diff --git a/src/ReactiveUI.Binding.Shared/View/ViewMappingBuilder.cs b/src/ReactiveUI.Binding.Shared/View/ViewMappingBuilder.cs index ac1027b0..267f33e4 100644 --- a/src/ReactiveUI.Binding.Shared/View/ViewMappingBuilder.cs +++ b/src/ReactiveUI.Binding.Shared/View/ViewMappingBuilder.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive; #else @@ -9,6 +11,7 @@ namespace ReactiveUI.Binding; #endif /// Fluent builder for registering view-to-view-model mappings on a . +[DebuggerDisplay("Locator = {_locator}")] public sealed class ViewMappingBuilder { /// The view locator to register mappings on. @@ -23,6 +26,7 @@ public sealed class ViewMappingBuilder /// The view type. Must have a parameterless constructor. /// This builder for chaining. [SuppressMessage("Design", "SST2307:Type parameters should be inferable", Justification = "Specified explicitly by the caller; it identifies the mapping.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public ViewMappingBuilder Map() where TViewModel : class where TView : IViewFor, new() => Map(null); @@ -46,6 +50,7 @@ public ViewMappingBuilder Map(string? contract) /// A factory function that creates the view. /// This builder for chaining. [SuppressMessage("Design", "SST2307:Type parameters should be inferable", Justification = "Specified explicitly by the caller; it identifies the mapping.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public ViewMappingBuilder Map(Func factory) where TViewModel : class => Map(factory, null); diff --git a/src/ReactiveUI.Binding.SourceGenerators/BindingGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/BindingGenerator.cs index fddb9d21..0226303b 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/BindingGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/BindingGenerator.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -101,7 +102,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) WhenAnyObservableInvocationGenerator.Register(context, whenAnyObservable, allClasses, languageFeatures); BindInteractionInvocationGenerator.Register(context, bindInteraction, allClasses, languageFeatures); BindCommandInvocationGenerator.Register(context, bindCommand, allClasses, languageFeatures); - BindToInvocationGenerator.Register(context, bindTo, allClasses, languageFeatures); + BindToInvocationGenerator.Register(context, bindTo, languageFeatures); } /// @@ -117,6 +118,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) /// reaches for it. Collapsing the per-type kinds to a distinct set first means adding another type of an /// already-seen kind leaves this output cached. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void RegisterObservationHelperOutput( in IncrementalGeneratorInitializationContext context, IncrementalValuesProvider observableTypes, @@ -135,6 +137,7 @@ private static void RegisterObservationHelperOutput( /// The syntactic filter for this API. /// The semantic extraction for this API. /// The extracted call sites, with the unanalyzable ones dropped. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static IncrementalValuesProvider Detect( in IncrementalGeneratorInitializationContext context, Func predicate, @@ -157,6 +160,7 @@ private static IncrementalValuesProvider Detect( /// it is not AllowMultiple, so repeating it across the dispatch files would be a duplicate-attribute /// error. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void RegisterSharedAttributeOutput( in IncrementalGeneratorInitializationContext context, IncrementalValueProvider languageFeatures) => @@ -197,6 +201,7 @@ private static void RegisterSharedAttributeOutput( /// /// The generator initialization context. /// A provider yielding the consumer's language-feature snapshot. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static IncrementalValueProvider SelectLanguageFeatures( in IncrementalGeneratorInitializationContext context) => context.ParseOptionsProvider diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindCodeGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindCodeGenerator.cs index 0e0fd7bd..36a6fb81 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindCodeGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindCodeGenerator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Immutable; +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; using static ReactiveUI.Binding.SourceGenerators.CodeGeneration.GeneratedTypeNames; @@ -32,53 +33,33 @@ internal static class BindCodeGenerator /// All detected class binding info. /// The consumer compilation's C# language-feature snapshot (dispatch strategy and nullable support). /// Generated source code string, or null if no invocations. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string? Generate( ImmutableArray invocations, ImmutableArray allClasses, - in LanguageFeatures features) - { - if (invocations.IsDefaultOrEmpty) - { - return null; - } - - var sb = PooledBuilder.Rent(invocations.Length * CodeGeneratorHelpers.PerInvocationBufferCapacity); - var supportsCallerArgExpr = features.SupportsCallerArgExpr; - CodeGeneratorHelpers.AppendExtensionClassHeader(sb, features); - _ = sb.AppendLine(); - - var groups = GroupByTypeSignature(invocations); - - for (var g = 0; g < groups.Count; g++) - { - var group = groups[g]; - - GenerateConcreteOverload(sb, group, supportsCallerArgExpr, features.SupportsNullable, features.StubHasExpressionParameters); - _ = sb.AppendLine(); - - for (var i = 0; i < group.Invocations.Length; i++) - { - var inv = group.Invocations[i]; - var sourceClassInfo = CodeGeneratorHelpers.FindClassInfo(allClasses, inv.SourceTypeFullName); - var targetClassInfo = CodeGeneratorHelpers.FindClassInfo(allClasses, inv.TargetTypeFullName); - var suffix = CodeGeneratorHelpers.ComputeStableMethodSuffix( - inv.SourceTypeFullName, - inv.CallerFilePath, - inv.CallerLineNumber, - $"{inv.SourceExpressionText}|{inv.TargetExpressionText}"); - GenerateBindMethod(sb, inv, sourceClassInfo, targetClassInfo, suffix, features.SupportsNullable); - } - } - - CodeGeneratorHelpers.AppendExtensionClassFooter(sb); - _ = sb.AppendLine(); - - return PooledBuilder.ToStringAndReturn(sb); - } + in LanguageFeatures features) => + BindingEmitterHelpers.Generate( + invocations, + allClasses, + features, + static (sb, group, f) => GenerateConcreteOverload( + sb, + group, + f.SupportsCallerArgExpr, + f.SupportsNullable, + f.StubHasExpressionParameters), + static (sb, ctx) => GenerateBindMethod( + sb, + ctx.Invocation, + ctx.SourceClassInfo, + ctx.TargetClassInfo, + ctx.Suffix, + ctx.Features.SupportsNullable)); /// Groups Bind invocations by their type signature for overload generation. /// The Bind invocations to group. /// A list of grouped invocations sharing the same type signature. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static List GroupByTypeSignature(ImmutableArray invocations) => BindingEmitterHelpers.GroupByTypeSignature(invocations); @@ -299,32 +280,35 @@ internal static void GenerateBindMethod( /// Appends extra parameters (converters, scheduler) to the concrete overload signature. /// The string builder to append to. /// The binding type group. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void AppendExtraParameters(StringBuilder sb, BindingTypeGroup group) => BindingEmitterHelpers.AppendTwoWayExtraParameters(sb, group, ForwardConverterName, ReverseConverterName); /// Formats extra arguments (converters, scheduler) for forwarding to the binding method. /// The binding type group. /// Extra arguments string or empty. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string FormatExtraArgs(BindingTypeGroup group) => BindingEmitterHelpers.FormatTwoWayExtraArgs(group, ForwardConverterName, ReverseConverterName); /// Formats extra method parameters for the private binding method signature. /// The binding invocation info. /// Extra parameters string for converter and scheduler parameters. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string FormatExtraMethodParams(BindingInvocationInfo inv) => BindingEmitterHelpers.FormatTwoWayExtraMethodParams(inv, ForwardConverterName, ReverseConverterName); /// Formats the return type for a concrete Bind overload. /// The binding type group. - /// The fully qualified return type string. /// Whether the target supports nullable reference types (C# 8+). + /// The fully qualified return type string. internal static string FormatReturnType(BindingTypeGroup group, bool supportsNullable) => $"global::ReactiveUI.Binding.IReactiveBinding<{group.TargetTypeFullName}, {BindReturnValueType(supportsNullable)}>"; /// Formats the return type for a private Bind method. /// The binding invocation info. - /// The fully qualified return type string. /// Whether the target supports nullable reference types (C# 8+). + /// The fully qualified return type string. internal static string FormatMethodReturnType(BindingInvocationInfo inv, bool supportsNullable) => $"global::ReactiveUI.Binding.IReactiveBinding<{inv.TargetTypeFullName}, {BindReturnValueType(supportsNullable)}>"; @@ -422,5 +406,5 @@ private static void EmitTwoWaySubscription( /// Whether the target supports nullable reference types (C# 8+). /// The value-tuple type string. private static string BindReturnValueType(bool supportsNullable) => - supportsNullable ? "(object? view, bool isViewModel)" : "(object view, bool isViewModel)"; + supportsNullable ? "(object? View, bool IsViewModel)" : "(object View, bool IsViewModel)"; } diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindOneWayCodeGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindOneWayCodeGenerator.cs index f3c354f3..a93c64e6 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindOneWayCodeGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindOneWayCodeGenerator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Immutable; +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; using static ReactiveUI.Binding.SourceGenerators.CodeGeneration.GeneratedTypeNames; @@ -26,55 +27,27 @@ internal static class BindOneWayCodeGenerator /// All detected class binding info. /// The consumer compilation's C# language-feature snapshot (dispatch strategy and nullable support). /// Generated source code string, or null if no invocations. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string? Generate( ImmutableArray invocations, ImmutableArray allClasses, - in LanguageFeatures features) - { - if (invocations.IsDefaultOrEmpty) - { - return null; - } - - var sb = PooledBuilder.Rent(invocations.Length * CodeGeneratorHelpers.PerInvocationBufferCapacity); - var supportsCallerArgExpr = features.SupportsCallerArgExpr; - CodeGeneratorHelpers.AppendExtensionClassHeader(sb, features); - _ = sb.AppendLine(); - - // Group invocations by (SourceType, TargetType, SourcePropertyType, TargetPropertyType, HasConversion, HasScheduler) - var groups = GroupByTypeSignature(invocations); - - for (var g = 0; g < groups.Count; g++) - { - var group = groups[g]; - - // Generate the concrete typed extension method overload - GenerateConcreteOverload(sb, group, supportsCallerArgExpr, features.SupportsNullable, features.StubHasExpressionParameters); - _ = sb.AppendLine(); - - // Generate binding methods - for (var i = 0; i < group.Invocations.Length; i++) - { - var inv = group.Invocations[i]; - var sourceClassInfo = CodeGeneratorHelpers.FindClassInfo(allClasses, inv.SourceTypeFullName); - var suffix = CodeGeneratorHelpers.ComputeStableMethodSuffix( - inv.SourceTypeFullName, - inv.CallerFilePath, - inv.CallerLineNumber, - $"{inv.SourceExpressionText}|{inv.TargetExpressionText}"); - GenerateBindOneWayMethod(sb, inv, sourceClassInfo, suffix); - } - } - - CodeGeneratorHelpers.AppendExtensionClassFooter(sb); - _ = sb.AppendLine(); - - return PooledBuilder.ToStringAndReturn(sb); - } + in LanguageFeatures features) => + BindingEmitterHelpers.Generate( + invocations, + allClasses, + features, + static (sb, group, f) => GenerateConcreteOverload( + sb, + group, + f.SupportsCallerArgExpr, + f.SupportsNullable, + f.StubHasExpressionParameters), + static (sb, ctx) => GenerateBindOneWayMethod(sb, ctx.Invocation, ctx.SourceClassInfo, ctx.Suffix)); /// Groups binding invocation information by a unique type signature, producing a collection of grouped results. /// The collection of binding invocation details to be grouped. /// A list of grouped binding type information, where each group shares the same type signature. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static List GroupByTypeSignature(ImmutableArray invocations) => BindingEmitterHelpers.GroupByTypeSignature(invocations); @@ -294,18 +267,21 @@ internal static void GenerateBindOneWayMethod( /// Appends extra parameters (converter, scheduler) to the concrete overload signature. /// The string builder to append to. /// The binding type group. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void AppendExtraParameters(StringBuilder sb, BindingTypeGroup group) => BindingEmitterHelpers.AppendExtraParameters(sb, group, ConversionParameterName); /// Formats extra arguments (converter, scheduler) for forwarding to the binding method. /// The binding type group. /// Extra arguments string like ", conversionFunc, scheduler" or empty. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string FormatExtraArgs(BindingTypeGroup group) => BindingEmitterHelpers.FormatExtraArgs(group, ConversionParameterName); /// Formats extra method parameters for the private binding method signature. /// The binding invocation info. /// Extra parameters string like ", Func<int, string> conversionFunc, ISequencer scheduler" or empty. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string FormatExtraMethodParams(BindingInvocationInfo inv) => BindingEmitterHelpers.FormatExtraMethodParams(inv, ConversionParameterName); diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindToCodeGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindToCodeGenerator.cs index 8ab3b992..a88551ed 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindToCodeGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindToCodeGenerator.cs @@ -292,13 +292,10 @@ internal static void GenerateBindToMethod(StringBuilder sb, BindToInvocationInfo } else { - var hintArg = inv.HasConversionHint ? "conversionHint" : "null"; - var converterArg = inv.HasConverterOverride ? "converterOverride" : "null"; - _ = sb.AppendLine($$""" return {{RxBindingExtensions}}.Subscribe(source, value => { - if ({{RuntimeBindingConverter}}.TryConvert<{{inv.SourceValueTypeFullName}}, {{inv.TargetPropertyTypeFullName}}>(value, {{hintArg}}, {{converterArg}}, out var __converted)) + if ({{RuntimeBindingConverter}}.TryConvert<{{inv.SourceValueTypeFullName}}, {{inv.TargetPropertyTypeFullName}}>(value, {{FormatConversionArguments(inv)}}, out var __converted)) { {{targetAccess}} = __converted; } @@ -365,6 +362,12 @@ internal static string FormatExtraMethodParams(BindToInvocationInfo inv) return sb.ToStringAndReturn(); } + /// Formats the conversion-hint and converter-override arguments handed to the runtime converter. + /// The invocation info. + /// The two arguments, comma separated. + private static string FormatConversionArguments(BindToInvocationInfo inv) => + $"{(inv.HasConversionHint ? "conversionHint" : "null")}, {(inv.HasConverterOverride ? "converterOverride" : "null")}"; + /// Groups BindTo invocations sharing source value type, target type, target property type, and overload shape. /// The fully qualified observable value type. /// The fully qualified target object type. diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindTwoWayCodeGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindTwoWayCodeGenerator.cs index f43f1b39..e2251f59 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindTwoWayCodeGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindTwoWayCodeGenerator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Immutable; +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; using static ReactiveUI.Binding.SourceGenerators.CodeGeneration.GeneratedTypeNames; @@ -32,56 +33,32 @@ internal static class BindTwoWayCodeGenerator /// All detected class binding info. /// The consumer compilation's C# language-feature snapshot (dispatch strategy and nullable support). /// Generated source code string, or null if no invocations. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string? Generate( ImmutableArray invocations, ImmutableArray allClasses, - in LanguageFeatures features) - { - if (invocations.IsDefaultOrEmpty) - { - return null; - } - - var sb = PooledBuilder.Rent(invocations.Length * CodeGeneratorHelpers.PerInvocationBufferCapacity); - var supportsCallerArgExpr = features.SupportsCallerArgExpr; - CodeGeneratorHelpers.AppendExtensionClassHeader(sb, features); - _ = sb.AppendLine(); - - // Group invocations by (SourceType, TargetType, SourcePropertyType, TargetPropertyType, HasConversion, HasScheduler) - var groups = GroupByTypeSignature(invocations); - - for (var g = 0; g < groups.Count; g++) - { - var group = groups[g]; - - // Generate the concrete typed extension method overload - GenerateConcreteOverload(sb, group, supportsCallerArgExpr, features.SupportsNullable, features.StubHasExpressionParameters); - _ = sb.AppendLine(); - - // Generate binding methods - for (var i = 0; i < group.Invocations.Length; i++) - { - var inv = group.Invocations[i]; - var sourceClassInfo = CodeGeneratorHelpers.FindClassInfo(allClasses, inv.SourceTypeFullName); - var targetClassInfo = CodeGeneratorHelpers.FindClassInfo(allClasses, inv.TargetTypeFullName); - var suffix = CodeGeneratorHelpers.ComputeStableMethodSuffix( - inv.SourceTypeFullName, - inv.CallerFilePath, - inv.CallerLineNumber, - $"{inv.SourceExpressionText}|{inv.TargetExpressionText}"); - GenerateBindTwoWayMethod(sb, inv, sourceClassInfo, targetClassInfo, suffix); - } - } - - CodeGeneratorHelpers.AppendExtensionClassFooter(sb); - _ = sb.AppendLine(); - - return PooledBuilder.ToStringAndReturn(sb); - } + in LanguageFeatures features) => + BindingEmitterHelpers.Generate( + invocations, + allClasses, + features, + static (sb, group, f) => GenerateConcreteOverload( + sb, + group, + f.SupportsCallerArgExpr, + f.SupportsNullable, + f.StubHasExpressionParameters), + static (sb, ctx) => GenerateBindTwoWayMethod( + sb, + ctx.Invocation, + ctx.SourceClassInfo, + ctx.TargetClassInfo, + ctx.Suffix)); /// Groups BindTwoWay invocations by their type signature for overload generation. /// The BindTwoWay invocations to group. /// A list of grouped invocations sharing the same type signature. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static List GroupByTypeSignature(ImmutableArray invocations) => BindingEmitterHelpers.GroupByTypeSignature(invocations); @@ -298,18 +275,21 @@ internal static void GenerateBindTwoWayMethod( /// Appends extra parameters (converters, scheduler) to the concrete overload signature. /// The string builder to append to. /// The binding type group. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void AppendExtraParameters(StringBuilder sb, BindingTypeGroup group) => BindingEmitterHelpers.AppendTwoWayExtraParameters(sb, group, ForwardConverterName, ReverseConverterName); /// Formats extra arguments (converters, scheduler) for forwarding to the binding method. /// The binding type group. /// Extra arguments string like ", sourceToTargetConv, targetToSourceConv, scheduler" or empty. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string FormatExtraArgs(BindingTypeGroup group) => BindingEmitterHelpers.FormatTwoWayExtraArgs(group, ForwardConverterName, ReverseConverterName); /// Formats extra method parameters for the private binding method signature. /// The binding invocation info. /// Extra parameters string for two-way converter and scheduler parameters. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string FormatExtraMethodParams(BindingInvocationInfo inv) => BindingEmitterHelpers.FormatTwoWayExtraMethodParams(inv, ForwardConverterName, ReverseConverterName); diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindingEmitterHelpers.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindingEmitterHelpers.cs index dc4ba3ba..116314b1 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindingEmitterHelpers.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindingEmitterHelpers.cs @@ -23,6 +23,68 @@ internal static class BindingEmitterHelpers /// Opens a delegate parameter, ready for the two type arguments and the parameter name. private const string FuncParameterPrefix = ", global::System.Func<"; + /// + /// Emits a whole binding dispatch file: the extension class, one concrete overload per group of + /// call sites, and one binding method per call site. + /// + /// The detected call sites for this API. + /// All detected class binding info. + /// The consumer compilation's language-feature snapshot. + /// Emits the concrete typed overload for one group. + /// Emits the binding method for one call site. + /// The generated source, or null when there are no call sites. + internal static string? Generate( + ImmutableArray invocations, + ImmutableArray allClasses, + in LanguageFeatures features, + Action emitOverload, + Action emitMethod) + { + if (invocations.IsDefaultOrEmpty) + { + return null; + } + + var snapshot = features; + var sb = PooledBuilder.Rent(invocations.Length * CodeGeneratorHelpers.PerInvocationBufferCapacity); + CodeGeneratorHelpers.AppendExtensionClassHeader(sb, snapshot); + _ = sb.AppendLine(); + + var groups = GroupByTypeSignature(invocations); + + for (var g = 0; g < groups.Count; g++) + { + var group = groups[g]; + + emitOverload(sb, group, snapshot); + _ = sb.AppendLine(); + + for (var i = 0; i < group.Invocations.Length; i++) + { + var inv = group.Invocations[i]; + var suffix = CodeGeneratorHelpers.ComputeStableMethodSuffix( + inv.SourceTypeFullName, + inv.CallerFilePath, + inv.CallerLineNumber, + $"{inv.SourceExpressionText}|{inv.TargetExpressionText}"); + + emitMethod( + sb, + new( + inv, + CodeGeneratorHelpers.FindClassInfo(allClasses, inv.SourceTypeFullName), + CodeGeneratorHelpers.FindClassInfo(allClasses, inv.TargetTypeFullName), + suffix, + snapshot)); + } + } + + CodeGeneratorHelpers.AppendExtensionClassFooter(sb); + _ = sb.AppendLine(); + + return PooledBuilder.ToStringAndReturn(sb); + } + /// Groups call sites that can share one generated overload. /// The detected call sites. /// The groups, in the order their signatures were first seen. @@ -237,4 +299,17 @@ internal static string FormatExtraMethodParams(BindingInvocationInfo inv, string return sb.ToStringAndReturn(); } + + /// Everything a per-call-site binding emitter needs about one resolved call site. + /// The call site being emitted. + /// The source type's binding info, when it was detected. + /// The target type's binding info, when it was detected. + /// The stable method-name suffix for this call site. + /// The consumer compilation's language-feature snapshot. + internal readonly record struct BindEmitContext( + BindingInvocationInfo Invocation, + ClassBindingInfo? SourceClassInfo, + ClassBindingInfo? TargetClassInfo, + string Suffix, + LanguageFeatures Features); } diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindingTypeGroup.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindingTypeGroup.cs index d8bc6cc9..942c3140 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindingTypeGroup.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/BindingTypeGroup.cs @@ -7,11 +7,6 @@ namespace ReactiveUI.Binding.SourceGenerators.CodeGeneration; /// The call sites that share one generated property-binding overload. -/// -/// BindOneWay, BindTwoWay, OneWayBind and Bind differ in argument order, parameter -/// names and direction, but they all group their call sites by the same signature: the two types, the two -/// property types, and whether a conversion and a scheduler are present. One record serves all four. -/// /// The type the value is read from. /// The type the value is written to. /// The source property's type. @@ -19,6 +14,11 @@ namespace ReactiveUI.Binding.SourceGenerators.CodeGeneration; /// Whether the call sites pass a conversion or selector. /// Whether the call sites pass a scheduler. /// The call sites in this group. +/// +/// BindOneWay, BindTwoWay, OneWayBind and Bind differ in argument order, parameter +/// names and direction, but they all group their call sites by the same signature: the two types, the two +/// property types, and whether a conversion and a scheduler are present. One record serves all four. +/// internal sealed record BindingTypeGroup( string SourceTypeFullName, string TargetTypeFullName, diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/CodeGeneratorHelpers.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/CodeGeneratorHelpers.cs index 7474e495..049cae44 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/CodeGeneratorHelpers.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/CodeGeneratorHelpers.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Immutable; +using System.Runtime.CompilerServices; using System.Text; using Microsoft.CodeAnalysis; using ReactiveUI.Binding.SourceGenerators.Models; @@ -82,6 +83,7 @@ internal static string BuildPropertyAccessChain(string root, EquatableArrayThe lambda parameter name. /// The property path segments. /// A dotted access chain like "x.Address.City". + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string BuildPropertyAccessLambda(string param, EquatableArray path) => BuildPropertyAccessChain(param, path); @@ -89,6 +91,7 @@ internal static string BuildPropertyAccessLambda(string param, EquatableArrayThe root variable name. /// The property path segments. /// A dotted access chain suitable for the left side of an assignment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string BuildPropertySetterChain(string root, EquatableArray path) => BuildPropertyAccessChain(root, path); @@ -156,11 +159,13 @@ internal static string EscapeString(string value) for (var i = 0; i < value.Length; i++) { var c = value[i]; - if (c is '\\' or '"') + if (c is not ('\\' or '"')) { - needsEscape = true; - break; + continue; } + + needsEscape = true; + break; } if (!needsEscape) @@ -214,6 +219,7 @@ internal static string NormalizeLambdaText(string expressionText) /// Every generated file goes out through here so no emitter can forget the retargeting, which would only /// show up as generated code that does not compile for consumers of the System.Reactive flavour. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void AddGeneratedSource( in SourceProductionContext context, string hintName, @@ -295,6 +301,7 @@ internal static void AppendGeneratedFileMarkers(StringBuilder sb, bool emitGener /// Appends the closing braces for the extension partial class and namespace. /// The string builder to append to. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void AppendExtensionClassFooter(StringBuilder sb) => sb.Append(""" } diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/ObservationCodeGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/ObservationCodeGenerator.cs index eb1db12e..a2552598 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/ObservationCodeGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/ObservationCodeGenerator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Immutable; +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; using ReactiveUI.Binding.SourceGenerators.Plugins; @@ -444,7 +445,7 @@ internal static void GenerateConcreteOverload( EmitDispatchTable(sb, group, supportsCallerArgExpr, methodPrefix, propCount, hasSelector); - GenerateRuntimeFallback(sb, methodPrefix, propCount, hasSelector); + GenerateRuntimeFallback(sb, methodPrefix); _ = sb.AppendLine(" }"); } @@ -456,13 +457,8 @@ internal static void GenerateConcreteOverload( /// /// The string builder to append to. /// The method name prefix. - /// The number of property expressions (unused, kept for API compatibility). - /// Whether a selector function is present (unused, kept for API compatibility). - internal static void GenerateRuntimeFallback( - StringBuilder sb, - string methodPrefix, - int propCount, - bool hasSelector) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void GenerateRuntimeFallback(StringBuilder sb, string methodPrefix) => sb.AppendLine( $" throw new global::System.InvalidOperationException(\"No generated {methodPrefix} dispatch matched. Ensure the expression is an inline lambda for compile-time optimization.\");"); @@ -945,6 +941,7 @@ private static void EmitInlineDeepChain( /// /// The invocation info. /// The stable, call-site-independent method-name suffix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static string MethodSuffix(InvocationInfo inv) => CodeGeneratorHelpers.ComputeStableMethodSuffix( inv.SourceTypeFullName, @@ -1016,7 +1013,7 @@ private static void EmitCombineLatestTupleProjection(StringBuilder sb, int prope _ = sb.Append(") => ("); for (var i = 0; i < propertyCount; i++) { - _ = sb.Append("property").Append(i + 1).Append(": p").Append(i + 1); + _ = sb.Append("Property").Append(i + 1).Append(": p").Append(i + 1); if (i < propertyCount - 1) { _ = sb.Append(", "); diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/OneWayBindCodeGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/OneWayBindCodeGenerator.cs index c9acb4e9..357d2505 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/OneWayBindCodeGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/OneWayBindCodeGenerator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Immutable; +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; using static ReactiveUI.Binding.SourceGenerators.CodeGeneration.GeneratedTypeNames; @@ -26,52 +27,27 @@ internal static class OneWayBindCodeGenerator /// All detected class binding info. /// The consumer compilation's C# language-feature snapshot (dispatch strategy and nullable support). /// Generated source code string, or null if no invocations. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string? Generate( ImmutableArray invocations, ImmutableArray allClasses, - in LanguageFeatures features) - { - if (invocations.IsDefaultOrEmpty) - { - return null; - } - - var sb = PooledBuilder.Rent(invocations.Length * CodeGeneratorHelpers.PerInvocationBufferCapacity); - var supportsCallerArgExpr = features.SupportsCallerArgExpr; - CodeGeneratorHelpers.AppendExtensionClassHeader(sb, features); - _ = sb.AppendLine(); - - var groups = GroupByTypeSignature(invocations); - - for (var g = 0; g < groups.Count; g++) - { - var group = groups[g]; - - GenerateConcreteOverload(sb, group, supportsCallerArgExpr, features.SupportsNullable, features.StubHasExpressionParameters); - _ = sb.AppendLine(); - - for (var i = 0; i < group.Invocations.Length; i++) - { - var inv = group.Invocations[i]; - var sourceClassInfo = CodeGeneratorHelpers.FindClassInfo(allClasses, inv.SourceTypeFullName); - var suffix = CodeGeneratorHelpers.ComputeStableMethodSuffix( - inv.SourceTypeFullName, - inv.CallerFilePath, - inv.CallerLineNumber, - $"{inv.SourceExpressionText}|{inv.TargetExpressionText}"); - GenerateOneWayBindMethod(sb, inv, sourceClassInfo, suffix); - } - } - - CodeGeneratorHelpers.AppendExtensionClassFooter(sb); - _ = sb.AppendLine(); - - return PooledBuilder.ToStringAndReturn(sb); - } + in LanguageFeatures features) => + BindingEmitterHelpers.Generate( + invocations, + allClasses, + features, + static (sb, group, f) => GenerateConcreteOverload( + sb, + group, + f.SupportsCallerArgExpr, + f.SupportsNullable, + f.StubHasExpressionParameters), + static (sb, ctx) => GenerateOneWayBindMethod(sb, ctx.Invocation, ctx.SourceClassInfo, ctx.Suffix)); /// Groups OneWayBind invocations by their type signature for overload generation. /// The OneWayBind invocations to group. /// A list of grouped invocations sharing the same type signature. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static List GroupByTypeSignature(ImmutableArray invocations) => BindingEmitterHelpers.GroupByTypeSignature(invocations); @@ -288,29 +264,30 @@ internal static void GenerateOneWayBindMethod( /// Appends extra parameters (selector, scheduler) to the concrete overload signature. /// The string builder to append to. /// The binding type group. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void AppendExtraParameters(StringBuilder sb, BindingTypeGroup group) => BindingEmitterHelpers.AppendExtraParameters(sb, group, ConversionParameterName); /// Formats extra arguments (selector, scheduler) for forwarding to the binding method. /// The binding type group. /// Extra arguments string or empty. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string FormatExtraArgs(BindingTypeGroup group) => BindingEmitterHelpers.FormatExtraArgs(group, ConversionParameterName); /// Formats extra method parameters for the private binding method signature. /// The binding invocation info. /// Extra parameters string for selector and scheduler parameters. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string FormatExtraMethodParams(BindingInvocationInfo inv) => BindingEmitterHelpers.FormatExtraMethodParams(inv, ConversionParameterName); /// Formats the return type for a concrete OneWayBind overload. /// The binding type group. /// The fully qualified return type string. - internal static string FormatReturnType(BindingTypeGroup group) - { - var valueType = group.HasConversion ? group.TargetPropertyTypeFullName : group.SourcePropertyTypeFullName; - return $"global::ReactiveUI.Binding.IReactiveBinding<{group.TargetTypeFullName}, {valueType}>"; - } + internal static string FormatReturnType(BindingTypeGroup group) => + $"global::ReactiveUI.Binding.IReactiveBinding<{group.TargetTypeFullName}, " + + $"{(group.HasConversion ? group.TargetPropertyTypeFullName : group.SourcePropertyTypeFullName)}>"; /// Formats the return type for a private OneWayBind method. /// The binding invocation info. diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/PooledStringBuilder.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/PooledStringBuilder.cs index 9c8898e3..60c1bfb5 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/PooledStringBuilder.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/PooledStringBuilder.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.SourceGenerators.CodeGeneration; /// A fluent string builder for short generated fragments, backed by thread-local pooled buffers. @@ -107,6 +109,7 @@ internal PooledStringBuilder Append(char value) /// Matches the framework rendering exactly, because these appends land in the grouping keys that decide /// which invocations share a generated overload. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal PooledStringBuilder Append(bool value) => Append(value ? "True" : "False"); /// Appends the invariant decimal rendering of an integer. @@ -180,13 +183,15 @@ private static char[] RentBuffer(int minimumLength) for (var i = _pooledCount - 1; i >= 0; i--) { var candidate = pool[i]; - if (candidate.Length >= minimumLength) + if (candidate.Length < minimumLength) { - _pooledCount--; - pool[i] = pool[_pooledCount]; - pool[_pooledCount] = null!; - return candidate; + continue; } + + _pooledCount--; + pool[i] = pool[_pooledCount]; + pool[_pooledCount] = null!; + return candidate; } } @@ -233,12 +238,9 @@ private void EnsureCapacity(int required) /// The index the digits start at. private void ReverseDigits(int start) { - var end = _position - 1; - while (start < end) + for (var end = _position - 1; start < end; start++, end--) { (_buffer[end], _buffer[start]) = (_buffer[start], _buffer[end]); - start++; - end--; } } } diff --git a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/WhenAnyCodeGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/WhenAnyCodeGenerator.cs index 1e765539..3abb2352 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/WhenAnyCodeGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/CodeGeneration/WhenAnyCodeGenerator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Immutable; +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -125,7 +126,7 @@ internal static void GenerateConcreteOverload( EmitDispatchTable(sb, group, supportsCallerArgExpr, propCount); // Runtime fallback - GenerateRuntimeFallback(sb, first); + GenerateRuntimeFallback(sb); _ = sb.AppendLine(" }"); } @@ -136,8 +137,8 @@ internal static void GenerateConcreteOverload( /// dispatch indicates a caching issue — never falls back to runtime reflection. /// /// The string builder to append to. - /// The first invocation in the type group (unused, kept for API compatibility). - internal static void GenerateRuntimeFallback(StringBuilder sb, InvocationInfo first) => sb.AppendLine( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void GenerateRuntimeFallback(StringBuilder sb) => sb.AppendLine( " throw new global::System.InvalidOperationException(\"No generated WhenAny dispatch matched. Ensure the expression is an inline lambda for compile-time optimization.\");"); /// diff --git a/src/ReactiveUI.Binding.SourceGenerators/Generators/ViewLocatorDispatchGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/Generators/ViewLocatorDispatchGenerator.cs index 74f79b55..c07ddb80 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Generators/ViewLocatorDispatchGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Generators/ViewLocatorDispatchGenerator.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Immutable; +using System.Runtime.CompilerServices; using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -152,6 +153,7 @@ private static void EmitFileHeader(StringBuilder sb, in LanguageFeatures feature /// /// The string builder to write to. /// The nullable annotation to emit, or an empty string when unsupported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitRegistrationHook(StringBuilder sb, string nullable) => sb.AppendLine().Append($$""" /// @@ -315,18 +317,20 @@ private static void EmitGroupedDispatch( { var idx = indices[j]; var reg = registrations[idx]; - if (reg.Contract is not null) + if (reg.Contract is null) { - var escapedLiteral = SymbolDisplay.FormatLiteral(reg.Contract, true); - var resolverMethodName = ResolverMethodNamePrefix + idx; - _ = sb.AppendLine().Append($$""" - // -> {{reg.ViewFullyQualifiedName}} [contract: {{escapedLiteral}}] - if (contract == {{escapedLiteral}}) - { - return {{resolverMethodName}}(contract); - } - """); + continue; } + + var escapedLiteral = SymbolDisplay.FormatLiteral(reg.Contract, true); + var resolverMethodName = ResolverMethodNamePrefix + idx; + _ = sb.AppendLine().Append($$""" + // -> {{reg.ViewFullyQualifiedName}} [contract: {{escapedLiteral}}] + if (contract == {{escapedLiteral}}) + { + return {{resolverMethodName}}(contract); + } + """); } // Default (no-contract) branch last @@ -334,15 +338,17 @@ private static void EmitGroupedDispatch( { var idx = indices[j]; var reg = registrations[idx]; - if (reg.Contract is null) + if (reg.Contract is not null) { - var resolverMethodName = ResolverMethodNamePrefix + idx; - _ = sb.AppendLine().Append($$""" - // -> {{reg.ViewFullyQualifiedName}} (default) - return {{resolverMethodName}}(contract); - """); - break; // Only one default per VM (deduplicated earlier) + continue; } + + var resolverMethodName = ResolverMethodNamePrefix + idx; + _ = sb.AppendLine().Append($$""" + // -> {{reg.ViewFullyQualifiedName}} (default) + return {{resolverMethodName}}(contract); + """); + break; // Only one default per VM (deduplicated earlier) } _ = sb.AppendLine().Append(""" diff --git a/src/ReactiveUI.Binding.SourceGenerators/Helpers/CommandExtractor.cs b/src/ReactiveUI.Binding.SourceGenerators/Helpers/CommandExtractor.cs index 8989a187..e9c60a8a 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Helpers/CommandExtractor.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Helpers/CommandExtractor.cs @@ -74,7 +74,7 @@ internal static class CommandExtractor var parameterOverload = DetectParameterOverload(methodSymbol, args, semanticModel, ct); var (resolvedEventName, resolvedEventArgsTypeFullName, capabilities) = - ResolveControlBinding(methodSymbol, args, controlPropertyPath, controlPropertyArg, semanticModel, ct); + ResolveControlBinding(methodSymbol, args, controlPropertyArg, semanticModel, ct); return new( invocation.SyntaxTree.FilePath, @@ -228,13 +228,52 @@ internal static bool IsToEventArgument( return nameColon is not null ? nameColon.Name.Identifier.Text == "toEvent" : argumentIndex == parameterIndex; } + /// Resolves an explicit toEvent event name from the invocation arguments, if present. + /// The resolved method symbol. + /// The invocation argument list. + /// The semantic model. + /// Cancellation token. + /// The explicit event name, or null when none is supplied. + internal static string? ResolveExplicitEventName( + IMethodSymbol methodSymbol, + SeparatedSyntaxList args, + SemanticModel semanticModel, + CancellationToken ct) + { + for (var i = 0; i < methodSymbol.Parameters.Length; i++) + { + if (methodSymbol.Parameters[i].Name != "toEvent") + { + continue; + } + + // Find matching argument + for (var a = 0; a < args.Count; a++) + { + if (!IsToEventArgument(args[a], a, i)) + { + continue; + } + + var constant = semanticModel.GetConstantValue(args[a].Expression, ct); + return constant is { HasValue: true, Value: string eventName } && !string.IsNullOrEmpty(eventName) + ? eventName + : null; + } + + return null; + } + + return null; + } + /// Resolves the view and view model types the invocation binds between. /// The member access the invocation hangs off. /// The invocation arguments. /// The semantic model. /// Cancellation token. /// The fully qualified view and view model type names. - private static (string ViewTypeFullName, string ViewModelTypeFullName) ResolveBindCommandSides( + internal static (string ViewTypeFullName, string ViewModelTypeFullName) ResolveBindCommandSides( MemberAccessExpressionSyntax memberAccess, SeparatedSyntaxList args, SemanticModel semanticModel, @@ -257,26 +296,20 @@ private static (string ViewTypeFullName, string ViewModelTypeFullName) ResolveBi /// /// The resolved BindCommand method. /// The invocation arguments. - /// The property path to the bound control. /// The control selector expression. /// The semantic model. /// Cancellation token. /// The event name, its argument type, and the control's binding capabilities. - private static (string? EventName, string? EventArgsTypeFullName, ControlCapabilities Capabilities) ResolveControlBinding( + internal static (string? EventName, string? EventArgsTypeFullName, ControlCapabilities Capabilities) ResolveControlBinding( IMethodSymbol methodSymbol, SeparatedSyntaxList args, - PropertyPathSegment[] controlPropertyPath, ExpressionSyntax controlPropertyArg, SemanticModel semanticModel, CancellationToken ct) { var resolvedEventName = ResolveExplicitEventName(methodSymbol, args, semanticModel, ct); - var controlLeafType = SymbolHelpers.ResolveNamedType( - controlPropertyPath[^1], - semanticModel, - controlPropertyArg, - ct); + var controlLeafType = SymbolHelpers.ResolveNamedType(semanticModel, controlPropertyArg, ct); var resolvedEventArgsTypeFullName = ResolveEventArgsTypeFullName(controlLeafType, ref resolvedEventName); @@ -286,7 +319,7 @@ private static (string? EventName, string? EventArgsTypeFullName, ControlCapabil /// Determines whether a property is a settable public instance Command property typed as ICommand. /// The property to inspect. /// if the property is a settable ICommand-typed Command property. - private static bool IsSettableICommandProperty(IPropertySymbol property) + internal static bool IsSettableICommandProperty(IPropertySymbol property) { if (property.Name != "Command" || property.IsReadOnly || property.IsStatic || property.DeclaredAccessibility != Accessibility.Public) @@ -301,7 +334,7 @@ private static bool IsSettableICommandProperty(IPropertySymbol property) /// Determines whether a property is a settable public instance CommandParameter property. /// The property to inspect. /// if the property is a settable CommandParameter property. - private static bool IsSettableCommandParameterProperty(IPropertySymbol property) => + internal static bool IsSettableCommandParameterProperty(IPropertySymbol property) => property.Name == "CommandParameter" && !property.IsReadOnly && !property.IsStatic && property.DeclaredAccessibility == Accessibility.Public; @@ -315,7 +348,7 @@ private static bool IsSettableCommandParameterProperty(IPropertySymbol property) /// The semantic model. /// Cancellation token. /// The detected parameter overload information. - private static ParameterOverloadInfo DetectParameterOverload( + internal static ParameterOverloadInfo DetectParameterOverload( IMethodSymbol methodSymbol, SeparatedSyntaxList args, SemanticModel semanticModel, @@ -362,41 +395,6 @@ private static ParameterOverloadInfo DetectParameterOverload( return result; } - /// Resolves an explicit toEvent event name from the invocation arguments, if present. - /// The resolved method symbol. - /// The invocation argument list. - /// The semantic model. - /// Cancellation token. - /// The explicit event name, or null when none is supplied. - private static string? ResolveExplicitEventName( - IMethodSymbol methodSymbol, - SeparatedSyntaxList args, - SemanticModel semanticModel, - CancellationToken ct) - { - for (var i = 0; i < methodSymbol.Parameters.Length; i++) - { - if (methodSymbol.Parameters[i].Name != "toEvent") - { - continue; - } - - // Find matching argument - for (var a = 0; a < args.Count; a++) - { - if (IsToEventArgument(args[a], a, i)) - { - var constant = semanticModel.GetConstantValue(args[a].Expression, ct); - return constant is { HasValue: true, Value: string eventName } && !string.IsNullOrEmpty(eventName) ? eventName : null; - } - } - - return null; - } - - return null; - } - /// /// Resolves the event args type for the control. When no explicit event name was supplied, /// resolves the control's default event (updating ); @@ -405,7 +403,7 @@ private static ParameterOverloadInfo DetectParameterOverload( /// The resolved control leaf type, or null. /// The explicit event name (updated to the default event when null). /// The fully qualified event args type name, or null. - private static string? ResolveEventArgsTypeFullName( + internal static string? ResolveEventArgsTypeFullName( INamedTypeSymbol? controlLeafType, ref string? resolvedEventName) { @@ -428,7 +426,7 @@ private static ParameterOverloadInfo DetectParameterOverload( /// Detects command/command-parameter/enabled property capabilities on the control leaf type. /// The resolved control leaf type, or null. /// The detected control capabilities (all false when is null). - private static ControlCapabilities DetectControlCapabilities(INamedTypeSymbol? controlLeafType) + internal static ControlCapabilities DetectControlCapabilities(INamedTypeSymbol? controlLeafType) { if (controlLeafType is null) { @@ -444,13 +442,13 @@ private static ControlCapabilities DetectControlCapabilities(INamedTypeSymbol? c /// Whether the control exposes a settable ICommand property. /// Whether the control exposes a settable command-parameter property. /// Whether the control exposes a settable enabled property. - private readonly record struct ControlCapabilities( + internal readonly record struct ControlCapabilities( bool HasCommand, bool HasCommandParameter, bool HasEnabled); /// Holds the detected withParameter overload information for a BindCommand invocation. - private sealed class ParameterOverloadInfo + internal sealed class ParameterOverloadInfo { /// Gets or sets a value indicating whether the overload has an IObservable withParameter. public bool HasObservableParameter { get; set; } diff --git a/src/ReactiveUI.Binding.SourceGenerators/Helpers/EventHelpers.cs b/src/ReactiveUI.Binding.SourceGenerators/Helpers/EventHelpers.cs index d2be35aa..51f996a7 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Helpers/EventHelpers.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Helpers/EventHelpers.cs @@ -21,11 +21,13 @@ internal static class EventHelpers for (var i = 0; i < defaultEvents.Length; i++) { var argsType = FindEventArgsType(controlType, defaultEvents[i]); - if (argsType is not null) + if (argsType is null) { - eventArgsType = argsType; - return defaultEvents[i]; + continue; } + + eventArgsType = argsType; + return defaultEvents[i]; } return null; diff --git a/src/ReactiveUI.Binding.SourceGenerators/Helpers/InteractionExtractor.cs b/src/ReactiveUI.Binding.SourceGenerators/Helpers/InteractionExtractor.cs index b0675e1d..74a613c6 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Helpers/InteractionExtractor.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Helpers/InteractionExtractor.cs @@ -158,15 +158,17 @@ private static bool DetermineHandlerVariant(IMethodSymbol methodSymbol, out stri var param = methodSymbol.Parameters[i]; // Observable handler: Func, IObservable> - if (param is { Name: "handler", Type: INamedTypeSymbol handlerType } - && handlerType.TypeArguments.Length == 2 - && handlerType.TypeArguments[1] is INamedTypeSymbol returnType - && SymbolHelpers.IsIObservable(returnType)) + if (param is not { Name: "handler", Type: INamedTypeSymbol handlerType } + || handlerType.TypeArguments.Length != 2 + || handlerType.TypeArguments[1] is not INamedTypeSymbol returnType + || !SymbolHelpers.IsIObservable(returnType)) { - dontCareTypeFullName = returnType.TypeArguments[0] - .ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); - return false; + continue; } + + dontCareTypeFullName = returnType.TypeArguments[0] + .ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + return false; } return true; diff --git a/src/ReactiveUI.Binding.SourceGenerators/Helpers/ObservationExtractor.cs b/src/ReactiveUI.Binding.SourceGenerators/Helpers/ObservationExtractor.cs index 859bd919..62d729a0 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Helpers/ObservationExtractor.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Helpers/ObservationExtractor.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using ReactiveUI.Binding.SourceGenerators.Models; @@ -15,6 +16,7 @@ internal static class ObservationExtractor /// The generator syntax context. /// Cancellation token. /// An InvocationInfo POCO, or null if the invocation is not analyzable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static InvocationInfo? ExtractWhenChangedInvocation(GeneratorSyntaxContext context, CancellationToken ct) => ExtractInvocationInfo(context, false, Constants.WhenChangedMethodName, ct); @@ -22,6 +24,7 @@ internal static class ObservationExtractor /// The generator syntax context. /// Cancellation token. /// An InvocationInfo POCO, or null if the invocation is not analyzable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static InvocationInfo? ExtractWhenChangingInvocation(GeneratorSyntaxContext context, CancellationToken ct) => ExtractInvocationInfo(context, true, Constants.WhenChangingMethodName, ct); @@ -29,6 +32,7 @@ internal static class ObservationExtractor /// The generator syntax context. /// Cancellation token. /// An InvocationInfo POCO, or null if the invocation is not analyzable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static InvocationInfo? ExtractWhenAnyValueInvocation(GeneratorSyntaxContext context, CancellationToken ct) => ExtractInvocationInfo(context, false, Constants.WhenAnyValueMethodName, ct); @@ -36,6 +40,7 @@ internal static class ObservationExtractor /// The generator syntax context. /// Cancellation token. /// An InvocationInfo POCO, or null if the invocation is not analyzable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static InvocationInfo? ExtractWhenAnyInvocation(GeneratorSyntaxContext context, CancellationToken ct) => ExtractInvocationInfo(context, false, Constants.WhenAnyMethodName, ct); diff --git a/src/ReactiveUI.Binding.SourceGenerators/Helpers/SymbolHelpers.cs b/src/ReactiveUI.Binding.SourceGenerators/Helpers/SymbolHelpers.cs index 8cbd7d18..86cde76b 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Helpers/SymbolHelpers.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Helpers/SymbolHelpers.cs @@ -19,6 +19,7 @@ internal static class SymbolHelpers /// Gets the well-known symbols for a compilation. /// The compilation. /// The well-known symbols box. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static WellKnownSymbolsBox GetWellKnownSymbols(Compilation compilation) => SymbolCache.GetValue( compilation, @@ -31,7 +32,7 @@ internal static WellKnownSymbolsBox GetWellKnownSymbols(Compilation compilation) WinUIDependencyObject = c.GetTypeByMetadataName(Constants.WinUIDependencyObjectMetadataName), NSObject = c.GetTypeByMetadataName(Constants.NSObjectMetadataName), WinFormsComponent = c.GetTypeByMetadataName(Constants.WinFormsComponentMetadataName), - AndroidView = c.GetTypeByMetadataName(Constants.AndroidViewMetadataName) + AndroidView = c.GetTypeByMetadataName(Constants.AndroidViewMetadataName), }); /// @@ -121,12 +122,14 @@ internal static bool ExtractInteractionTypeArguments(ITypeSymbol type, out strin for (var i = 0; i < namedType.AllInterfaces.Length; i++) { var iface = namedType.AllInterfaces[i]; - if (IsInteractionType(iface)) + if (!IsInteractionType(iface)) { - inputType = iface.TypeArguments[0].ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); - outputType = iface.TypeArguments[1].ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); - return true; + continue; } + + inputType = iface.TypeArguments[0].ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + outputType = iface.TypeArguments[1].ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + return true; } return false; @@ -149,13 +152,11 @@ parameter.Name is "converter" or "sourceToTargetConverter" or "vmToViewConverter .EndsWith("IBindingTypeConverter", StringComparison.Ordinal); /// Resolves a PropertyPathSegment leaf type to its INamedTypeSymbol using the semantic model. - /// The property path segment. /// The semantic model. /// The lambda expression. /// Cancellation token. /// The resolved named type symbol, or null if it could not be resolved. internal static INamedTypeSymbol? ResolveNamedType( - Models.PropertyPathSegment segment, SemanticModel semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax lambdaExpression, CancellationToken ct) diff --git a/src/ReactiveUI.Binding.SourceGenerators/Helpers/SyntaxHelpers.cs b/src/ReactiveUI.Binding.SourceGenerators/Helpers/SyntaxHelpers.cs index df0f023d..ef1a869f 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Helpers/SyntaxHelpers.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Helpers/SyntaxHelpers.cs @@ -82,20 +82,11 @@ internal static class SyntaxHelpers } /// Extracts the body expression from a . - /// Handles both and . /// The lambda expression. /// The body as an , or null if the body is a block or unsupported form. [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static ExpressionSyntax? GetLambdaBody(LambdaExpressionSyntax lambda) - { - if (lambda is SimpleLambdaExpressionSyntax simple) - { - return simple.Body as ExpressionSyntax; - } - - var parenthesized = (ParenthesizedLambdaExpressionSyntax)lambda; - return parenthesized.Body as ExpressionSyntax; - } + internal static ExpressionSyntax? GetLambdaBody(LambdaExpressionSyntax lambda) => + lambda.Body as ExpressionSyntax; /// /// Unwraps null-forgiving operators (!) from an expression. diff --git a/src/ReactiveUI.Binding.SourceGenerators/Helpers/TypeDetectionExtractor.cs b/src/ReactiveUI.Binding.SourceGenerators/Helpers/TypeDetectionExtractor.cs index 1eef1ad9..d08cc0c0 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Helpers/TypeDetectionExtractor.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Helpers/TypeDetectionExtractor.cs @@ -91,12 +91,14 @@ internal static EquatableArray ExtractProperties( var isDependencyProperty = false; for (var j = 0; j < members.Length; j++) { - if (members[j] is IFieldSymbol { IsStatic: true } field - && field.Name == $"{property.Name}Property") + if (members[j] is not IFieldSymbol { IsStatic: true } field + || field.Name != $"{property.Name}Property") { - isDependencyProperty = true; - break; + continue; } + + isDependencyProperty = true; + break; } properties.Add(new( diff --git a/src/ReactiveUI.Binding.SourceGenerators/Helpers/ViewRegistrationExtractor.cs b/src/ReactiveUI.Binding.SourceGenerators/Helpers/ViewRegistrationExtractor.cs index 6adebfab..96c2e596 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Helpers/ViewRegistrationExtractor.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Helpers/ViewRegistrationExtractor.cs @@ -37,34 +37,36 @@ internal static class ViewRegistrationExtractor ct.ThrowIfCancellationRequested(); var iface = allInterfaces[i]; - if (viewForGenericInterface is not null - && iface.IsGenericType - && SymbolEqualityComparer.Default.Equals(iface.OriginalDefinition, viewForGenericInterface) - && iface.TypeArguments.Length == 1) + if (viewForGenericInterface is null + || !iface.IsGenericType + || !SymbolEqualityComparer.Default.Equals(iface.OriginalDefinition, viewForGenericInterface) + || iface.TypeArguments.Length != 1) { - // Check [ExcludeFromViewRegistration] only after confirming IViewFor is - // resolvable, so attribute resolution via EnsureNotNull cannot throw in - // compilations that don't reference ReactiveUI.Binding. - if (HasAttribute( - typeSymbol, - Constants.ExcludeFromViewRegistrationAttributeMetadataName, - semanticModel.Compilation)) - { - return null; - } - - var viewModelType = iface.TypeArguments[0]; - var viewModelFqn = viewModelType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); - var viewFqn = typeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); - var hasParameterlessCtor = HasAccessibleParameterlessConstructor(typeSymbol); - var contract = ExtractViewContract(typeSymbol, semanticModel.Compilation); - var isSingleInstance = HasAttribute( - typeSymbol, - Constants.SingleInstanceViewAttributeMetadataName, - semanticModel.Compilation); - - return new(viewModelFqn, viewFqn, hasParameterlessCtor, contract, isSingleInstance); + continue; } + + // Check [ExcludeFromViewRegistration] only after confirming IViewFor is + // resolvable, so attribute resolution via EnsureNotNull cannot throw in + // compilations that don't reference ReactiveUI.Binding. + if (HasAttribute( + typeSymbol, + Constants.ExcludeFromViewRegistrationAttributeMetadataName, + semanticModel.Compilation)) + { + return null; + } + + var viewModelType = iface.TypeArguments[0]; + var viewModelFqn = viewModelType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + var viewFqn = typeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + var hasParameterlessCtor = HasAccessibleParameterlessConstructor(typeSymbol); + var contract = ExtractViewContract(typeSymbol, semanticModel.Compilation); + var isSingleInstance = HasAttribute( + typeSymbol, + Constants.SingleInstanceViewAttributeMetadataName, + semanticModel.Compilation); + + return new(viewModelFqn, viewFqn, hasParameterlessCtor, contract, isSingleInstance); } return null; diff --git a/src/ReactiveUI.Binding.SourceGenerators/Helpers/WhenAnyObservableExtractor.cs b/src/ReactiveUI.Binding.SourceGenerators/Helpers/WhenAnyObservableExtractor.cs index d675c937..e90a7f67 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Helpers/WhenAnyObservableExtractor.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Helpers/WhenAnyObservableExtractor.cs @@ -40,9 +40,8 @@ internal static class WhenAnyObservableExtractor return null; } - var args = invocation.ArgumentList.Arguments; var (propertyPaths, expressionTexts, innerObservableTypes, hasSelector) = - CollectObservableArguments(methodSymbol, args, semanticModel, ct); + CollectObservableArguments(methodSymbol, invocation.ArgumentList.Arguments, semanticModel, ct); if (propertyPaths.Count == 0) { @@ -55,7 +54,7 @@ internal static class WhenAnyObservableExtractor "source type display name"); // Compute return type - string returnTypeFullName = hasSelector + var returnTypeFullName = hasSelector ? ExtractorValidation.FindSelectorReturnType( methodSymbol.Parameters, "selector")! diff --git a/src/ReactiveUI.Binding.SourceGenerators/Invocations/BindToInvocationGenerator.cs b/src/ReactiveUI.Binding.SourceGenerators/Invocations/BindToInvocationGenerator.cs index f54693c3..8aaa1fcb 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Invocations/BindToInvocationGenerator.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Invocations/BindToInvocationGenerator.cs @@ -14,12 +14,10 @@ internal static class BindToInvocationGenerator /// Registers the BindTo invocation detection pipeline. /// The generator initialization context. /// The detected invocations of this API. - /// The shared type detection pipeline (unused; kept for signature consistency). /// The consumer compilation's C# language-feature snapshot. internal static void Register( in IncrementalGeneratorInitializationContext context, IncrementalValuesProvider invocations, - IncrementalValuesProvider allClasses, IncrementalValueProvider languageFeatures) { var combined = invocations.Collect().Combine(languageFeatures); diff --git a/src/ReactiveUI.Binding.SourceGenerators/Models/EquatableArray.cs b/src/ReactiveUI.Binding.SourceGenerators/Models/EquatableArray.cs index 0fa3464f..7deca911 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Models/EquatableArray.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Models/EquatableArray.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections; +using System.Runtime.CompilerServices; namespace ReactiveUI.Binding.SourceGenerators.Models; @@ -42,6 +43,7 @@ public EquatableArray(T[] array) /// The first array to compare. /// The second array to compare. /// true if the arrays are equal; otherwise, false. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(EquatableArray left, EquatableArray right) => left.Equals(right); /// Determines whether two arrays are not equal. @@ -92,10 +94,12 @@ public bool Equals(EquatableArray other) /// Returns an enumerator that iterates through the array. /// An enumerator for the array. - public IEnumerator GetEnumerator() => ((_array ?? []) as IEnumerable).GetEnumerator(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public IEnumerator GetEnumerator() => ((IEnumerable)(_array ?? [])).GetEnumerator(); /// Returns an enumerator that iterates through the array. /// An enumerator for the array. + [MethodImpl(MethodImplOptions.AggressiveInlining)] IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); /// Computes a deterministic hash code for the given array. diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/CommandPropertyBindingPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/CommandPropertyBindingPlugin.cs index 4b973133..3565d534 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/CommandPropertyBindingPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/CommandPropertyBindingPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.CodeGeneration; using ReactiveUI.Binding.SourceGenerators.Models; @@ -32,6 +33,7 @@ internal sealed class CommandPropertyBindingPlugin : ICommandBindingPlugin public bool RequiresCustomBinderFallback => false; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool CanHandle(BindCommandInvocationInfo inv) => inv.HasCommandProperty; diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/DefaultEventBindingPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/DefaultEventBindingPlugin.cs index 88198a56..2cd83344 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/DefaultEventBindingPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/DefaultEventBindingPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -33,6 +34,7 @@ public bool CanHandle(BindCommandInvocationInfo inv) => inv.ResolvedEventName is not null; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitBinding( StringBuilder sb, BindCommandInvocationInfo inv, @@ -52,6 +54,7 @@ public void EmitBinding( /// The control access chain. /// The event args type. /// There can be a null type. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitWithObservableParameter( StringBuilder sb, BindCommandInvocationInfo inv, @@ -98,6 +101,7 @@ void __Handler({{CommandEventBindingEmitter.SenderType(supportsNullable)}} sende /// The event args type. /// The parameter access chain. /// There can be a null type. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitWithExpressionParameter( StringBuilder sb, BindCommandInvocationInfo inv, @@ -139,6 +143,7 @@ void __Handler({{CommandEventBindingEmitter.SenderType(supportsNullable)}} sende /// The control access chain. /// The event args type. /// There can be a null type. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitWithNoParameter( StringBuilder sb, BindCommandInvocationInfo inv, diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/EventEnabledBindingPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/EventEnabledBindingPlugin.cs index 1715581f..e0f654f1 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/EventEnabledBindingPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/CommandBinding/EventEnabledBindingPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -34,6 +35,7 @@ public bool CanHandle(BindCommandInvocationInfo inv) => inv.ResolvedEventName is not null && inv.HasEnabledProperty; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitBinding( StringBuilder sb, BindCommandInvocationInfo inv, @@ -53,6 +55,7 @@ public void EmitBinding( /// The control access chain. /// The event args type. /// There can be a null type. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitWithObservableParameter( StringBuilder sb, BindCommandInvocationInfo inv, @@ -109,6 +112,7 @@ void __Handler({{CommandEventBindingEmitter.SenderType(supportsNullable)}} sende /// The event args type. /// The parameter access chain. /// There can be a null type. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitWithExpressionParameter( StringBuilder sb, BindCommandInvocationInfo inv, @@ -159,6 +163,7 @@ void __Handler({{CommandEventBindingEmitter.SenderType(supportsNullable)}} sende /// The control access chain. /// The event args type. /// There can be a null type. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitWithNoParameter( StringBuilder sb, BindCommandInvocationInfo inv, diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/NullParentObservationBehavior.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/NullParentObservationBehavior.cs index 45619e23..7e61f7c8 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/NullParentObservationBehavior.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/NullParentObservationBehavior.cs @@ -8,8 +8,8 @@ namespace ReactiveUI.Binding.SourceGenerators.Plugins; internal enum NullParentObservationBehavior { /// Suppresses values until the parent becomes non-null. - SuppressEmission, + SuppressEmission = 0, /// Emits the leaf type's default value so binding consumers can clear their target. - EmitDefault, + EmitDefault = 1, } diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/AndroidObservationPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/AndroidObservationPlugin.cs index 32912995..bf4e1e03 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/AndroidObservationPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/AndroidObservationPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -49,6 +50,7 @@ internal sealed class AndroidObservationPlugin : IObservationPlugin public bool RequiresHelperClasses => false; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IsAMatch(ClassBindingInfo classInfo) => classInfo.InheritsAndroidView; @@ -59,6 +61,7 @@ public void EmitHelperClasses(StringBuilder sb) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitShallowObservation( StringBuilder sb, string rootVar, @@ -66,13 +69,13 @@ public void EmitShallowObservation( string castTypeName, bool isBeforeChange, bool includeStartWith) => - // Android View does not implement INPC. Emit ReturnObservable as POCO fallback. // Returns the current property value once, no ongoing observation. sb.Append( $"new global::ReactiveUI.Binding.Observables.ReturnObservable<{segment.PropertyTypeFullName}>((({castTypeName}){rootVar}).{segment.PropertyName})"); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitShallowObservationVariable( StringBuilder sb, string rootVar, @@ -84,6 +87,7 @@ public void EmitShallowObservationVariable( $" var {varName} = new global::ReactiveUI.Binding.Observables.ReturnObservable<{segment.PropertyTypeFullName}>((({castTypeName}){rootVar}).{segment.PropertyName});"); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitDeepChainRootSegment( StringBuilder sb, string rootVar, @@ -123,6 +127,7 @@ public void EmitDeepChainInnerSegment( } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitInlineObservationVariable( StringBuilder sb, string rootVar, diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/INPCObservationPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/INPCObservationPlugin.cs index 8db441e0..c651db60 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/INPCObservationPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/INPCObservationPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -37,36 +38,22 @@ public bool IsAMatch(ClassBindingInfo classInfo) => /// public void EmitHelperClasses(StringBuilder sb) { - // No helper classes needed — uses PropertyObservable/PropertyChangingObservable from runtime library. + // No helper classes needed - uses PropertyObservable/PropertyChangingObservable from runtime library. } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitShallowObservation( StringBuilder sb, string rootVar, PropertyPathSegment segment, string castTypeName, bool isBeforeChange, - bool includeStartWith) - { - if (isBeforeChange) - { - _ = sb - .Append($"new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segment.PropertyTypeFullName}>((") - .Append($"""global::System.ComponentModel.INotifyPropertyChanging){rootVar}, "{segment.PropertyName}", (""") - .Append($"global::System.ComponentModel.INotifyPropertyChanging __o) => (({castTypeName})__o).{segment.PropertyName})"); - } - else - { - _ = sb - .Append($"""new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>({rootVar}, "{segment.PropertyName}", (""") - .Append($"global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, ") - .Append(includeStartWith ? "true" : "false") - .Append(')'); - } - } + bool includeStartWith) => + NotifyPropertyEmitter.EmitShallowObservation(sb, rootVar, segment, castTypeName, isBeforeChange, includeStartWith); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitShallowObservationVariable( StringBuilder sb, string rootVar, @@ -74,22 +61,10 @@ public void EmitShallowObservationVariable( string castTypeName, bool isBeforeChange, string varName) => - sb.Append(isBeforeChange - ? $""" - var {varName} = new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segment.PropertyTypeFullName}>( - (global::System.ComponentModel.INotifyPropertyChanging){rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanging __o) => (({castTypeName})__o).{segment.PropertyName}); - """ - : $""" - var {varName} = new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>( - {rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, - true); - """); + NotifyPropertyEmitter.EmitShallowObservationVariable(sb, rootVar, segment, castTypeName, isBeforeChange, varName); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitDeepChainRootSegment( StringBuilder sb, string rootVar, @@ -97,22 +72,10 @@ public void EmitDeepChainRootSegment( string castTypeName, bool isBeforeChange, string obsVarName) => - sb.AppendLine(isBeforeChange - ? $""" - var {obsVarName} = (global::System.IObservable<{segment.PropertyTypeFullName}>)new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segment.PropertyTypeFullName}>( - (global::System.ComponentModel.INotifyPropertyChanging){rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanging __o) => (({castTypeName})__o).{segment.PropertyName}); -""" - : $""" - var {obsVarName} = (global::System.IObservable<{segment.PropertyTypeFullName}>)new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>( - {rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, - false); - """); + NotifyPropertyEmitter.EmitDeepChainRootSegment(sb, rootVar, segment, castTypeName, isBeforeChange, obsVarName); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitDeepChainInnerSegment( StringBuilder sb, string prevVar, @@ -120,50 +83,16 @@ public void EmitDeepChainInnerSegment( string lambdaParam, PropertyPathSegment segment, bool isBeforeChange, - NullParentObservationBehavior nullParentBehavior) - { - var segType = segment.PropertyTypeFullName; - var nullParentObservable = nullParentBehavior == NullParentObservationBehavior.EmitDefault - ? $"new global::ReactiveUI.Binding.Observables.ReturnObservable<{segType}>(default({segType}))" - : $"global::ReactiveUI.Binding.Observables.EmptyObservable<{segType}>.Instance"; - - _ = sb.AppendLine() - .AppendLine(isBeforeChange - ? $""" - var {curVar} = global::ReactiveUI.Binding.Observables.RxBindingExtensions.Switch( - global::ReactiveUI.Binding.Observables.RxBindingExtensions.Select({prevVar}, - {lambdaParam} => {lambdaParam} != null - ? (global::System.IObservable<{segType}>)new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segType}>( - (global::System.ComponentModel.INotifyPropertyChanging){lambdaParam}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanging __o) => (({segment.DeclaringTypeFullName})__o).{segment.PropertyName}) - : (global::System.IObservable<{segType}>){nullParentObservable})); - """ - : $""" - var {curVar} = global::ReactiveUI.Binding.Observables.RxBindingExtensions.Switch( - global::ReactiveUI.Binding.Observables.RxBindingExtensions.Select({prevVar}, - {lambdaParam} => {lambdaParam} != null - ? (global::System.IObservable<{segType}>)new global::ReactiveUI.Binding.Observables.PropertyObservable<{segType}>( - {lambdaParam}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanged __o) => (({segment.DeclaringTypeFullName})__o).{segment.PropertyName}, - false) - : (global::System.IObservable<{segType}>){nullParentObservable})); - """); - } + NullParentObservationBehavior nullParentBehavior) => + NotifyPropertyEmitter.EmitDeepChainInnerSegment(sb, prevVar, curVar, lambdaParam, segment, isBeforeChange, nullParentBehavior); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitInlineObservationVariable( StringBuilder sb, string rootVar, PropertyPathSegment segment, string castTypeName, string varName) => - sb.AppendLine($""" - var {varName} = new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>( - {rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, - true); - """); + NotifyPropertyEmitter.EmitInlineObservationVariable(sb, rootVar, segment, castTypeName, varName); } diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/KVOObservationPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/KVOObservationPlugin.cs index cf4cca70..a4802c93 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/KVOObservationPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/KVOObservationPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -48,6 +49,7 @@ internal sealed class KVOObservationPlugin : IObservationPlugin public bool RequiresHelperClasses => true; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IsAMatch(ClassBindingInfo classInfo) => classInfo.InheritsNSObject; @@ -195,6 +197,7 @@ private static string ToKvoKeyPath(string propertyName, string propertyTypeFullN /// Emits the __KVOObserver NSObject subclass that forwards ObserveValue callbacks. /// The string builder. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitObserverClass(StringBuilder sb) => sb.AppendLine(""" @@ -276,6 +279,7 @@ private static void EmitSubscriptionClass(StringBuilder sb) /// Emits the subscription's fields and constructor, which registers the KVO observer. /// The string builder to append to. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitSubscriptionClassHead(StringBuilder sb) => sb.AppendLine(""" @@ -314,6 +318,7 @@ internal Subscription(__KVOObservable parent, global::System.IObserver obs /// Emits the subscription's value-changed callback and disposal. /// The string builder to append to. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitSubscriptionClassCallbacks(StringBuilder sb) => sb.AppendLine(""" diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/NotifyPropertyEmitter.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/NotifyPropertyEmitter.cs new file mode 100644 index 00000000..429722d4 --- /dev/null +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/NotifyPropertyEmitter.cs @@ -0,0 +1,182 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Runtime.CompilerServices; +using System.Text; +using ReactiveUI.Binding.SourceGenerators.Models; + +namespace ReactiveUI.Binding.SourceGenerators.Plugins.Observation; + +/// +/// The observation emission shared by every plugin that watches a type through +/// and +/// . +/// +/// +/// A plain INPC type and an IReactiveObject differ only in which plugin claims them and at what +/// affinity - IReactiveObject implements both interfaces, so the code emitted for the two is the +/// same PropertyObservable / PropertyChangingObservable either way. The emission lives here +/// once so the two plugins stay in step. +/// +internal static class NotifyPropertyEmitter +{ + /// Emits a shallow observation as an inline expression. + /// The string builder to append to. + /// The variable holding the observed object. + /// The property path segment being observed. + /// The type the observed object is cast to. + /// True for before-change observation. + /// Whether the observation emits the current value on subscribe. + internal static void EmitShallowObservation( + StringBuilder sb, + string rootVar, + PropertyPathSegment segment, + string castTypeName, + bool isBeforeChange, + bool includeStartWith) + { + if (isBeforeChange) + { + _ = sb + .Append($"new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segment.PropertyTypeFullName}>((") + .Append($"""global::System.ComponentModel.INotifyPropertyChanging){rootVar}, "{segment.PropertyName}", (""") + .Append($"global::System.ComponentModel.INotifyPropertyChanging __o) => (({castTypeName})__o).{segment.PropertyName})"); + return; + } + + _ = sb + .Append($"""new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>({rootVar}, "{segment.PropertyName}", (""") + .Append($"global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, ") + .Append(includeStartWith ? "true" : "false") + .Append(')'); + } + + /// Emits a shallow observation assigned to a local. + /// The string builder to append to. + /// The variable holding the observed object. + /// The property path segment being observed. + /// The type the observed object is cast to. + /// True for before-change observation. + /// The name of the local to assign. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void EmitShallowObservationVariable( + StringBuilder sb, + string rootVar, + PropertyPathSegment segment, + string castTypeName, + bool isBeforeChange, + string varName) => + sb.Append(isBeforeChange + ? $""" + var {varName} = new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segment.PropertyTypeFullName}>( + (global::System.ComponentModel.INotifyPropertyChanging){rootVar}, + "{segment.PropertyName}", + (global::System.ComponentModel.INotifyPropertyChanging __o) => (({castTypeName})__o).{segment.PropertyName}); + """ + : $""" + var {varName} = new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>( + {rootVar}, + "{segment.PropertyName}", + (global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, + true); + """); + + /// Emits the first stage of a deep observation chain. + /// The string builder to append to. + /// The variable holding the observed object. + /// The first property path segment. + /// The type the observed object is cast to. + /// True for before-change observation. + /// The name of the observable local to assign. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void EmitDeepChainRootSegment( + StringBuilder sb, + string rootVar, + PropertyPathSegment segment, + string castTypeName, + bool isBeforeChange, + string obsVarName) => + sb.AppendLine(isBeforeChange + ? $""" + var {obsVarName} = (global::System.IObservable<{segment.PropertyTypeFullName}>)new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segment.PropertyTypeFullName}>( + (global::System.ComponentModel.INotifyPropertyChanging){rootVar}, + "{segment.PropertyName}", + (global::System.ComponentModel.INotifyPropertyChanging __o) => (({castTypeName})__o).{segment.PropertyName}); +""" + : $""" + var {obsVarName} = (global::System.IObservable<{segment.PropertyTypeFullName}>)new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>( + {rootVar}, + "{segment.PropertyName}", + (global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, + false); + """); + + /// Emits an inner stage of a deep observation chain. + /// The string builder to append to. + /// The previous stage's observable. + /// The name of the observable local to assign. + /// The lambda parameter holding the parent value. + /// The property path segment being observed. + /// True for before-change observation. + /// What this stage emits while its parent is null. + internal static void EmitDeepChainInnerSegment( + StringBuilder sb, + string prevVar, + string curVar, + string lambdaParam, + PropertyPathSegment segment, + bool isBeforeChange, + NullParentObservationBehavior nullParentBehavior) + { + var segType = segment.PropertyTypeFullName; + var nullParentObservable = nullParentBehavior == NullParentObservationBehavior.EmitDefault + ? $"new global::ReactiveUI.Binding.Observables.ReturnObservable<{segType}>(default({segType}))" + : $"global::ReactiveUI.Binding.Observables.EmptyObservable<{segType}>.Instance"; + + _ = sb.AppendLine() + .AppendLine(isBeforeChange + ? $""" + var {curVar} = global::ReactiveUI.Binding.Observables.RxBindingExtensions.Switch( + global::ReactiveUI.Binding.Observables.RxBindingExtensions.Select({prevVar}, + {lambdaParam} => {lambdaParam} != null + ? (global::System.IObservable<{segType}>)new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segType}>( + (global::System.ComponentModel.INotifyPropertyChanging){lambdaParam}, + "{segment.PropertyName}", + (global::System.ComponentModel.INotifyPropertyChanging __o) => (({segment.DeclaringTypeFullName})__o).{segment.PropertyName}) + : (global::System.IObservable<{segType}>){nullParentObservable})); + """ + : $""" + var {curVar} = global::ReactiveUI.Binding.Observables.RxBindingExtensions.Switch( + global::ReactiveUI.Binding.Observables.RxBindingExtensions.Select({prevVar}, + {lambdaParam} => {lambdaParam} != null + ? (global::System.IObservable<{segType}>)new global::ReactiveUI.Binding.Observables.PropertyObservable<{segType}>( + {lambdaParam}, + "{segment.PropertyName}", + (global::System.ComponentModel.INotifyPropertyChanged __o) => (({segment.DeclaringTypeFullName})__o).{segment.PropertyName}, + false) + : (global::System.IObservable<{segType}>){nullParentObservable})); + """); + } + + /// Emits the inline observation a binding generator assigns to a local. + /// The string builder to append to. + /// The variable holding the observed object. + /// The property path segment being observed. + /// The type the observed object is cast to. + /// The name of the local to assign. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void EmitInlineObservationVariable( + StringBuilder sb, + string rootVar, + PropertyPathSegment segment, + string castTypeName, + string varName) => + sb.AppendLine($""" + var {varName} = new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>( + {rootVar}, + "{segment.PropertyName}", + (global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, + true); + """); +} diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/ReactiveObjectObservationPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/ReactiveObjectObservationPlugin.cs index 1d14059f..b293d2a6 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/ReactiveObjectObservationPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/ReactiveObjectObservationPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -32,42 +33,29 @@ internal sealed class ReactiveObjectObservationPlugin : IObservationPlugin public bool RequiresHelperClasses => false; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IsAMatch(ClassBindingInfo classInfo) => classInfo.ImplementsIReactiveObject; /// public void EmitHelperClasses(StringBuilder sb) { - // No helper classes needed — uses PropertyObservable/PropertyChangingObservable from runtime library. + // No helper classes needed - uses PropertyObservable/PropertyChangingObservable from runtime library. } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitShallowObservation( StringBuilder sb, string rootVar, PropertyPathSegment segment, string castTypeName, bool isBeforeChange, - bool includeStartWith) - { - if (isBeforeChange) - { - _ = sb - .Append($"new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segment.PropertyTypeFullName}>((") - .Append($"""global::System.ComponentModel.INotifyPropertyChanging){rootVar}, "{segment.PropertyName}", (""") - .Append($"global::System.ComponentModel.INotifyPropertyChanging __o) => (({castTypeName})__o).{segment.PropertyName})"); - } - else - { - _ = sb - .Append($"""new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>({rootVar}, "{segment.PropertyName}", (""") - .Append($"global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, ") - .Append(includeStartWith ? "true" : "false") - .Append(')'); - } - } + bool includeStartWith) => + NotifyPropertyEmitter.EmitShallowObservation(sb, rootVar, segment, castTypeName, isBeforeChange, includeStartWith); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitShallowObservationVariable( StringBuilder sb, string rootVar, @@ -75,22 +63,10 @@ public void EmitShallowObservationVariable( string castTypeName, bool isBeforeChange, string varName) => - sb.Append(isBeforeChange - ? $""" - var {varName} = new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segment.PropertyTypeFullName}>( - (global::System.ComponentModel.INotifyPropertyChanging){rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanging __o) => (({castTypeName})__o).{segment.PropertyName}); - """ - : $""" - var {varName} = new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>( - {rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, - true); - """); + NotifyPropertyEmitter.EmitShallowObservationVariable(sb, rootVar, segment, castTypeName, isBeforeChange, varName); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitDeepChainRootSegment( StringBuilder sb, string rootVar, @@ -98,22 +74,10 @@ public void EmitDeepChainRootSegment( string castTypeName, bool isBeforeChange, string obsVarName) => - sb.AppendLine(isBeforeChange - ? $""" - var {obsVarName} = (global::System.IObservable<{segment.PropertyTypeFullName}>)new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segment.PropertyTypeFullName}>( - (global::System.ComponentModel.INotifyPropertyChanging){rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanging __o) => (({castTypeName})__o).{segment.PropertyName}); -""" - : $""" - var {obsVarName} = (global::System.IObservable<{segment.PropertyTypeFullName}>)new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>( - {rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, - false); - """); + NotifyPropertyEmitter.EmitDeepChainRootSegment(sb, rootVar, segment, castTypeName, isBeforeChange, obsVarName); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitDeepChainInnerSegment( StringBuilder sb, string prevVar, @@ -121,50 +85,16 @@ public void EmitDeepChainInnerSegment( string lambdaParam, PropertyPathSegment segment, bool isBeforeChange, - NullParentObservationBehavior nullParentBehavior) - { - var segType = segment.PropertyTypeFullName; - var nullParentObservable = nullParentBehavior == NullParentObservationBehavior.EmitDefault - ? $"new global::ReactiveUI.Binding.Observables.ReturnObservable<{segType}>(default({segType}))" - : $"global::ReactiveUI.Binding.Observables.EmptyObservable<{segType}>.Instance"; - - _ = sb.AppendLine() - .AppendLine(isBeforeChange - ? $""" - var {curVar} = global::ReactiveUI.Binding.Observables.RxBindingExtensions.Switch( - global::ReactiveUI.Binding.Observables.RxBindingExtensions.Select({prevVar}, - {lambdaParam} => {lambdaParam} != null - ? (global::System.IObservable<{segType}>)new global::ReactiveUI.Binding.Observables.PropertyChangingObservable<{segType}>( - (global::System.ComponentModel.INotifyPropertyChanging){lambdaParam}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanging __o) => (({segment.DeclaringTypeFullName})__o).{segment.PropertyName}) - : (global::System.IObservable<{segType}>){nullParentObservable})); - """ - : $""" - var {curVar} = global::ReactiveUI.Binding.Observables.RxBindingExtensions.Switch( - global::ReactiveUI.Binding.Observables.RxBindingExtensions.Select({prevVar}, - {lambdaParam} => {lambdaParam} != null - ? (global::System.IObservable<{segType}>)new global::ReactiveUI.Binding.Observables.PropertyObservable<{segType}>( - {lambdaParam}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanged __o) => (({segment.DeclaringTypeFullName})__o).{segment.PropertyName}, - false) - : (global::System.IObservable<{segType}>){nullParentObservable})); - """); - } + NullParentObservationBehavior nullParentBehavior) => + NotifyPropertyEmitter.EmitDeepChainInnerSegment(sb, prevVar, curVar, lambdaParam, segment, isBeforeChange, nullParentBehavior); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitInlineObservationVariable( StringBuilder sb, string rootVar, PropertyPathSegment segment, string castTypeName, string varName) => - sb.AppendLine($""" - var {varName} = new global::ReactiveUI.Binding.Observables.PropertyObservable<{segment.PropertyTypeFullName}>( - {rootVar}, - "{segment.PropertyName}", - (global::System.ComponentModel.INotifyPropertyChanged __o) => (({castTypeName})__o).{segment.PropertyName}, - true); - """); + NotifyPropertyEmitter.EmitInlineObservationVariable(sb, rootVar, segment, castTypeName, varName); } diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WinFormsObservationPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WinFormsObservationPlugin.cs index f30fcef2..c1f2d791 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WinFormsObservationPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WinFormsObservationPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -47,6 +48,7 @@ internal sealed class WinFormsObservationPlugin : IObservationPlugin public bool RequiresHelperClasses => false; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IsAMatch(ClassBindingInfo classInfo) => classInfo.InheritsWinFormsComponent; @@ -176,6 +178,7 @@ public void EmitDeepChainInnerSegment( } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitInlineObservationVariable( StringBuilder sb, string rootVar, diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WinUIObservationPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WinUIObservationPlugin.cs index fe4a59c9..c1e06732 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WinUIObservationPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WinUIObservationPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -40,6 +41,7 @@ internal sealed class WinUIObservationPlugin : IObservationPlugin public bool RequiresHelperClasses => true; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IsAMatch(ClassBindingInfo classInfo) => classInfo.InheritsWinUIDependencyObject; @@ -171,6 +173,7 @@ public void EmitDeepChainInnerSegment( } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitInlineObservationVariable( StringBuilder sb, string rootVar, @@ -187,6 +190,7 @@ public void EmitInlineObservationVariable( /// Emits the __WinUIDPObservable<T> class header (fields and constructor). /// The string builder. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitObservableHeader(StringBuilder sb) => sb.AppendLine(""" @@ -228,6 +232,7 @@ private static void EmitSubscriptionClass(StringBuilder sb) /// Emits the Subscribe method plus the subscription's fields and constructor. /// The string builder to append to. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitSubscriptionClassHead(StringBuilder sb) => sb.AppendLine(""" @@ -262,6 +267,7 @@ internal Subscription(__WinUIDPObservable parent, global::System.IObserver /// Emits the subscription's change callback and disposal, closing the observable class. /// The string builder to append to. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void EmitSubscriptionClassCallbacks(StringBuilder sb) => sb.AppendLine(""" diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WpfObservationPlugin.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WpfObservationPlugin.cs index 6db05b72..84e1a6fd 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WpfObservationPlugin.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/Observation/WpfObservationPlugin.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using ReactiveUI.Binding.SourceGenerators.Models; @@ -47,6 +48,7 @@ internal sealed class WpfObservationPlugin : IObservationPlugin public bool RequiresHelperClasses => false; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IsAMatch(ClassBindingInfo classInfo) => classInfo.InheritsWpfDependencyObject; @@ -187,6 +189,7 @@ public void EmitDeepChainInnerSegment( } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EmitInlineObservationVariable( StringBuilder sb, string rootVar, diff --git a/src/ReactiveUI.Binding.SourceGenerators/Plugins/ObservationPluginRegistry.cs b/src/ReactiveUI.Binding.SourceGenerators/Plugins/ObservationPluginRegistry.cs index c140fe5a..258cdbbd 100644 --- a/src/ReactiveUI.Binding.SourceGenerators/Plugins/ObservationPluginRegistry.cs +++ b/src/ReactiveUI.Binding.SourceGenerators/Plugins/ObservationPluginRegistry.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.SourceGenerators.Models; using ReactiveUI.Binding.SourceGenerators.Plugins.Observation; @@ -67,5 +68,6 @@ internal static class ObservationPluginRegistry /// Gets the plugin at the specified index. /// The zero-based index. /// The plugin at the specified index. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static IObservationPlugin GetPlugin(int index) => Plugins[index]; } diff --git a/src/ReactiveUI.Binding.WinForms.Shared/Builder/WinFormsBindingBuilderExtensions.cs b/src/ReactiveUI.Binding.WinForms.Shared/Builder/WinFormsBindingBuilderExtensions.cs index 2000c277..23538900 100644 --- a/src/ReactiveUI.Binding.WinForms.Shared/Builder/WinFormsBindingBuilderExtensions.cs +++ b/src/ReactiveUI.Binding.WinForms.Shared/Builder/WinFormsBindingBuilderExtensions.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using Splat.Builder; #if REACTIVE_SHIM @@ -22,6 +23,7 @@ public static class WinFormsBindingBuilderExtensions /// property observation for WinForms components. /// /// The builder instance for chaining. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IReactiveUIBindingBuilder WithWinForms() => ((IReactiveUIBindingBuilder)builder).WithWinForms(); } diff --git a/src/ReactiveUI.Binding.WinForms.Shared/WinFormsCreatesObservableForProperty.cs b/src/ReactiveUI.Binding.WinForms.Shared/WinFormsCreatesObservableForProperty.cs index a828100f..61b6ca04 100644 --- a/src/ReactiveUI.Binding.WinForms.Shared/WinFormsCreatesObservableForProperty.cs +++ b/src/ReactiveUI.Binding.WinForms.Shared/WinFormsCreatesObservableForProperty.cs @@ -4,6 +4,7 @@ using System.Collections.Concurrent; using System.Reflection; +using System.Runtime.CompilerServices; #if REACTIVE_SHIM namespace ReactiveUI.Binding.Reactive.WinForms; @@ -62,9 +63,9 @@ public int GetAffinityForObject(Type type, string propertyName, bool beforeChang subj.OnNext(new ObservedChange(sender, expression, default))); ei.AddEventHandler(sender, handler); - return new ActionDisposable<(EventInfo ei, object sender, EventHandler handler)>( + return new ActionDisposable<(EventInfo EventInfo, object Sender, EventHandler Handler)>( (ei, sender, handler), - static state => state.ei.RemoveEventHandler(state.sender, state.handler)); + static state => state.EventInfo.RemoveEventHandler(state.Sender, state.Handler)); }); } @@ -74,6 +75,7 @@ public int GetAffinityForObject(Type type, string propertyName, bool beforeChang /// /// An object if the {PropertyName}Changed event is found; otherwise, null. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static EventInfo? GetEventInfo(Type type, string propertyName) => EventInfoCache.GetOrAdd( (type, propertyName), diff --git a/src/ReactiveUI.Binding.Wpf.Shared/BooleanToVisibilityHints.cs b/src/ReactiveUI.Binding.Wpf.Shared/BooleanToVisibilityHints.cs index c6945b4d..e7e353ec 100644 --- a/src/ReactiveUI.Binding.Wpf.Shared/BooleanToVisibilityHints.cs +++ b/src/ReactiveUI.Binding.Wpf.Shared/BooleanToVisibilityHints.cs @@ -19,5 +19,5 @@ public enum BooleanToVisibilityHints Inverse = 1 << 1, /// Use Visibility.Hidden rather than Visibility.Collapsed for false values. - UseHidden = 1 << 2 + UseHidden = 1 << 2, } diff --git a/src/ReactiveUI.Binding.Wpf.Shared/BooleanToVisibilityTypeConverter.cs b/src/ReactiveUI.Binding.Wpf.Shared/BooleanToVisibilityTypeConverter.cs index d2e4caf3..29e4ae10 100644 --- a/src/ReactiveUI.Binding.Wpf.Shared/BooleanToVisibilityTypeConverter.cs +++ b/src/ReactiveUI.Binding.Wpf.Shared/BooleanToVisibilityTypeConverter.cs @@ -33,13 +33,15 @@ public override bool TryConvert(bool from, object? conversionHint, [NotNullWhen( ? visibilityHint : BooleanToVisibilityHints.None; - var value = (hint & BooleanToVisibilityHints.Inverse) != 0 ? !from : from; + if ((hint & BooleanToVisibilityHints.Inverse) != 0 ? !from : from) + { + result = Visibility.Visible; + return true; + } - var notVisible = (hint & BooleanToVisibilityHints.UseHidden) != 0 + result = (hint & BooleanToVisibilityHints.UseHidden) != 0 ? Visibility.Hidden : Visibility.Collapsed; - - result = value ? Visibility.Visible : notVisible; return true; } } diff --git a/src/ReactiveUI.Binding.Wpf.Shared/Builder/WpfBindingBuilderExtensions.cs b/src/ReactiveUI.Binding.Wpf.Shared/Builder/WpfBindingBuilderExtensions.cs index 740dbfd3..f9b93233 100644 --- a/src/ReactiveUI.Binding.Wpf.Shared/Builder/WpfBindingBuilderExtensions.cs +++ b/src/ReactiveUI.Binding.Wpf.Shared/Builder/WpfBindingBuilderExtensions.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using Splat.Builder; #if REACTIVE_SHIM @@ -22,6 +23,7 @@ public static class WpfBindingBuilderExtensions /// and WPF-specific Visibility converters. /// /// The builder instance for chaining. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IReactiveUIBindingBuilder WithWpf() => ((IReactiveUIBindingBuilder)builder).WithWpf(); } diff --git a/src/ReactiveUI.Binding.Wpf.Shared/DependencyObjectObservableForProperty.cs b/src/ReactiveUI.Binding.Wpf.Shared/DependencyObjectObservableForProperty.cs index 92a65512..d03e041a 100644 --- a/src/ReactiveUI.Binding.Wpf.Shared/DependencyObjectObservableForProperty.cs +++ b/src/ReactiveUI.Binding.Wpf.Shared/DependencyObjectObservableForProperty.cs @@ -59,9 +59,9 @@ public int GetAffinityForObject(Type type, string propertyName, bool beforeChang subj.OnNext(new ObservedChange(sender, expression, default))); dependencyPropertyDescriptor.AddValueChanged(sender, handler); - return new ActionDisposable<(DependencyPropertyDescriptor descriptor, object sender, EventHandler handler)>( + return new ActionDisposable<(DependencyPropertyDescriptor Descriptor, object Sender, EventHandler Handler)>( (dependencyPropertyDescriptor, sender, handler), - static state => state.descriptor.RemoveValueChanged(state.sender, state.handler)); + static state => state.Descriptor.RemoveValueChanged(state.Sender, state.Handler)); }); } diff --git a/src/benchmarks/.editorconfig b/src/benchmarks/.editorconfig new file mode 100644 index 00000000..037829b5 --- /dev/null +++ b/src/benchmarks/.editorconfig @@ -0,0 +1,10 @@ +[*.cs] + +################### +# Benchmark harness relaxations +# +# A benchmark class is a harness the runner instantiates and drives; nobody stops on one in a +# debugger to read a summary of it. The models these benchmarks observe still carry a display +# attribute where it earns its place. +################### +dotnet_diagnostic.SST2334.severity = none # Harness types are driven by the runner, not inspected diff --git a/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ModuleInitializer.cs b/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ModuleInitializer.cs index 94ca1052..005344a6 100644 --- a/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ModuleInitializer.cs +++ b/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ModuleInitializer.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Builder; using Splat; @@ -34,6 +35,7 @@ internal static void EnsureInitialized() private sealed class BenchmarkModeDetector : IModeDetector { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool? InUnitTestRunner() => true; } } diff --git a/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ReactiveUIBindingBenchmark.cs b/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ReactiveUIBindingBenchmark.cs index 1ba2d470..1759c214 100644 --- a/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ReactiveUIBindingBenchmark.cs +++ b/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ReactiveUIBindingBenchmark.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Diagnostics; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; @@ -12,6 +13,7 @@ namespace ReactiveUI.Binding.Benchmarks; [SimpleJob(RuntimeMoniker.Net10_0)] [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] +[DebuggerDisplay("Expression-tree binding over {PropertyChangeCount} changes")] public class ReactiveUIBindingBenchmark { /// The number of property changes to fire during each benchmark iteration. diff --git a/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ReactiveUIObservationBenchmark.cs b/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ReactiveUIObservationBenchmark.cs index f799352f..b4e42cf0 100644 --- a/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ReactiveUIObservationBenchmark.cs +++ b/src/benchmarks/ReactiveUI.Binding.Benchmarks.ReactiveUI/ReactiveUIObservationBenchmark.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Diagnostics; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; @@ -12,6 +13,7 @@ namespace ReactiveUI.Binding.Benchmarks; [SimpleJob(RuntimeMoniker.Net10_0)] [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] +[DebuggerDisplay("Expression-tree observation over {PropertyChangeCount} changes")] public class ReactiveUIObservationBenchmark { /// The number of property changes to fire during each benchmark iteration. @@ -60,7 +62,7 @@ public void DeepChain() [Benchmark(Description = "Two Properties")] public void TwoProperties() { - (string name, int age) last = default; + (string Name, int Age) last = default; using var sub = _vm.WhenAnyValue(x => x.Name, x => x.Age, static (name, age) => (name, age)) .Subscribe(v => last = v); diff --git a/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkChildViewModel.cs b/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkChildViewModel.cs index e471e42f..09e53360 100644 --- a/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkChildViewModel.cs +++ b/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkChildViewModel.cs @@ -3,10 +3,12 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Diagnostics; namespace ReactiveUI.Binding.Benchmarks; /// A child view model for deep chain benchmarks. +[DebuggerDisplay("Value = {Value}")] public class BenchmarkChildViewModel : INotifyPropertyChanged { /// diff --git a/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkView.cs b/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkView.cs index 95641276..b3fe470b 100644 --- a/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkView.cs +++ b/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkView.cs @@ -3,10 +3,12 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Diagnostics; namespace ReactiveUI.Binding.Benchmarks; /// A view used for binding benchmarks. Implements to support ReactiveUI's expression-tree-based binding APIs. +[DebuggerDisplay("DisplayName = {DisplayName}, DisplayAge = {DisplayAge}")] public class BenchmarkView : IViewFor, INotifyPropertyChanged { /// diff --git a/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkViewModel.cs b/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkViewModel.cs index cc500d92..6ed5a11c 100644 --- a/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkViewModel.cs +++ b/src/benchmarks/ReactiveUI.Binding.Benchmarks/BenchmarkViewModel.cs @@ -3,10 +3,12 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Diagnostics; namespace ReactiveUI.Binding.Benchmarks; /// A view model used for benchmarking source-generated property observation and binding. +[DebuggerDisplay("Name = {Name}, Age = {Age}")] public class BenchmarkViewModel : INotifyPropertyChanged, INotifyPropertyChanging { /// diff --git a/src/benchmarks/ReactiveUI.Binding.Benchmarks/BindTwoWayBenchmark.cs b/src/benchmarks/ReactiveUI.Binding.Benchmarks/BindTwoWayBenchmark.cs index db6c737a..7f0855fe 100644 --- a/src/benchmarks/ReactiveUI.Binding.Benchmarks/BindTwoWayBenchmark.cs +++ b/src/benchmarks/ReactiveUI.Binding.Benchmarks/BindTwoWayBenchmark.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using ReactiveUI.Primitives.Concurrency; @@ -86,6 +87,7 @@ public void Bidirectional() /// /// The instance of whose property changes are observed. /// An observable sequence of values that represent the changes to the property. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static IObservable TriggerViewGeneration(BenchmarkView view) => view.WhenChanged(x => x.DisplayName); } diff --git a/src/benchmarks/ReactiveUI.Binding.Benchmarks/WhenChangedBenchmark.cs b/src/benchmarks/ReactiveUI.Binding.Benchmarks/WhenChangedBenchmark.cs index 6a3f6f0f..0e7deac1 100644 --- a/src/benchmarks/ReactiveUI.Binding.Benchmarks/WhenChangedBenchmark.cs +++ b/src/benchmarks/ReactiveUI.Binding.Benchmarks/WhenChangedBenchmark.cs @@ -58,7 +58,7 @@ public void DeepChain() [Benchmark(Description = "Two Properties")] public void TwoProperties() { - (string name, int age) last = default; + (string Name, int Age) last = default; using var sub = _vm.WhenChanged(x => x.Name, x => x.Age) .Subscribe(v => last = v); diff --git a/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GenerationBenchmarks.cs b/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GenerationBenchmarks.cs index 98e24219..a1df7b93 100644 --- a/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GenerationBenchmarks.cs +++ b/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GenerationBenchmarks.cs @@ -33,6 +33,7 @@ public class GenerationBenchmarks /// Runs a whole cold generation: syntax scan, extraction, and emission. /// The number of generated characters, returned so the work cannot be optimized away. + /// The corpus generated nothing, so there is no result to report. [Benchmark] public int Generate() { diff --git a/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GeneratorCorpus.cs b/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GeneratorCorpus.cs index 45df9754..f9f05f0b 100644 --- a/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GeneratorCorpus.cs +++ b/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GeneratorCorpus.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; namespace ReactiveUI.Binding.Generator.Benchmarks; @@ -54,6 +55,7 @@ private static void AppendPair(StringBuilder sb, int index) /// Appends the view model, child, button, and view for one pair. /// The builder to append to. /// The index that makes the emitted names unique. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void AppendTypes(StringBuilder sb, int index) => sb.Append($$""" public class Child{{index}} : INotifyPropertyChanged @@ -103,6 +105,7 @@ public class MyView{{index}} : IViewFor /// Appends the call sites for one pair, spread across the observation and binding APIs. /// The builder to append to. /// The index that makes the emitted names unique. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void AppendUsage(StringBuilder sb, int index) => sb.Append($$""" public static class Usage{{index}} diff --git a/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GeneratorHarness.cs b/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GeneratorHarness.cs index 61195796..4ae514bf 100644 --- a/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GeneratorHarness.cs +++ b/src/benchmarks/ReactiveUI.Binding.Generator.Benchmarks/GeneratorHarness.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using ReactiveUI.Binding.SourceGenerators; @@ -26,7 +27,7 @@ internal static CSharpCompilation BuildCompilation(string sourceText) { MetadataReference.CreateFromFile(typeof(ReactiveUIBindingExtensions).Assembly.Location), MetadataReference.CreateFromFile(typeof(ReactiveUI.Primitives.Concurrency.ISequencer).Assembly.Location), - MetadataReference.CreateFromFile(typeof(Splat.IEnableLogger).Assembly.Location) + MetadataReference.CreateFromFile(typeof(Splat.IEnableLogger).Assembly.Location), }; return CSharpCompilation.Create( @@ -38,6 +39,7 @@ internal static CSharpCompilation BuildCompilation(string sourceText) /// Creates a cold generator driver, carrying no caches from a previous run. /// The generator driver. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static GeneratorDriver CreateDriver() => CSharpGeneratorDriver.Create( [new BindingGenerator().AsSourceGenerator()], diff --git a/src/tests/.editorconfig b/src/tests/.editorconfig index 25501dd8..007d550a 100644 --- a/src/tests/.editorconfig +++ b/src/tests/.editorconfig @@ -13,6 +13,7 @@ dotnet_diagnostic.CA2213.severity = none # Disposable fields should be disposed # PerformanceSharp / StyleSharp test relaxations imported from Primitives ################### dotnet_diagnostic.SST1432.severity = none # Test fixtures need not be static +dotnet_diagnostic.SST2334.severity = none # Fixtures and models are read through assertions, not a debugger summary dotnet_diagnostic.SST2410.severity = none # A test creates the disposable it is asserting about; the test process owns it and exits performancesharp.avoid_linq_on_hot_path = false dotnet_diagnostic.PSH1100.severity = none # Tests can use LINQ for clarity diff --git a/src/tests/ReactiveUI.Binding.Analyzer.Tests/Helpers/AnalyzerHelpersTests.cs b/src/tests/ReactiveUI.Binding.Analyzer.Tests/Helpers/AnalyzerHelpersTests.cs index fd1f0c64..783b19a1 100644 --- a/src/tests/ReactiveUI.Binding.Analyzer.Tests/Helpers/AnalyzerHelpersTests.cs +++ b/src/tests/ReactiveUI.Binding.Analyzer.Tests/Helpers/AnalyzerHelpersTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using NSubstitute; @@ -689,6 +690,7 @@ private static INamedTypeSymbol GetNamedTypeSymbol(CSharpCompilation compilation /// Creates a compilation from the specified source code. /// The source code. /// A CSharpCompilation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static CSharpCompilation CreateCompilation(string source) => AnalyzerTestHelper.CreateCompilation(source); diff --git a/src/tests/ReactiveUI.Binding.Analyzer.Tests/Helpers/AnalyzerTestHelper.cs b/src/tests/ReactiveUI.Binding.Analyzer.Tests/Helpers/AnalyzerTestHelper.cs index 05e2e604..39a5d3a5 100644 --- a/src/tests/ReactiveUI.Binding.Analyzer.Tests/Helpers/AnalyzerTestHelper.cs +++ b/src/tests/ReactiveUI.Binding.Analyzer.Tests/Helpers/AnalyzerTestHelper.cs @@ -6,6 +6,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Reflection; +using System.Runtime.CompilerServices; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Diagnostics; @@ -20,6 +21,7 @@ public static class AnalyzerTestHelper /// The source code to analyze. /// A task that represents the asynchronous operation. The task result contains the diagnostics. [SuppressMessage("Design", "SST2307:Type parameter is not inferable", Justification = "the analyzer under test is specified explicitly by the caller")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task> GetDiagnosticsAsync(string source) where TAnalyzer : DiagnosticAnalyzer, new() => GetDiagnosticsAsync(source, null, null); @@ -62,6 +64,7 @@ public static async Task> GetDiagnosticsAsyncCreates a CSharpCompilation from the specified source code with required assembly references. /// The source code to compile into a CSharpCompilation. /// A CSharpCompilation object representing the compiled source code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static CSharpCompilation CreateCompilation(string source) => CreateCompilation(source, null); /// Creates a compilation from source at a given language version. @@ -101,7 +104,7 @@ void AddReference(Assembly assembly) // Add runtime assemblies by name for any that typeof didn't cover var assemblyNames = new[] { - "System.Runtime", "System.ComponentModel.Primitives", "System.ObjectModel", "System.Collections" + "System.Runtime", "System.ComponentModel.Primitives", "System.ObjectModel", "System.Collections", }; var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies(); diff --git a/src/tests/ReactiveUI.Binding.AotValidation/Program.cs b/src/tests/ReactiveUI.Binding.AotValidation/Program.cs index 330c5627..37a9caf6 100644 --- a/src/tests/ReactiveUI.Binding.AotValidation/Program.cs +++ b/src/tests/ReactiveUI.Binding.AotValidation/Program.cs @@ -4,6 +4,7 @@ using System; using System.IO; +using System.Runtime.CompilerServices; namespace ReactiveUI.Binding.AotValidation; @@ -87,12 +88,12 @@ private static void ValidateWhenChangedDeepChain() private static void ValidateWhenChangedTwoProperties() { var vm = new AotViewModel { Name = Alice, Age = InitialAge }; - (string name, int age) last = default; + (string Name, int Age) last = default; using var sub = vm.WhenChanged(x => x.Name, x => x.Age).Subscribe(v => last = v); - AssertEqual("WhenChanged two-prop name", Alice, last.name); - AssertEqual("WhenChanged two-prop age", InitialAge, last.age); + AssertEqual("WhenChanged two-prop name", Alice, last.Name); + AssertEqual("WhenChanged two-prop age", InitialAge, last.Age); vm.Age = UpdatedAge; - AssertEqual("WhenChanged two-prop age update", UpdatedAge, last.age); + AssertEqual("WhenChanged two-prop age update", UpdatedAge, last.Age); } /// WhenChanged on the view type produces a dispatch entry required by BindTwoWay. @@ -163,5 +164,6 @@ private static void AssertEqual(string label, T expected, T? actual) /// Writes a single line of the validation report to the process output stream. /// The line to write. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void Report(string message) => _output.WriteLine(message); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindCommandScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindCommandScenarios.cs index acd93906..fe115349 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindCommandScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindCommandScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,6 +17,7 @@ public static class BindCommandScenarios /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable BasicNoParam( SharedScenarios.BindCommand.BasicNoParam.MyViewModel vm, SharedScenarios.BindCommand.BasicNoParam.MyView view) => @@ -25,6 +27,7 @@ public static IDisposable BasicNoParam( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable ExpressionParam( SharedScenarios.BindCommand.ExpressionParam.MyViewModel vm, SharedScenarios.BindCommand.ExpressionParam.MyView view) => @@ -35,6 +38,7 @@ public static IDisposable ExpressionParam( /// The target view. /// An observable producing command parameters. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable ObservableParam( SharedScenarios.BindCommand.ObservableParam.MyViewModel vm, SharedScenarios.BindCommand.ObservableParam.MyView view, @@ -45,6 +49,7 @@ public static IDisposable ObservableParam( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable CustomEvent( SharedScenarios.BindCommand.CustomEvent.MyViewModel vm, SharedScenarios.BindCommand.CustomEvent.MyView view) => @@ -54,6 +59,7 @@ public static IDisposable CustomEvent( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable DeepCommandPath( SharedScenarios.BindCommand.DeepCommandPath.MyViewModel vm, SharedScenarios.BindCommand.DeepCommandPath.MyView view) => @@ -63,6 +69,7 @@ public static IDisposable DeepCommandPath( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable EventEnabled( SharedScenarios.BindCommand.EventEnabled.MyViewModel vm, SharedScenarios.BindCommand.EventEnabled.MyView view) => @@ -75,6 +82,7 @@ public static IDisposable EventEnabled( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable EventEnabledExprParam( SharedScenarios.BindCommand.EventEnabledExprParam.MyViewModel vm, SharedScenarios.BindCommand.EventEnabledExprParam.MyView view) => @@ -88,6 +96,7 @@ public static IDisposable EventEnabledExprParam( /// The target view. /// An observable producing command parameters. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable EventEnabledObsParam( SharedScenarios.BindCommand.EventEnabledObsParam.MyViewModel vm, SharedScenarios.BindCommand.EventEnabledObsParam.MyView view, @@ -98,6 +107,7 @@ public static IDisposable EventEnabledObsParam( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable CommandProperty( SharedScenarios.BindCommand.CommandProperty.MyViewModel vm, SharedScenarios.BindCommand.CommandProperty.MyView view) => @@ -110,6 +120,7 @@ public static IDisposable CommandProperty( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable CommandPropertyExprParam( SharedScenarios.BindCommand.CommandPropertyExprParam.MyViewModel vm, SharedScenarios.BindCommand.CommandPropertyExprParam.MyView view) => @@ -123,6 +134,7 @@ public static IDisposable CommandPropertyExprParam( /// The target view. /// An observable producing command parameters. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable CommandPropertyObsParam( SharedScenarios.BindCommand.CommandPropertyObsParam.MyViewModel vm, SharedScenarios.BindCommand.CommandPropertyObsParam.MyView view, @@ -133,6 +145,7 @@ public static IDisposable CommandPropertyObsParam( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable NoEvent( SharedScenarios.BindCommand.NoEvent.MyViewModel vm, SharedScenarios.BindCommand.NoEvent.MyView view) => diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindCompatScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindCompatScenarios.cs index 7ae7d9bc..0043aa7e 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindCompatScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindCompatScenarios.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -13,7 +14,8 @@ public static class BindCompatScenarios /// The target view. /// The source view model. /// A reactive binding representing the binding. - public static IReactiveBinding StringProperty( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IReactiveBinding StringProperty( TestView view, TestViewModel vm) => view.Bind(vm, x => x.Name, x => x.DisplayName); diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindInteractionScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindInteractionScenarios.cs index 1ced6120..21c61e82 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindInteractionScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindInteractionScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,6 +17,7 @@ public static class BindInteractionScenarios /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable TaskHandler( SharedScenarios.BindInteraction.TaskHandler.MyViewModel vm, SharedScenarios.BindInteraction.TaskHandler.MyView view) => @@ -25,6 +27,7 @@ public static IDisposable TaskHandler( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable ObservableHandler( SharedScenarios.BindInteraction.ObservableHandler.MyViewModel vm, SharedScenarios.BindInteraction.ObservableHandler.MyView view) => @@ -34,6 +37,7 @@ public static IDisposable ObservableHandler( /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable DeepPropertyPath( SharedScenarios.BindInteraction.DeepPropertyPath.MyViewModel vm, SharedScenarios.BindInteraction.DeepPropertyPath.MyView view) => diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindOneWayScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindOneWayScenarios.cs index cdfb1667..92cd2cc0 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindOneWayScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindOneWayScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -17,6 +18,7 @@ public static class BindOneWayScenarios /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable StringProperty(BigViewModel source, BigView target) => source.BindOneWay(target, x => x.Prop1, x => x.ViewProp1); @@ -24,6 +26,7 @@ public static IDisposable StringProperty(BigViewModel source, BigView target) => /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable IntProperty(BigViewModel source, BigView target) => source.BindOneWay(target, x => x.Prop2, x => x.ViewProp2); @@ -31,6 +34,7 @@ public static IDisposable IntProperty(BigViewModel source, BigView target) => /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable DoubleProperty(BigViewModel source, BigView target) => source.BindOneWay(target, x => x.Prop3, x => x.ViewProp3); @@ -38,6 +42,7 @@ public static IDisposable DoubleProperty(BigViewModel source, BigView target) => /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable BoolProperty(BigViewModel source, BigView target) => source.BindOneWay(target, x => x.Prop4, x => x.ViewProp4); @@ -45,6 +50,7 @@ public static IDisposable BoolProperty(BigViewModel source, BigView target) => /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable DeepChainProperty(BigViewModel source, BigView target) => source.BindOneWay(target, x => x.Address.City, x => x.ViewProp1); @@ -52,6 +58,7 @@ public static IDisposable DeepChainProperty(BigViewModel source, BigView target) /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable StringProperty5(BigViewModel source, BigView target) => source.BindOneWay(target, x => x.Prop5, x => x.ViewProp5); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindToScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindToScenarios.cs index 7e3fd7ca..ee713009 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindToScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindToScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -14,6 +15,7 @@ public static class BindToScenarios /// The source observable stream. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable StringToString(IObservable source, BigView target) => source.BindTo(target, x => x.ViewProp1); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindTwoWayScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindTwoWayScenarios.cs index 8b2aea0f..16c4651f 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindTwoWayScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/BindTwoWayScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -17,6 +18,7 @@ public static class BindTwoWayScenarios /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable StringProperty(BigViewModel source, BigView target) => source.BindTwoWay(target, x => x.Prop1, x => x.ViewProp1); @@ -24,6 +26,7 @@ public static IDisposable StringProperty(BigViewModel source, BigView target) => /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable IntProperty(BigViewModel source, BigView target) => source.BindTwoWay(target, x => x.Prop2, x => x.ViewProp2); @@ -31,6 +34,7 @@ public static IDisposable IntProperty(BigViewModel source, BigView target) => /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable DoubleProperty(BigViewModel source, BigView target) => source.BindTwoWay(target, x => x.Prop3, x => x.ViewProp3); @@ -38,6 +42,7 @@ public static IDisposable DoubleProperty(BigViewModel source, BigView target) => /// The source view model. /// The target view. /// A disposable that, when disposed, disconnects the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable BoolProperty(BigViewModel source, BigView target) => source.BindTwoWay(target, x => x.Prop4, x => x.ViewProp4); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/OneWayBindCompatScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/OneWayBindCompatScenarios.cs index b116ac5f..0f9629e4 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/OneWayBindCompatScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/OneWayBindCompatScenarios.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -13,6 +14,7 @@ public static class OneWayBindCompatScenarios /// The target view. /// The source view model. /// A reactive binding representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IReactiveBinding StringProperty(TestView view, TestViewModel vm) => view.OneWayBind(vm, x => x.Name, x => x.DisplayName); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyObservableScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyObservableScenarios.cs index 31235ef2..b3102dfa 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyObservableScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyObservableScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,12 +17,14 @@ public static class WhenAnyObservableScenarios /// Single observable property observation using Switch pattern. /// The view model to observe. /// An observable that switches to the latest MyCommand observable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable SingleObservable_Switch(ObservablePropertyViewModel vm) => vm.WhenAnyObservable(x => x.MyCommand); /// Two observable properties of the same type using Merge pattern. /// The view model to observe. /// An observable that merges both command observables. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable TwoObservables_Merge(ObservablePropertyViewModel vm) => vm.WhenAnyObservable(x => x.MyCommand, x => x.OtherCommand); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyScenarios.cs index 46451813..f2161a8e 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,12 +17,14 @@ public static class WhenAnyScenarios /// Single property WhenAny observation with a selector extracting the value. /// The view model to observe. /// An observable of the Name property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable SingleProperty_Name(TestViewModel vm) => vm.WhenAny(x => x.Name, static c => c.Value); /// Single property WhenAny observation returning the IObservedChange directly. /// The view model to observe. /// An observable of IObservedChange for the Name property. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable> SingleProperty_Name_ObservedChange( TestViewModel vm) => vm.WhenAny(x => x.Name, static c => c); @@ -29,6 +32,7 @@ public static IObservable> SingleProperty /// Two-property WhenAny observation with a selector combining values. /// The view model to observe. /// An observable of the combined name and age string. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable TwoProperties_NameAge(TestViewModel vm) => vm.WhenAny(x => x.Name, x => x.Age, static (name, age) => $"{name.Value}_{age.Value}"); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyValueExtendedScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyValueExtendedScenarios.cs index a4295f4f..5dae539b 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyValueExtendedScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyValueExtendedScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,31 +17,35 @@ public static class WhenAnyValueExtendedScenarios /// Four-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4)> FourProperties( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4)> FourProperties( BigViewModel vm) => vm.WhenAnyValue(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4); /// Five-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5)> + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5)> FiveProperties(BigViewModel vm) => vm.WhenAnyValue(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4, x => x.Prop5); /// Six-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6)> + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6)> SixProperties(BigViewModel vm) => vm.WhenAnyValue(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4, x => x.Prop5, x => x.Prop6); /// Seven-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7)> SevenProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7)> SevenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, x => x.Prop2, @@ -53,9 +58,10 @@ public static /// Eight-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8)> EightProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8)> EightProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, x => x.Prop2, @@ -69,9 +75,10 @@ public static /// Nine-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9)> NineProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9)> NineProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, x => x.Prop2, @@ -86,9 +93,10 @@ public static /// Ten-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9, int property10)> TenProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9, int Property10)> TenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, x => x.Prop2, @@ -104,9 +112,10 @@ public static /// Eleven-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9, int property10, double property11)> ElevenProperties( + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9, int Property10, double Property11)> ElevenProperties( BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -124,9 +133,10 @@ public static /// Twelve-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9, int property10, double property11, bool property12)> + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9, int Property10, double Property11, bool Property12)> TwelveProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -145,9 +155,10 @@ public static /// Thirteen-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13)> ThirteenProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13)> ThirteenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, x => x.Prop2, @@ -166,9 +177,10 @@ public static /// Fourteen-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13, int property14)> FourteenProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13, int Property14)> FourteenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, x => x.Prop2, @@ -188,9 +200,10 @@ public static /// Fifteen-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13, int property14, double property15)> FifteenProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13, int Property14, double Property15)> FifteenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, x => x.Prop2, @@ -211,9 +224,10 @@ public static /// Sixteen-property observation using WhenAnyValue returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13, int property14, double property15, bool property16)> SixteenProperties( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13, int Property14, double Property15, bool Property16)> SixteenProperties( BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -236,6 +250,7 @@ public static /// Four-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FourProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -247,6 +262,7 @@ public static IObservable WithSelector_FourProperties(BigViewModel vm) = /// Five-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FiveProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -259,6 +275,7 @@ public static IObservable WithSelector_FiveProperties(BigViewModel vm) = /// Six-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_SixProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -272,6 +289,7 @@ public static IObservable WithSelector_SixProperties(BigViewModel vm) => /// Seven-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_SevenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -286,6 +304,7 @@ public static IObservable WithSelector_SevenProperties(BigViewModel vm) /// Eight-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_EightProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -301,6 +320,7 @@ public static IObservable WithSelector_EightProperties(BigViewModel vm) /// Nine-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_NineProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -317,6 +337,7 @@ public static IObservable WithSelector_NineProperties(BigViewModel vm) = /// Ten-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_TenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -334,6 +355,7 @@ public static IObservable WithSelector_TenProperties(BigViewModel vm) => /// Eleven-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_ElevenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -353,6 +375,7 @@ public static IObservable WithSelector_ElevenProperties(BigViewModel vm) /// Twelve-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_TwelveProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -373,6 +396,7 @@ public static IObservable WithSelector_TwelveProperties(BigViewModel vm) /// Thirteen-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_ThirteenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -394,6 +418,7 @@ public static IObservable WithSelector_ThirteenProperties(BigViewModel v /// Fourteen-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FourteenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -416,6 +441,7 @@ public static IObservable WithSelector_FourteenProperties(BigViewModel v /// Fifteen-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FifteenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -439,6 +465,7 @@ public static IObservable WithSelector_FifteenProperties(BigViewModel vm /// Sixteen-property observation with a selector using WhenAnyValue. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_SixteenProperties(BigViewModel vm) => vm.WhenAnyValue( x => x.Prop1, @@ -463,6 +490,7 @@ public static IObservable WithSelector_SixteenProperties(BigViewModel vm /// Deep property chain observation on BigViewModel.Address.City using WhenAnyValue. /// The view model to observe. /// An observable of the nested City property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_AddressCity(BigViewModel vm) => vm.WhenAnyValue(x => x.Address.City); @@ -472,9 +500,10 @@ public static IObservable DeepChain_AddressCity(BigViewModel vm) => /// /// The fixture to observe. /// An observable of a 12-string tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string v1, string v2, string v3, string v4, string v5, string v6, string v7, string v8, string v9, - string v10, string v11, string v12)> TwelveProperties_AllStrings(WhenAnyTestFixture fixture) => + IObservable<(string V1, string V2, string V3, string V4, string V5, string V6, string V7, string V8, string V9, + string V10, string V11, string V12)> TwelveProperties_AllStrings(WhenAnyTestFixture fixture) => fixture.WhenAnyValue( x => x.Value1, x => x.Value2, diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyValueScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyValueScenarios.cs index f2f66bce..b37a4e5e 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyValueScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenAnyValueScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,31 +17,36 @@ public static class WhenAnyValueScenarios /// Single property observation using WhenAnyValue. /// The fixture to observe. /// An observable of the Value1 property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable SingleProperty(WhenAnyTestFixture fixture) => fixture.WhenAnyValue(x => x.Value1); /// Two-property observation using WhenAnyValue returning a tuple. /// The fixture to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, string property2)> TwoProperties(WhenAnyTestFixture fixture) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, string Property2)> TwoProperties(WhenAnyTestFixture fixture) => fixture.WhenAnyValue(x => x.Value1, x => x.Value2); /// Three-property observation using WhenAnyValue returning a tuple. /// The fixture to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, string property2, string property3)> ThreeProperties( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, string Property2, string Property3)> ThreeProperties( WhenAnyTestFixture fixture) => fixture.WhenAnyValue(x => x.Value1, x => x.Value2, x => x.Value3); /// Two-property observation with a selector using WhenAnyValue. /// The fixture to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_TwoProperties(WhenAnyTestFixture fixture) => fixture.WhenAnyValue(x => x.Value1, x => x.Value2, static (v1, v2) => $"{v1}_{v2}"); /// Deep property chain observation using WhenAnyValue on BigViewModel.Address.City. /// The view model to observe. /// An observable of the nested City property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_AddressCity(BigViewModel vm) => vm.WhenAnyValue(x => x.Address.City); @@ -50,18 +56,21 @@ public static IObservable DeepChain_AddressCity(BigViewModel vm) => /// /// The host fixture to observe. /// An observable of the nested Name property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_ChildName(HostTestFixture host) => host.WhenAnyValue(x => x.Child!.Name); /// Three-link property chain observation on HostTestFixture.Child!.Child!.Name. /// The host fixture to observe. /// An observable of the nested grandchild Name property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_GrandchildName(HostTestFixture host) => host.WhenAnyValue(x => x.Child!.Child!.Name); /// Deep property chain observation on HostTestFixture.Child!.Age. /// The host fixture to observe. /// An observable of the nested Age property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_ChildAge(HostTestFixture host) => host.WhenAnyValue(x => x.Child!.Age); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangedExtendedScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangedExtendedScenarios.cs index 4e0f6d91..cef3ad47 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangedExtendedScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangedExtendedScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,24 +17,27 @@ public static class WhenChangedExtendedScenarios /// Five-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5)> + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5)> FiveProperties(BigViewModel vm) => vm.WhenChanged(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4, x => x.Prop5); /// Six-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6)> + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6)> SixProperties(BigViewModel vm) => vm.WhenChanged(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4, x => x.Prop5, x => x.Prop6); /// Seven-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7)> SevenProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7)> SevenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, x => x.Prop2, @@ -46,9 +50,10 @@ public static /// Eight-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8)> EightProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8)> EightProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, x => x.Prop2, @@ -62,9 +67,10 @@ public static /// Nine-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9)> NineProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9)> NineProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, x => x.Prop2, @@ -79,9 +85,10 @@ public static /// Ten-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9, int property10)> TenProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9, int Property10)> TenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, x => x.Prop2, @@ -97,9 +104,10 @@ public static /// Eleven-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9, int property10, double property11)> ElevenProperties( + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9, int Property10, double Property11)> ElevenProperties( BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -117,9 +125,10 @@ public static /// Twelve-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9, int property10, double property11, bool property12)> + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9, int Property10, double Property11, bool Property12)> TwelveProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -138,9 +147,10 @@ public static /// Thirteen-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13)> ThirteenProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13)> ThirteenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, x => x.Prop2, @@ -159,9 +169,10 @@ public static /// Fourteen-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13, int property14)> FourteenProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13, int Property14)> FourteenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, x => x.Prop2, @@ -181,9 +192,10 @@ public static /// Fifteen-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13, int property14, double property15)> FifteenProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13, int Property14, double Property15)> FifteenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, x => x.Prop2, @@ -204,9 +216,10 @@ public static /// Sixteen-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13, int property14, double property15, bool property16)> SixteenProperties( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13, int Property14, double Property15, bool Property16)> SixteenProperties( BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -229,6 +242,7 @@ public static /// Five-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FiveProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -241,6 +255,7 @@ public static IObservable WithSelector_FiveProperties(BigViewModel vm) = /// Six-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_SixProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -254,6 +269,7 @@ public static IObservable WithSelector_SixProperties(BigViewModel vm) => /// Seven-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_SevenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -268,6 +284,7 @@ public static IObservable WithSelector_SevenProperties(BigViewModel vm) /// Eight-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_EightProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -283,6 +300,7 @@ public static IObservable WithSelector_EightProperties(BigViewModel vm) /// Nine-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_NineProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -299,6 +317,7 @@ public static IObservable WithSelector_NineProperties(BigViewModel vm) = /// Ten-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_TenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -316,6 +335,7 @@ public static IObservable WithSelector_TenProperties(BigViewModel vm) => /// Eleven-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_ElevenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -335,6 +355,7 @@ public static IObservable WithSelector_ElevenProperties(BigViewModel vm) /// Twelve-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_TwelveProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -355,6 +376,7 @@ public static IObservable WithSelector_TwelveProperties(BigViewModel vm) /// Thirteen-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_ThirteenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -376,6 +398,7 @@ public static IObservable WithSelector_ThirteenProperties(BigViewModel v /// Fourteen-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FourteenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -398,6 +421,7 @@ public static IObservable WithSelector_FourteenProperties(BigViewModel v /// Fifteen-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FifteenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, @@ -421,6 +445,7 @@ public static IObservable WithSelector_FifteenProperties(BigViewModel vm /// Sixteen-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_SixteenProperties(BigViewModel vm) => vm.WhenChanged( x => x.Prop1, diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangedScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangedScenarios.cs index 4f8e65b5..68d26625 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangedScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangedScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,43 +17,50 @@ public static class WhenChangedScenarios /// Single property observation on TestViewModel.Name. /// The view model to observe. /// An observable of the Name property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable SingleProperty_Name(TestViewModel vm) => vm.WhenChanged(x => x.Name); /// Single property observation on TestViewModel.Age. /// The view model to observe. /// An observable of the Age property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable SingleProperty_Age(TestViewModel vm) => vm.WhenChanged(x => x.Age); /// Two-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2)> TwoProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2)> TwoProperties(BigViewModel vm) => vm.WhenChanged(x => x.Prop1, x => x.Prop2); /// Three-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3)> ThreeProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3)> ThreeProperties(BigViewModel vm) => vm.WhenChanged(x => x.Prop1, x => x.Prop2, x => x.Prop3); /// Four-property observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple. - public static IObservable<(string property1, int property2, double property3, bool property4)> FourProperties( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4)> FourProperties( BigViewModel vm) => vm.WhenChanged(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4); /// Two-property observation with a selector function. /// The view model to observe. /// An observable of the combined string value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_TwoProperties(BigViewModel vm) => vm.WhenChanged(x => x.Prop1, x => x.Prop2, static (p1, p2) => $"{p1}_{p2}"); /// Deep property chain observation on BigViewModel.Address.City. /// The view model to observe. /// An observable of the nested City property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_AddressCity(BigViewModel vm) => vm.WhenChanged(x => x.Address.City); @@ -62,6 +70,7 @@ public static IObservable DeepChain_AddressCity(BigViewModel vm) => /// /// The view model to observe. /// An observable of the nested Street property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_AddressStreet(BigViewModel vm) => vm.WhenChanged(x => x.Address.Street); @@ -71,12 +80,14 @@ public static IObservable DeepChain_AddressStreet(BigViewModel vm) => /// /// The host fixture to observe. /// An observable of the nested Name property value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_ChildName(HostTestFixture host) => host.WhenChanged(x => x.Child!.Name); /// Multi-property observation combining a deep chain and a simple property. /// The view model to observe. /// An observable of the combined property values. - public static IObservable<(string city, string prop1)> MultiProperty_WithDeepChain(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string City, string Prop1)> MultiProperty_WithDeepChain(BigViewModel vm) => vm.WhenChanged(x => x.Address.City, x => x.Prop1); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangingExtendedScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangingExtendedScenarios.cs index b2056d18..33b119e5 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangingExtendedScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangingExtendedScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,24 +17,27 @@ public static class WhenChangingExtendedScenarios /// Five-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5)> + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5)> FiveProperties(BigViewModel vm) => vm.WhenChanging(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4, x => x.Prop5); /// Six-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6)> + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6)> SixProperties(BigViewModel vm) => vm.WhenChanging(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4, x => x.Prop5, x => x.Prop6); /// Seven-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7)> SevenProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7)> SevenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, x => x.Prop2, @@ -46,9 +50,10 @@ public static /// Eight-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8)> EightProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8)> EightProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, x => x.Prop2, @@ -62,9 +67,10 @@ public static /// Nine-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9)> NineProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9)> NineProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, x => x.Prop2, @@ -79,9 +85,10 @@ public static /// Ten-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9, int property10)> TenProperties(BigViewModel vm) => + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9, int Property10)> TenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, x => x.Prop2, @@ -97,9 +104,10 @@ public static /// Eleven-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9, int property10, double property11)> ElevenProperties( + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9, int Property10, double Property11)> ElevenProperties( BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -117,9 +125,10 @@ public static /// Twelve-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static - IObservable<(string property1, int property2, double property3, bool property4, string property5, int property6, - double property7, bool property8, string property9, int property10, double property11, bool property12)> + IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int Property6, + double Property7, bool Property8, string Property9, int Property10, double Property11, bool Property12)> TwelveProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -138,9 +147,10 @@ public static /// Thirteen-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13)> ThirteenProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13)> ThirteenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, x => x.Prop2, @@ -159,9 +169,10 @@ public static /// Fourteen-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13, int property14)> FourteenProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13, int Property14)> FourteenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, x => x.Prop2, @@ -181,9 +192,10 @@ public static /// Fifteen-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13, int property14, double property15)> FifteenProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13, int Property14, double Property15)> FifteenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, x => x.Prop2, @@ -204,9 +216,10 @@ public static /// Sixteen-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. - public static IObservable<(string property1, int property2, double property3, bool property4, string property5, int - property6, double property7, bool property8, string property9, int property10, double property11, bool - property12, string property13, int property14, double property15, bool property16)> SixteenProperties( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4, string Property5, int + Property6, double Property7, bool Property8, string Property9, int Property10, double Property11, bool + Property12, string Property13, int Property14, double Property15, bool Property16)> SixteenProperties( BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -229,6 +242,7 @@ public static /// Five-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FiveProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -241,6 +255,7 @@ public static IObservable WithSelector_FiveProperties(BigViewModel vm) = /// Six-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_SixProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -254,6 +269,7 @@ public static IObservable WithSelector_SixProperties(BigViewModel vm) => /// Seven-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_SevenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -268,6 +284,7 @@ public static IObservable WithSelector_SevenProperties(BigViewModel vm) /// Eight-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_EightProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -283,6 +300,7 @@ public static IObservable WithSelector_EightProperties(BigViewModel vm) /// Nine-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_NineProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -299,6 +317,7 @@ public static IObservable WithSelector_NineProperties(BigViewModel vm) = /// Ten-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_TenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -316,6 +335,7 @@ public static IObservable WithSelector_TenProperties(BigViewModel vm) => /// Eleven-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_ElevenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -335,6 +355,7 @@ public static IObservable WithSelector_ElevenProperties(BigViewModel vm) /// Twelve-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_TwelveProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -355,6 +376,7 @@ public static IObservable WithSelector_TwelveProperties(BigViewModel vm) /// Thirteen-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_ThirteenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -376,6 +398,7 @@ public static IObservable WithSelector_ThirteenProperties(BigViewModel v /// Fourteen-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FourteenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -398,6 +421,7 @@ public static IObservable WithSelector_FourteenProperties(BigViewModel v /// Fifteen-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_FifteenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -421,6 +445,7 @@ public static IObservable WithSelector_FifteenProperties(BigViewModel vm /// Sixteen-property before-change observation with a selector function. /// The view model to observe. /// An observable of the combined string value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable WithSelector_SixteenProperties(BigViewModel vm) => vm.WhenChanging( x => x.Prop1, @@ -445,6 +470,7 @@ public static IObservable WithSelector_SixteenProperties(BigViewModel vm /// Deep property chain before-change observation on BigViewModel.Address.City. /// The view model to observe. /// An observable of the nested City property value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_AddressCity(BigViewModel vm) => vm.WhenChanging(x => x.Address.City); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangingScenarios.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangingScenarios.cs index 89ae2316..b3d64216 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangingScenarios.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.TestModels/Scenarios/WhenChangingScenarios.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.GeneratedCode.TestModels.TestModels; namespace ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -16,37 +17,43 @@ public static class WhenChangingScenarios /// Single property before-change observation on TestViewModel.Name. /// The view model to observe. /// An observable of the Name property value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable SingleProperty_Name(TestViewModel vm) => vm.WhenChanging(x => x.Name); /// Single property before-change observation on BigViewModel.Prop1. /// The view model to observe. /// An observable of the Prop1 property value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable SingleProperty_Prop1(BigViewModel vm) => vm.WhenChanging(x => x.Prop1); /// Two-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. - public static IObservable<(string property1, int property2)> TwoProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2)> TwoProperties(BigViewModel vm) => vm.WhenChanging(x => x.Prop1, x => x.Prop2); /// Three-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. - public static IObservable<(string property1, int property2, double property3)> ThreeProperties(BigViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3)> ThreeProperties(BigViewModel vm) => vm.WhenChanging(x => x.Prop1, x => x.Prop2, x => x.Prop3); /// Four-property before-change observation returning a tuple. /// The view model to observe. /// An observable of the property value tuple before changes. - public static IObservable<(string property1, int property2, double property3, bool property4)> FourProperties( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IObservable<(string Property1, int Property2, double Property3, bool Property4)> FourProperties( BigViewModel vm) => vm.WhenChanging(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4); /// Deep property chain before-change observation on BigViewModel.Address.City. /// The view model to observe. /// An observable of the nested City property value before changes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable DeepChain_AddressCity(BigViewModel vm) => vm.WhenChanging(x => x.Address.City); } diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/Binding/BindCommandTests.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/Binding/BindCommandTests.cs index c88e9d4b..d23e1e5e 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/Binding/BindCommandTests.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/Binding/BindCommandTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Windows.Input; using ReactiveUI.Binding.GeneratedCode.TestModels.Scenarios; @@ -66,8 +67,7 @@ public async Task BasicNoParam_NullCommand_ClickDoesNotThrow() using var binding = BindCommandScenarios.BasicNoParam(vm, view); - var action = view.SaveButton.PerformClick; - await Assert.That(action).ThrowsNothing(); + await Assert.That((Action)view.SaveButton.PerformClick).ThrowsNothing(); } /// Verifies that when the command changes, the new command is executed on click. @@ -220,8 +220,7 @@ public async Task BasicNoParam_CommandSetToNull_ClickDoesNotThrow() using var binding = BindCommandScenarios.BasicNoParam(vm, view); vm.Save = null; - var action = view.SaveButton.PerformClick; - await Assert.That(action).ThrowsNothing(); + await Assert.That((Action)view.SaveButton.PerformClick).ThrowsNothing(); await Assert.That(command.ExecuteCount).IsEqualTo(0); } @@ -315,8 +314,7 @@ public async Task BasicNoParam_DoubleDispose_DoesNotThrow() var binding = BindCommandScenarios.BasicNoParam(vm, view); binding.Dispose(); - var action = binding.Dispose; - await Assert.That(action).ThrowsNothing(); + await Assert.That((Action)binding.Dispose).ThrowsNothing(); } // ── EventEnabled (Click + Enabled, no Command property) ───────────── @@ -587,6 +585,7 @@ public event EventHandler? CanExecuteChanged public object? LastParameter { get; private set; } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool CanExecute(object? parameter) => CanExecuteResult; /// diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/Binding/BindInteractionTests.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/Binding/BindInteractionTests.cs index 36b9d503..69311adc 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/Binding/BindInteractionTests.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/Binding/BindInteractionTests.cs @@ -193,8 +193,7 @@ public async Task TaskHandler_DoubleDispose_DoesNotThrow() var binding = BindInteractionScenarios.TaskHandler(vm, view); binding.Dispose(); - var action = binding.Dispose; - await Assert.That(action).ThrowsNothing(); + await Assert.That((Action)binding.Dispose).ThrowsNothing(); } /// Verifies that the interaction binding handles multiple sequential Handle calls correctly. diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenAnyValue/WhenAnyValueEdgeCaseTests.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenAnyValue/WhenAnyValueEdgeCaseTests.cs index 8b419874..3ce82974 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenAnyValue/WhenAnyValueEdgeCaseTests.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenAnyValue/WhenAnyValueEdgeCaseTests.cs @@ -66,7 +66,7 @@ public async Task Disposal_StopsListening() public async Task TwoProperties_EmitsOnEitherChange() { var fixture = new WhenAnyTestFixture { Value1 = "A", Value2 = "B" }; - var values = new List<(string property1, string property2)>(); + var values = new List<(string Property1, string Property2)>(); using var sub = WhenAnyValueScenarios.TwoProperties(fixture) .Subscribe(values.Add); @@ -75,13 +75,13 @@ public async Task TwoProperties_EmitsOnEitherChange() fixture.Value1 = "C"; - await Assert.That(values[^1].property1).IsEqualTo("C"); - await Assert.That(values[^1].property2).IsEqualTo("B"); + await Assert.That(values[^1].Property1).IsEqualTo("C"); + await Assert.That(values[^1].Property2).IsEqualTo("B"); fixture.Value2 = "D"; - await Assert.That(values[^1].property1).IsEqualTo("C"); - await Assert.That(values[^1].property2).IsEqualTo("D"); + await Assert.That(values[^1].Property1).IsEqualTo("C"); + await Assert.That(values[^1].Property2).IsEqualTo("D"); } /// Verifies that deep chain WhenAnyValue emits the nested property value. diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenAnyValue/WhenAnyValueTests.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenAnyValue/WhenAnyValueTests.cs index 52c69375..73e60cef 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenAnyValue/WhenAnyValueTests.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenAnyValue/WhenAnyValueTests.cs @@ -48,14 +48,14 @@ public async Task SingleProperty_EmitsInitialAndChanges() public async Task TwoProperties_EmitsTuples() { var fixture = new WhenAnyTestFixture { Value1 = "A", Value2 = "B" }; - var values = new List<(string property1, string property2)>(); + var values = new List<(string Property1, string Property2)>(); using var sub = WhenAnyValueScenarios.TwoProperties(fixture) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("A"); - await Assert.That(values[0].property2).IsEqualTo("B"); + await Assert.That(values[0].Property1).IsEqualTo("A"); + await Assert.That(values[0].Property2).IsEqualTo("B"); } /// Verifies that three-property WhenAnyValue emits tuples. @@ -64,15 +64,15 @@ public async Task TwoProperties_EmitsTuples() public async Task ThreeProperties_EmitsTuples() { var fixture = new WhenAnyTestFixture { Value1 = "A", Value2 = "B", Value3 = "C" }; - var values = new List<(string property1, string property2, string property3)>(); + var values = new List<(string Property1, string Property2, string Property3)>(); using var sub = WhenAnyValueScenarios.ThreeProperties(fixture) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("A"); - await Assert.That(values[0].property2).IsEqualTo("B"); - await Assert.That(values[0].property3).IsEqualTo("C"); + await Assert.That(values[0].Property1).IsEqualTo("A"); + await Assert.That(values[0].Property2).IsEqualTo("B"); + await Assert.That(values[0].Property3).IsEqualTo("C"); } /// Verifies that WhenAnyValue with a selector projects values correctly. diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangedEdgeCaseTests.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangedEdgeCaseTests.cs index 9bfeb7d1..0e720ef7 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangedEdgeCaseTests.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangedEdgeCaseTests.cs @@ -147,20 +147,20 @@ public async Task MultiProperty_WithDeepChain_EmitsOnNestedChange() { var vm = new BigViewModel { Prop1 = HelloValue }; vm.Address.City = Seattle; - var values = new List<(string city, string prop1)>(); + var values = new List<(string City, string Prop1)>(); using var sub = WhenChangedScenarios.MultiProperty_WithDeepChain(vm) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].city).IsEqualTo(Seattle); - await Assert.That(values[0].prop1).IsEqualTo(HelloValue); + await Assert.That(values[0].City).IsEqualTo(Seattle); + await Assert.That(values[0].Prop1).IsEqualTo(HelloValue); // Change the nested property vm.Address.City = Portland; - await Assert.That(values[^1].city).IsEqualTo(Portland); - await Assert.That(values[^1].prop1).IsEqualTo(HelloValue); + await Assert.That(values[^1].City).IsEqualTo(Portland); + await Assert.That(values[^1].Prop1).IsEqualTo(HelloValue); } /// Verifies that multi-property observation with a deep chain emits when the simple property changes. @@ -170,7 +170,7 @@ public async Task MultiProperty_WithDeepChain_EmitsOnSimpleChange() { var vm = new BigViewModel { Prop1 = HelloValue }; vm.Address.City = Seattle; - var values = new List<(string city, string prop1)>(); + var values = new List<(string City, string Prop1)>(); using var sub = WhenChangedScenarios.MultiProperty_WithDeepChain(vm) .Subscribe(values.Add); @@ -178,8 +178,8 @@ public async Task MultiProperty_WithDeepChain_EmitsOnSimpleChange() // Change the simple property vm.Prop1 = "World"; - await Assert.That(values[^1].city).IsEqualTo(Seattle); - await Assert.That(values[^1].prop1).IsEqualTo("World"); + await Assert.That(values[^1].City).IsEqualTo(Seattle); + await Assert.That(values[^1].Prop1).IsEqualTo("World"); } /// Verifies that multi-property observation with a deep chain re-subscribes when the intermediate object is replaced. @@ -189,7 +189,7 @@ public async Task MultiProperty_WithDeepChain_IntermediateReplacement() { var vm = new BigViewModel { Prop1 = HelloValue }; vm.Address.City = Seattle; - var values = new List<(string city, string prop1)>(); + var values = new List<(string City, string Prop1)>(); using var sub = WhenChangedScenarios.MultiProperty_WithDeepChain(vm) .Subscribe(values.Add); @@ -197,12 +197,12 @@ public async Task MultiProperty_WithDeepChain_IntermediateReplacement() // Replace the intermediate object vm.Address = new() { City = Portland }; - await Assert.That(values[^1].city).IsEqualTo(Portland); + await Assert.That(values[^1].City).IsEqualTo(Portland); // Change the new object's property vm.Address.City = Eugene; - await Assert.That(values[^1].city).IsEqualTo(Eugene); + await Assert.That(values[^1].City).IsEqualTo(Eugene); } /// Verifies that multiple subscriptions to the same WhenChanged observable each receive independent emissions. diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangedTests.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangedTests.cs index b5a8d650..ddb1ad1b 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangedTests.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangedTests.cs @@ -115,14 +115,14 @@ public async Task SingleProperty_EmitsSequentialChanges() public async Task TwoProperties_EmitsInitialTuple() { var vm = new BigViewModel { Prop1 = HelloValue, Prop2 = TwoPropIntValue }; - var values = new List<(string property1, int property2)>(); + var values = new List<(string Property1, int Property2)>(); using var sub = WhenChangedScenarios.TwoProperties(vm) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo(HelloValue); - await Assert.That(values[0].property2).IsEqualTo(TwoPropIntValue); + await Assert.That(values[0].Property1).IsEqualTo(HelloValue); + await Assert.That(values[0].Property2).IsEqualTo(TwoPropIntValue); } /// Verifies that a two-property WhenChanged emits when either property changes. @@ -131,7 +131,7 @@ public async Task TwoProperties_EmitsInitialTuple() public async Task TwoProperties_EmitsOnEitherChange() { var vm = new BigViewModel { Prop1 = "A", Prop2 = 1 }; - var values = new List<(string property1, int property2)>(); + var values = new List<(string Property1, int Property2)>(); using var sub = WhenChangedScenarios.TwoProperties(vm) .Subscribe(values.Add); @@ -139,14 +139,14 @@ public async Task TwoProperties_EmitsOnEitherChange() vm.Prop1 = "B"; await Assert.That(values.Count).IsGreaterThanOrEqualTo(MinEmissionsAfterChange); - await Assert.That(values[^1].property1).IsEqualTo("B"); - await Assert.That(values[^1].property2).IsEqualTo(1); + await Assert.That(values[^1].Property1).IsEqualTo("B"); + await Assert.That(values[^1].Property2).IsEqualTo(1); vm.Prop2 = UpdatedIntValue; await Assert.That(values.Count).IsGreaterThanOrEqualTo(MinEmissionsAfterTwoChanges); - await Assert.That(values[^1].property1).IsEqualTo("B"); - await Assert.That(values[^1].property2).IsEqualTo(UpdatedIntValue); + await Assert.That(values[^1].Property1).IsEqualTo("B"); + await Assert.That(values[^1].Property2).IsEqualTo(UpdatedIntValue); } /// Verifies that three-property WhenChanged emits initial values. @@ -155,15 +155,15 @@ public async Task TwoProperties_EmitsOnEitherChange() public async Task ThreeProperties_EmitsInitialValues() { var vm = new BigViewModel { Prop1 = "X", Prop2 = ThreePropIntValue, Prop3 = ThreePropDoubleValue }; - var values = new List<(string property1, int property2, double property3)>(); + var values = new List<(string Property1, int Property2, double Property3)>(); using var sub = WhenChangedScenarios.ThreeProperties(vm) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("X"); - await Assert.That(values[0].property2).IsEqualTo(ThreePropIntValue); - await Assert.That(values[0].property3).IsEqualTo(ThreePropDoubleValue); + await Assert.That(values[0].Property1).IsEqualTo("X"); + await Assert.That(values[0].Property2).IsEqualTo(ThreePropIntValue); + await Assert.That(values[0].Property3).IsEqualTo(ThreePropDoubleValue); } /// Verifies that four-property WhenChanged emits initial values. @@ -172,16 +172,16 @@ public async Task ThreeProperties_EmitsInitialValues() public async Task FourProperties_EmitsInitialValues() { var vm = new BigViewModel { Prop1 = "Y", Prop2 = FourPropIntValue, Prop3 = FourPropDoubleValue, Prop4 = true }; - var values = new List<(string property1, int property2, double property3, bool property4)>(); + var values = new List<(string Property1, int Property2, double Property3, bool Property4)>(); using var sub = WhenChangedScenarios.FourProperties(vm) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("Y"); - await Assert.That(values[0].property2).IsEqualTo(FourPropIntValue); - await Assert.That(values[0].property3).IsEqualTo(FourPropDoubleValue); - await Assert.That(values[0].property4).IsTrue(); + await Assert.That(values[0].Property1).IsEqualTo("Y"); + await Assert.That(values[0].Property2).IsEqualTo(FourPropIntValue); + await Assert.That(values[0].Property3).IsEqualTo(FourPropDoubleValue); + await Assert.That(values[0].Property4).IsTrue(); } /// Verifies that WhenChanged with a selector combines property values. diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangingEdgeCaseTests.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangingEdgeCaseTests.cs index 3cc2ce77..bf537e67 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangingEdgeCaseTests.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangingEdgeCaseTests.cs @@ -67,15 +67,15 @@ public async Task DeepChain_EmitsBeforeNestedChange() public async Task TwoProperties_EmitsOnEitherChange() { var vm = new BigViewModel { Prop1 = "A", Prop2 = 1 }; - var values = new List<(string property1, int property2)>(); + var values = new List<(string Property1, int Property2)>(); using var sub = WhenChangingScenarios.TwoProperties(vm) .Subscribe(values.Add); // Initial emission await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("A"); - await Assert.That(values[0].property2).IsEqualTo(1); + await Assert.That(values[0].Property1).IsEqualTo("A"); + await Assert.That(values[0].Property2).IsEqualTo(1); // Change Prop1 — should emit before-change values vm.Prop1 = "B"; @@ -83,8 +83,8 @@ public async Task TwoProperties_EmitsOnEitherChange() await Assert.That(values.Count).IsGreaterThanOrEqualTo(MinEmissionsAfterChange); // The before-change value for Prop1 should still be "A" - await Assert.That(values[1].property1).IsEqualTo("A"); - await Assert.That(values[1].property2).IsEqualTo(1); + await Assert.That(values[1].Property1).IsEqualTo("A"); + await Assert.That(values[1].Property2).IsEqualTo(1); } /// Verifies that disposing the WhenChanging deep chain subscription stops listening. @@ -113,7 +113,7 @@ public async Task DeepChain_Disposal_StopsListening() public async Task TwoProperties_SequentialChanges() { var vm = new BigViewModel { Prop1 = "A", Prop2 = 1 }; - var values = new List<(string property1, int property2)>(); + var values = new List<(string Property1, int Property2)>(); using var sub = WhenChangingScenarios.TwoProperties(vm) .Subscribe(values.Add); diff --git a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangingTests.cs b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangingTests.cs index e85f50ce..f9acb78c 100644 --- a/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangingTests.cs +++ b/src/tests/ReactiveUI.Binding.GeneratedCode.Tests/WhenChanged/WhenChangingTests.cs @@ -108,14 +108,14 @@ public async Task SingleProperty_EmitsSequentialBeforeChangeValues() public async Task TwoProperties_EmitsInitialTuple() { var vm = new BigViewModel { Prop1 = "Hello", Prop2 = TwoPropIntValue }; - var values = new List<(string property1, int property2)>(); + var values = new List<(string Property1, int Property2)>(); using var sub = WhenChangingScenarios.TwoProperties(vm) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("Hello"); - await Assert.That(values[0].property2).IsEqualTo(TwoPropIntValue); + await Assert.That(values[0].Property1).IsEqualTo("Hello"); + await Assert.That(values[0].Property2).IsEqualTo(TwoPropIntValue); } /// Verifies that three-property WhenChanging emits initial values. @@ -124,15 +124,15 @@ public async Task TwoProperties_EmitsInitialTuple() public async Task ThreeProperties_EmitsInitialValues() { var vm = new BigViewModel { Prop1 = "X", Prop2 = ThreePropIntValue, Prop3 = ThreePropDoubleValue }; - var values = new List<(string property1, int property2, double property3)>(); + var values = new List<(string Property1, int Property2, double Property3)>(); using var sub = WhenChangingScenarios.ThreeProperties(vm) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("X"); - await Assert.That(values[0].property2).IsEqualTo(ThreePropIntValue); - await Assert.That(values[0].property3).IsEqualTo(ThreePropDoubleValue); + await Assert.That(values[0].Property1).IsEqualTo("X"); + await Assert.That(values[0].Property2).IsEqualTo(ThreePropIntValue); + await Assert.That(values[0].Property3).IsEqualTo(ThreePropDoubleValue); } /// Verifies that four-property WhenChanging emits initial values. @@ -141,16 +141,16 @@ public async Task ThreeProperties_EmitsInitialValues() public async Task FourProperties_EmitsInitialValues() { var vm = new BigViewModel { Prop1 = "Y", Prop2 = FourPropIntValue, Prop3 = FourPropDoubleValue, Prop4 = true }; - var values = new List<(string property1, int property2, double property3, bool property4)>(); + var values = new List<(string Property1, int Property2, double Property3, bool Property4)>(); using var sub = WhenChangingScenarios.FourProperties(vm) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("Y"); - await Assert.That(values[0].property2).IsEqualTo(FourPropIntValue); - await Assert.That(values[0].property3).IsEqualTo(FourPropDoubleValue); - await Assert.That(values[0].property4).IsTrue(); + await Assert.That(values[0].Property1).IsEqualTo("Y"); + await Assert.That(values[0].Property2).IsEqualTo(FourPropIntValue); + await Assert.That(values[0].Property3).IsEqualTo(FourPropDoubleValue); + await Assert.That(values[0].Property4).IsTrue(); } /// Verifies that disposing the subscription stops listening for changes. diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.BasicNoParam#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.BasicNoParam#BindCommandDispatch.g.verified.cs index 0676bdad..1779460c 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.BasicNoParam#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.BasicNoParam#BindCommandDispatch.g.verified.cs @@ -30,13 +30,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_7FFFF69B2C59DF23(view, viewModel); + return __BindCommand_7FFFF69B2C59DF80(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_7FFFF69B2C59DF23( + private static global::System.IDisposable __BindCommand_7FFFF69B2C59DF80( global::SharedScenarios.BindCommand.BasicNoParam.MyView view, global::SharedScenarios.BindCommand.BasicNoParam.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback#BindCommandDispatch.g.verified.cs index a5f8d5a5..4fb6db69 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback#BindCommandDispatch.g.verified.cs @@ -24,16 +24,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 73 + if (callerLineNumber == 76 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindCommand_7FFFF69B2C59DF23(view, viewModel); + return __BindCommand_7FFFF69B2C59DF80(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_7FFFF69B2C59DF23( + private static global::System.IDisposable __BindCommand_7FFFF69B2C59DF80( global::SharedScenarios.BindCommand.BasicNoParam.MyView view, global::SharedScenarios.BindCommand.BasicNoParam.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback_ExpressionParam#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback_ExpressionParam#BindCommandDispatch.g.verified.cs index cfec9fbd..960b1513 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback_ExpressionParam#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback_ExpressionParam#BindCommandDispatch.g.verified.cs @@ -26,16 +26,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 92 + if (callerLineNumber == 95 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindCommand_7FFFEA737737D1B3(view, viewModel); + return __BindCommand_7FFFEA737737D210(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_7FFFEA737737D1B3( + private static global::System.IDisposable __BindCommand_7FFFEA737737D210( global::SharedScenarios.BindCommand.ExpressionParam.MyView view, global::SharedScenarios.BindCommand.ExpressionParam.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback_ObservableParam#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback_ObservableParam#BindCommandDispatch.g.verified.cs index f730ac9d..ea3e4490 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback_ObservableParam#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CFPFallback_ObservableParam#BindCommandDispatch.g.verified.cs @@ -25,16 +25,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 74 + if (callerLineNumber == 77 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindCommand_00000F3AD26C974E(view, viewModel, withParameter); + return __BindCommand_00000F3AD26C97AB(view, viewModel, withParameter); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_00000F3AD26C974E( + private static global::System.IDisposable __BindCommand_00000F3AD26C97AB( global::SharedScenarios.BindCommand.ObservableParam.MyView view, global::SharedScenarios.BindCommand.ObservableParam.MyViewModel viewModel, global::System.IObservable withParameter) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandProperty#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandProperty#BindCommandDispatch.g.verified.cs index 791849d2..266548a7 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandProperty#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandProperty#BindCommandDispatch.g.verified.cs @@ -30,13 +30,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_00000A6C4A2CDD6C(view, viewModel); + return __BindCommand_00000A6C4A2CDDAA(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_00000A6C4A2CDD6C( + private static global::System.IDisposable __BindCommand_00000A6C4A2CDDAA( global::SharedScenarios.BindCommand.CommandProperty.MyView view, global::SharedScenarios.BindCommand.CommandProperty.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandPropertyExprParam#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandPropertyExprParam#BindCommandDispatch.g.verified.cs index e9f17c0c..d95e53e6 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandPropertyExprParam#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandPropertyExprParam#BindCommandDispatch.g.verified.cs @@ -32,13 +32,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_00000CE640706F39(view, viewModel); + return __BindCommand_00000CE640706F77(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_00000CE640706F39( + private static global::System.IDisposable __BindCommand_00000CE640706F77( global::SharedScenarios.BindCommand.CommandPropertyExprParam.MyView view, global::SharedScenarios.BindCommand.CommandPropertyExprParam.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandPropertyObsParam#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandPropertyObsParam#BindCommandDispatch.g.verified.cs index 088849be..8c765286 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandPropertyObsParam#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CommandPropertyObsParam#BindCommandDispatch.g.verified.cs @@ -31,13 +31,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_000025BD0B2B0110(view, viewModel, withParameter); + return __BindCommand_000025BD0B2B014E(view, viewModel, withParameter); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_000025BD0B2B0110( + private static global::System.IDisposable __BindCommand_000025BD0B2B014E( global::SharedScenarios.BindCommand.CommandPropertyObsParam.MyView view, global::SharedScenarios.BindCommand.CommandPropertyObsParam.MyViewModel viewModel, global::System.IObservable withParameter) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CustomEvent#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CustomEvent#BindCommandDispatch.g.verified.cs index 43a5e448..f13fd6d0 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CustomEvent#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.CustomEvent#BindCommandDispatch.g.verified.cs @@ -30,13 +30,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_000010E32465707C(view, viewModel); + return __BindCommand_000010E3246570D9(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_000010E32465707C( + private static global::System.IDisposable __BindCommand_000010E3246570D9( global::SharedScenarios.BindCommand.CustomEvent.MyView view, global::SharedScenarios.BindCommand.CustomEvent.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.DeepCommandPath#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.DeepCommandPath#BindCommandDispatch.g.verified.cs index 52c981d4..accb89d7 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.DeepCommandPath#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.DeepCommandPath#BindCommandDispatch.g.verified.cs @@ -30,13 +30,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Child!.SaveCommand" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_7FFFEA7C178C3514(view, viewModel); + return __BindCommand_7FFFEA7C178C3571(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_7FFFEA7C178C3514( + private static global::System.IDisposable __BindCommand_7FFFEA7C178C3571( global::SharedScenarios.BindCommand.DeepCommandPath.MyView view, global::SharedScenarios.BindCommand.DeepCommandPath.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabled#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabled#BindCommandDispatch.g.verified.cs index 4112b196..ae811f2e 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabled#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabled#BindCommandDispatch.g.verified.cs @@ -30,13 +30,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_0000372503979B7B(view, viewModel); + return __BindCommand_0000372503979BB9(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_0000372503979B7B( + private static global::System.IDisposable __BindCommand_0000372503979BB9( global::SharedScenarios.BindCommand.EventEnabled.MyView view, global::SharedScenarios.BindCommand.EventEnabled.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabledExprParam#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabledExprParam#BindCommandDispatch.g.verified.cs index 0c6dbb0d..d532a94b 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabledExprParam#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabledExprParam#BindCommandDispatch.g.verified.cs @@ -32,13 +32,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_00001A92FB3E1A3A(view, viewModel); + return __BindCommand_00001A92FB3E1A78(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_00001A92FB3E1A3A( + private static global::System.IDisposable __BindCommand_00001A92FB3E1A78( global::SharedScenarios.BindCommand.EventEnabledExprParam.MyView view, global::SharedScenarios.BindCommand.EventEnabledExprParam.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabledObsParam#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabledObsParam#BindCommandDispatch.g.verified.cs index 740a5952..ebfd623e 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabledObsParam#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.EventEnabledObsParam#BindCommandDispatch.g.verified.cs @@ -31,13 +31,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_00001723A43D0325(view, viewModel, withParameter); + return __BindCommand_00001723A43D0363(view, viewModel, withParameter); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_00001723A43D0325( + private static global::System.IDisposable __BindCommand_00001723A43D0363( global::SharedScenarios.BindCommand.EventEnabledObsParam.MyView view, global::SharedScenarios.BindCommand.EventEnabledObsParam.MyViewModel viewModel, global::System.IObservable withParameter) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.ExpressionParam#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.ExpressionParam#BindCommandDispatch.g.verified.cs index 97187f61..c9f8e0ad 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.ExpressionParam#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.ExpressionParam#BindCommandDispatch.g.verified.cs @@ -32,13 +32,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_7FFFEA737737D1B3(view, viewModel); + return __BindCommand_7FFFEA737737D210(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_7FFFEA737737D1B3( + private static global::System.IDisposable __BindCommand_7FFFEA737737D210( global::SharedScenarios.BindCommand.ExpressionParam.MyView view, global::SharedScenarios.BindCommand.ExpressionParam.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.NoEvent#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.NoEvent#BindCommandDispatch.g.verified.cs index 2b8a253b..3632b603 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.NoEvent#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.NoEvent#BindCommandDispatch.g.verified.cs @@ -30,13 +30,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.Label") { - return __BindCommand_000006F07B8E70B0(view, viewModel); + return __BindCommand_000006F07B8E70EE(view, viewModel); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_000006F07B8E70B0( + private static global::System.IDisposable __BindCommand_000006F07B8E70EE( global::SharedScenarios.BindCommand.NoEvent.MyView view, global::SharedScenarios.BindCommand.NoEvent.MyViewModel viewModel) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.ObservableParam#BindCommandDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.ObservableParam#BindCommandDispatch.g.verified.cs index 49cd777f..d0f11f67 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.ObservableParam#BindCommandDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BCG.ObservableParam#BindCommandDispatch.g.verified.cs @@ -31,13 +31,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Save" && controlNameExpression == "x => x.SaveButton") { - return __BindCommand_00000F3AD26C974E(view, viewModel, withParameter); + return __BindCommand_00000F3AD26C97AB(view, viewModel, withParameter); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindCommand_00000F3AD26C974E( + private static global::System.IDisposable __BindCommand_00000F3AD26C97AB( global::SharedScenarios.BindCommand.ObservableParam.MyView view, global::SharedScenarios.BindCommand.ObservableParam.MyViewModel viewModel, global::System.IObservable withParameter) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.2STB_GEI#BindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.2STB_GEI#BindDispatch.g.verified.cs index a42ea6ce..dfc40396 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.2STB_GEI#BindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.2STB_GEI#BindDispatch.g.verified.cs @@ -13,7 +13,7 @@ internal static partial class __ReactiveUIGeneratedBindings /// Concrete typed overload for Bind from global::SharedScenarios.Bind.TwoSameTypeBindings.MyViewModel to global::SharedScenarios.Bind.TwoSameTypeBindings.MyView. /// Uses CallerArgumentExpression for dispatch. /// - public static global::ReactiveUI.Binding.IReactiveBinding Bind( + public static global::ReactiveUI.Binding.IReactiveBinding Bind( this global::SharedScenarios.Bind.TwoSameTypeBindings.MyView view, global::SharedScenarios.Bind.TwoSameTypeBindings.MyViewModel viewModel, global::System.Linq.Expressions.Expression> viewModelProperty, @@ -37,7 +37,7 @@ internal static partial class __ReactiveUIGeneratedBindings "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFE38A2E1A448A(global::SharedScenarios.Bind.TwoSameTypeBindings.MyViewModel viewModel, global::SharedScenarios.Bind.TwoSameTypeBindings.MyView view) + private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFE38A2E1A448A(global::SharedScenarios.Bind.TwoSameTypeBindings.MyViewModel viewModel, global::SharedScenarios.Bind.TwoSameTypeBindings.MyView view) { // Bind: FirstName <-> FirstNameText var vmObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( @@ -68,14 +68,14 @@ internal static partial class __ReactiveUIGeneratedBindings var disposable = new global::ReactiveUI.Binding.Observables.CompositeDisposable2(d1, d2); - return new global::ReactiveUI.Binding.ReactiveBinding( + return new global::ReactiveUI.Binding.ReactiveBinding( view, changed, global::ReactiveUI.Binding.BindingDirection.TwoWay, disposable); } - private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFE389FC4EEB01(global::SharedScenarios.Bind.TwoSameTypeBindings.MyViewModel viewModel, global::SharedScenarios.Bind.TwoSameTypeBindings.MyView view) + private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFE389FC4EEB01(global::SharedScenarios.Bind.TwoSameTypeBindings.MyViewModel viewModel, global::SharedScenarios.Bind.TwoSameTypeBindings.MyView view) { // Bind: LastName <-> LastNameText var vmObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( @@ -106,7 +106,7 @@ internal static partial class __ReactiveUIGeneratedBindings var disposable = new global::ReactiveUI.Binding.Observables.CompositeDisposable2(d1, d2); - return new global::ReactiveUI.Binding.ReactiveBinding( + return new global::ReactiveUI.Binding.ReactiveBinding( view, changed, global::ReactiveUI.Binding.BindingDirection.TwoWay, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.MB#BindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.MB#BindDispatch.g.verified.cs index 8656b613..da83e837 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.MB#BindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.MB#BindDispatch.g.verified.cs @@ -13,7 +13,7 @@ internal static partial class __ReactiveUIGeneratedBindings /// Concrete typed overload for Bind from global::SharedScenarios.Bind.MultipleBindings.MyViewModel to global::SharedScenarios.Bind.MultipleBindings.MyView. /// Uses CallerArgumentExpression for dispatch. /// - public static global::ReactiveUI.Binding.IReactiveBinding Bind( + public static global::ReactiveUI.Binding.IReactiveBinding Bind( this global::SharedScenarios.Bind.MultipleBindings.MyView view, global::SharedScenarios.Bind.MultipleBindings.MyViewModel viewModel, global::System.Linq.Expressions.Expression> viewModelProperty, @@ -32,7 +32,7 @@ internal static partial class __ReactiveUIGeneratedBindings "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFFC09455D2B72(global::SharedScenarios.Bind.MultipleBindings.MyViewModel viewModel, global::SharedScenarios.Bind.MultipleBindings.MyView view) + private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFFC09455D2B72(global::SharedScenarios.Bind.MultipleBindings.MyViewModel viewModel, global::SharedScenarios.Bind.MultipleBindings.MyView view) { // Bind: Name <-> NameText var vmObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( @@ -63,7 +63,7 @@ internal static partial class __ReactiveUIGeneratedBindings var disposable = new global::ReactiveUI.Binding.Observables.CompositeDisposable2(d1, d2); - return new global::ReactiveUI.Binding.ReactiveBinding( + return new global::ReactiveUI.Binding.ReactiveBinding( view, changed, global::ReactiveUI.Binding.BindingDirection.TwoWay, @@ -74,7 +74,7 @@ internal static partial class __ReactiveUIGeneratedBindings /// Concrete typed overload for Bind from global::SharedScenarios.Bind.MultipleBindings.MyViewModel to global::SharedScenarios.Bind.MultipleBindings.MyView. /// Uses CallerArgumentExpression for dispatch. /// - public static global::ReactiveUI.Binding.IReactiveBinding Bind( + public static global::ReactiveUI.Binding.IReactiveBinding Bind( this global::SharedScenarios.Bind.MultipleBindings.MyView view, global::SharedScenarios.Bind.MultipleBindings.MyViewModel viewModel, global::System.Linq.Expressions.Expression> viewModelProperty, @@ -93,7 +93,7 @@ internal static partial class __ReactiveUIGeneratedBindings "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFFC08E70C4031(global::SharedScenarios.Bind.MultipleBindings.MyViewModel viewModel, global::SharedScenarios.Bind.MultipleBindings.MyView view) + private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFFC08E70C4031(global::SharedScenarios.Bind.MultipleBindings.MyViewModel viewModel, global::SharedScenarios.Bind.MultipleBindings.MyView view) { // Bind: Age <-> AgeText var vmObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( @@ -124,7 +124,7 @@ internal static partial class __ReactiveUIGeneratedBindings var disposable = new global::ReactiveUI.Binding.Observables.CompositeDisposable2(d1, d2); - return new global::ReactiveUI.Binding.ReactiveBinding( + return new global::ReactiveUI.Binding.ReactiveBinding( view, changed, global::ReactiveUI.Binding.BindingDirection.TwoWay, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_S2S#BindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_S2S#BindDispatch.g.verified.cs index 70b472a3..7324a467 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_S2S#BindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_S2S#BindDispatch.g.verified.cs @@ -13,7 +13,7 @@ internal static partial class __ReactiveUIGeneratedBindings /// Concrete typed overload for Bind from global::SharedScenarios.Bind.SinglePropertyStringToString.MyViewModel to global::SharedScenarios.Bind.SinglePropertyStringToString.MyView. /// Uses CallerArgumentExpression for dispatch. /// - public static global::ReactiveUI.Binding.IReactiveBinding Bind( + public static global::ReactiveUI.Binding.IReactiveBinding Bind( this global::SharedScenarios.Bind.SinglePropertyStringToString.MyView view, global::SharedScenarios.Bind.SinglePropertyStringToString.MyViewModel viewModel, global::System.Linq.Expressions.Expression> viewModelProperty, @@ -26,13 +26,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (viewModelPropertyExpression == "x => x.Name" && viewPropertyExpression == "x => x.NameText") { - return __Bind_000011908961B60B(viewModel, view); + return __Bind_000011908961B668(viewModel, view); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __Bind_000011908961B60B(global::SharedScenarios.Bind.SinglePropertyStringToString.MyViewModel viewModel, global::SharedScenarios.Bind.SinglePropertyStringToString.MyView view) + private static global::ReactiveUI.Binding.IReactiveBinding __Bind_000011908961B668(global::SharedScenarios.Bind.SinglePropertyStringToString.MyViewModel viewModel, global::SharedScenarios.Bind.SinglePropertyStringToString.MyView view) { // Bind: Name <-> NameText var vmObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( @@ -63,7 +63,7 @@ internal static partial class __ReactiveUIGeneratedBindings var disposable = new global::ReactiveUI.Binding.Observables.CompositeDisposable2(d1, d2); - return new global::ReactiveUI.Binding.ReactiveBinding( + return new global::ReactiveUI.Binding.ReactiveBinding( view, changed, global::ReactiveUI.Binding.BindingDirection.TwoWay, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_S2S_CFP#BindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_S2S_CFP#BindDispatch.g.verified.cs index af4d14d6..af59d508 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_S2S_CFP#BindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_S2S_CFP#BindDispatch.g.verified.cs @@ -13,7 +13,7 @@ internal static partial class __ReactiveUIGeneratedBindings /// Concrete typed overload for Bind from global::SharedScenarios.Bind.SinglePropertyStringToString.MyViewModel to global::SharedScenarios.Bind.SinglePropertyStringToString.MyView. /// Uses CallerFilePath + CallerLineNumber for dispatch. /// - public static global::ReactiveUI.Binding.IReactiveBinding Bind( + public static global::ReactiveUI.Binding.IReactiveBinding Bind( this global::SharedScenarios.Bind.SinglePropertyStringToString.MyView view, global::SharedScenarios.Bind.SinglePropertyStringToString.MyViewModel viewModel, global::System.Linq.Expressions.Expression> viewModelProperty, @@ -23,16 +23,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 74 + if (callerLineNumber == 77 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __Bind_000011908961B60B(viewModel, view); + return __Bind_000011908961B668(viewModel, view); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __Bind_000011908961B60B(global::SharedScenarios.Bind.SinglePropertyStringToString.MyViewModel viewModel, global::SharedScenarios.Bind.SinglePropertyStringToString.MyView view) + private static global::ReactiveUI.Binding.IReactiveBinding __Bind_000011908961B668(global::SharedScenarios.Bind.SinglePropertyStringToString.MyViewModel viewModel, global::SharedScenarios.Bind.SinglePropertyStringToString.MyView view) { // Bind: Name <-> NameText var vmObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( @@ -63,7 +63,7 @@ internal static partial class __ReactiveUIGeneratedBindings var disposable = new global::ReactiveUI.Binding.Observables.CompositeDisposable2(d1, d2); - return new global::ReactiveUI.Binding.ReactiveBinding( + return new global::ReactiveUI.Binding.ReactiveBinding( view, changed, global::ReactiveUI.Binding.BindingDirection.TwoWay, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_WC#BindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_WC#BindDispatch.g.verified.cs index 8c760e10..341b4b07 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_WC#BindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_WC#BindDispatch.g.verified.cs @@ -13,7 +13,7 @@ internal static partial class __ReactiveUIGeneratedBindings /// Concrete typed overload for Bind from global::SharedScenarios.Bind.SinglePropertyWithConverters.MyViewModel to global::SharedScenarios.Bind.SinglePropertyWithConverters.MyView. /// Uses CallerArgumentExpression for dispatch. /// - public static global::ReactiveUI.Binding.IReactiveBinding Bind( + public static global::ReactiveUI.Binding.IReactiveBinding Bind( this global::SharedScenarios.Bind.SinglePropertyWithConverters.MyView view, global::SharedScenarios.Bind.SinglePropertyWithConverters.MyViewModel viewModel, global::System.Linq.Expressions.Expression> viewModelProperty, @@ -28,13 +28,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (viewModelPropertyExpression == "x => x.Count" && viewPropertyExpression == "x => x.CountText") { - return __Bind_0000102A67853C5B(viewModel, view, viewModelToViewConverter, viewToViewModelConverter); + return __Bind_0000102A67853CB8(viewModel, view, viewModelToViewConverter, viewToViewModelConverter); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __Bind_0000102A67853C5B(global::SharedScenarios.Bind.SinglePropertyWithConverters.MyViewModel viewModel, global::SharedScenarios.Bind.SinglePropertyWithConverters.MyView view, global::System.Func viewModelToViewConverter, global::System.Func viewToViewModelConverter) + private static global::ReactiveUI.Binding.IReactiveBinding __Bind_0000102A67853CB8(global::SharedScenarios.Bind.SinglePropertyWithConverters.MyViewModel viewModel, global::SharedScenarios.Bind.SinglePropertyWithConverters.MyView view, global::System.Func viewModelToViewConverter, global::System.Func viewToViewModelConverter) { // Bind: Count <-> CountText (with conversion) var vmObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( @@ -67,7 +67,7 @@ internal static partial class __ReactiveUIGeneratedBindings var disposable = new global::ReactiveUI.Binding.Observables.CompositeDisposable2(d1, d2); - return new global::ReactiveUI.Binding.ReactiveBinding( + return new global::ReactiveUI.Binding.ReactiveBinding( view, changed, global::ReactiveUI.Binding.BindingDirection.TwoWay, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_WCSched#BindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_WCSched#BindDispatch.g.verified.cs index 38a61b00..eaca6b9e 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_WCSched#BindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BG.SP_WCSched#BindDispatch.g.verified.cs @@ -13,7 +13,7 @@ internal static partial class __ReactiveUIGeneratedBindings /// Concrete typed overload for Bind from global::SharedScenarios.Bind.SinglePropertyWithConvertersAndScheduler.MyViewModel to global::SharedScenarios.Bind.SinglePropertyWithConvertersAndScheduler.MyView. /// Uses CallerArgumentExpression for dispatch. /// - public static global::ReactiveUI.Binding.IReactiveBinding Bind( + public static global::ReactiveUI.Binding.IReactiveBinding Bind( this global::SharedScenarios.Bind.SinglePropertyWithConvertersAndScheduler.MyView view, global::SharedScenarios.Bind.SinglePropertyWithConvertersAndScheduler.MyViewModel viewModel, global::System.Linq.Expressions.Expression> viewModelProperty, @@ -29,13 +29,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (viewModelPropertyExpression == "x => x.Count" && viewPropertyExpression == "x => x.CountText") { - return __Bind_7FFFD53F494404E1(viewModel, view, viewModelToViewConverter, viewToViewModelConverter, scheduler); + return __Bind_7FFFD53F4944055D(viewModel, view, viewModelToViewConverter, viewToViewModelConverter, scheduler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFD53F494404E1(global::SharedScenarios.Bind.SinglePropertyWithConvertersAndScheduler.MyViewModel viewModel, global::SharedScenarios.Bind.SinglePropertyWithConvertersAndScheduler.MyView view, global::System.Func viewModelToViewConverter, global::System.Func viewToViewModelConverter, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) + private static global::ReactiveUI.Binding.IReactiveBinding __Bind_7FFFD53F4944055D(global::SharedScenarios.Bind.SinglePropertyWithConvertersAndScheduler.MyViewModel viewModel, global::SharedScenarios.Bind.SinglePropertyWithConvertersAndScheduler.MyView view, global::System.Func viewModelToViewConverter, global::System.Func viewToViewModelConverter, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) { // Bind: Count <-> CountText (with conversion) (with scheduler) var vmObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( @@ -70,7 +70,7 @@ internal static partial class __ReactiveUIGeneratedBindings var disposable = new global::ReactiveUI.Binding.Observables.CompositeDisposable2(d1, d2); - return new global::ReactiveUI.Binding.ReactiveBinding( + return new global::ReactiveUI.Binding.ReactiveBinding( view, changed, global::ReactiveUI.Binding.BindingDirection.TwoWay, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback#BindInteractionDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback#BindInteractionDispatch.g.verified.cs index 95cd27de..3495a577 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback#BindInteractionDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback#BindInteractionDispatch.g.verified.cs @@ -22,16 +22,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 60 + if (callerLineNumber == 62 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindInteraction_000025C4B6C67EA9(viewModel, handler); + return __BindInteraction_000025C4B6C67EE7(viewModel, handler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindInteraction_000025C4B6C67EA9( + private static global::System.IDisposable __BindInteraction_000025C4B6C67EE7( global::SharedScenarios.BindInteraction.TaskHandler.MyViewModel viewModel, global::System.Func, global::System.Threading.Tasks.Task> handler) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_DeepPropertyPath#BindInteractionDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_DeepPropertyPath#BindInteractionDispatch.g.verified.cs index dd81e733..b992fef3 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_DeepPropertyPath#BindInteractionDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_DeepPropertyPath#BindInteractionDispatch.g.verified.cs @@ -22,16 +22,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 86 + if (callerLineNumber == 88 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindInteraction_7FFFEF09AD5AF2CD(viewModel, handler); + return __BindInteraction_7FFFEF09AD5AF30B(viewModel, handler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindInteraction_7FFFEF09AD5AF2CD( + private static global::System.IDisposable __BindInteraction_7FFFEF09AD5AF30B( global::SharedScenarios.BindInteraction.DeepPropertyPath.MyViewModel viewModel, global::System.Func, global::System.Threading.Tasks.Task> handler) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_NonINPCViewModel#BindInteractionDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_NonINPCViewModel#BindInteractionDispatch.g.verified.cs index ce7a6199..277caf0f 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_NonINPCViewModel#BindInteractionDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_NonINPCViewModel#BindInteractionDispatch.g.verified.cs @@ -22,16 +22,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 44 + if (callerLineNumber == 46 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindInteraction_7FFFCBE90BBDA2DD(viewModel, handler); + return __BindInteraction_7FFFCBE90BBDA31B(viewModel, handler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindInteraction_7FFFCBE90BBDA2DD( + private static global::System.IDisposable __BindInteraction_7FFFCBE90BBDA31B( global::SharedScenarios.BindInteraction.NonINPCViewModel.MyViewModel viewModel, global::System.Func, global::System.Threading.Tasks.Task> handler) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_ObservableHandler#BindInteractionDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_ObservableHandler#BindInteractionDispatch.g.verified.cs index 9f4fff9a..b75e8890 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_ObservableHandler#BindInteractionDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.CFPFallback_ObservableHandler#BindInteractionDispatch.g.verified.cs @@ -22,16 +22,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 59 + if (callerLineNumber == 61 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindInteraction_7FFFDDE16443ACF6(viewModel, handler); + return __BindInteraction_7FFFDDE16443AD34(viewModel, handler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindInteraction_7FFFDDE16443ACF6( + private static global::System.IDisposable __BindInteraction_7FFFDDE16443AD34( global::SharedScenarios.BindInteraction.ObservableHandler.MyViewModel viewModel, global::System.Func, global::System.IObservable> handler) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.DeepPropertyPath#BindInteractionDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.DeepPropertyPath#BindInteractionDispatch.g.verified.cs index 267b21f9..61185c46 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.DeepPropertyPath#BindInteractionDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.DeepPropertyPath#BindInteractionDispatch.g.verified.cs @@ -26,13 +26,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Child!.Confirm") { - return __BindInteraction_7FFFEF09AD5AF2CD(viewModel, handler); + return __BindInteraction_7FFFEF09AD5AF30B(viewModel, handler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindInteraction_7FFFEF09AD5AF2CD( + private static global::System.IDisposable __BindInteraction_7FFFEF09AD5AF30B( global::SharedScenarios.BindInteraction.DeepPropertyPath.MyViewModel viewModel, global::System.Func, global::System.Threading.Tasks.Task> handler) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.NonINPCViewModel#BindInteractionDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.NonINPCViewModel#BindInteractionDispatch.g.verified.cs index 1026c3ee..4e9e052c 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.NonINPCViewModel#BindInteractionDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.NonINPCViewModel#BindInteractionDispatch.g.verified.cs @@ -26,13 +26,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Confirm") { - return __BindInteraction_7FFFCBE90BBDA2DD(viewModel, handler); + return __BindInteraction_7FFFCBE90BBDA31B(viewModel, handler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindInteraction_7FFFCBE90BBDA2DD( + private static global::System.IDisposable __BindInteraction_7FFFCBE90BBDA31B( global::SharedScenarios.BindInteraction.NonINPCViewModel.MyViewModel viewModel, global::System.Func, global::System.Threading.Tasks.Task> handler) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.ObservableHandler#BindInteractionDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.ObservableHandler#BindInteractionDispatch.g.verified.cs index 38912971..56f12f1c 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.ObservableHandler#BindInteractionDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.ObservableHandler#BindInteractionDispatch.g.verified.cs @@ -26,13 +26,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Confirm") { - return __BindInteraction_7FFFDDE16443ACF6(viewModel, handler); + return __BindInteraction_7FFFDDE16443AD34(viewModel, handler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindInteraction_7FFFDDE16443ACF6( + private static global::System.IDisposable __BindInteraction_7FFFDDE16443AD34( global::SharedScenarios.BindInteraction.ObservableHandler.MyViewModel viewModel, global::System.Func, global::System.IObservable> handler) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.TaskHandler#BindInteractionDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.TaskHandler#BindInteractionDispatch.g.verified.cs index 9bfa5bd6..661a47a3 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.TaskHandler#BindInteractionDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BIG.TaskHandler#BindInteractionDispatch.g.verified.cs @@ -26,13 +26,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyNameExpression == "x => x.Confirm") { - return __BindInteraction_000025C4B6C67EA9(viewModel, handler); + return __BindInteraction_000025C4B6C67EE7(viewModel, handler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindInteraction_000025C4B6C67EA9( + private static global::System.IDisposable __BindInteraction_000025C4B6C67EE7( global::SharedScenarios.BindInteraction.TaskHandler.MyViewModel viewModel, global::System.Func, global::System.Threading.Tasks.Task> handler) { diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.ReactiveObject_Source#BindOneWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.ReactiveObject_Source#BindOneWayDispatch.g.verified.cs index 0f2b0f1c..e78c5448 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.ReactiveObject_Source#BindOneWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.ReactiveObject_Source#BindOneWayDispatch.g.verified.cs @@ -29,13 +29,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Name" && targetPropertyExpression == "x => x.NameText") { - return __BindOneWay_7FFFEB54CB43751E(source, target); + return __BindOneWay_7FFFEB54CB43755C(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindOneWay_7FFFEB54CB43751E(global::SharedScenarios.BindOneWay.ReactiveObjectSource.MyViewModel source, global::SharedScenarios.BindOneWay.ReactiveObjectSource.MyView target) + private static global::System.IDisposable __BindOneWay_7FFFEB54CB43755C(global::SharedScenarios.BindOneWay.ReactiveObjectSource.MyViewModel source, global::SharedScenarios.BindOneWay.ReactiveObjectSource.MyView target) { // BindOneWay: Name -> NameText var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_I2I#BindOneWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_I2I#BindOneWayDispatch.g.verified.cs index 5c3b8dc1..a2a06bd5 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_I2I#BindOneWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_I2I#BindOneWayDispatch.g.verified.cs @@ -29,13 +29,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Count" && targetPropertyExpression == "x => x.DisplayCount") { - return __BindOneWay_7FFFCFD371F7E2C3(source, target); + return __BindOneWay_7FFFCFD371F7E301(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindOneWay_7FFFCFD371F7E2C3(global::SharedScenarios.BindOneWay.SinglePropertyIntToInt.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyIntToInt.MyView target) + private static global::System.IDisposable __BindOneWay_7FFFCFD371F7E301(global::SharedScenarios.BindOneWay.SinglePropertyIntToInt.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyIntToInt.MyView target) { // BindOneWay: Count -> DisplayCount var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_S2S#BindOneWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_S2S#BindOneWayDispatch.g.verified.cs index 38eb71ef..a1cdcc52 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_S2S#BindOneWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_S2S#BindOneWayDispatch.g.verified.cs @@ -29,13 +29,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Name" && targetPropertyExpression == "x => x.NameText") { - return __BindOneWay_7FFFD267615F26AE(source, target); + return __BindOneWay_7FFFD267615F26EC(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindOneWay_7FFFD267615F26AE(global::SharedScenarios.BindOneWay.SinglePropertyStringToString.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyStringToString.MyView target) + private static global::System.IDisposable __BindOneWay_7FFFD267615F26EC(global::SharedScenarios.BindOneWay.SinglePropertyStringToString.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyStringToString.MyView target) { // BindOneWay: Name -> NameText var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_S2S_CFP#BindOneWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_S2S_CFP#BindOneWayDispatch.g.verified.cs index bb7382f4..ddefbd78 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_S2S_CFP#BindOneWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_S2S_CFP#BindOneWayDispatch.g.verified.cs @@ -23,16 +23,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 72 + if (callerLineNumber == 74 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindOneWay_7FFFD267615F26AE(source, target); + return __BindOneWay_7FFFD267615F26EC(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindOneWay_7FFFD267615F26AE(global::SharedScenarios.BindOneWay.SinglePropertyStringToString.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyStringToString.MyView target) + private static global::System.IDisposable __BindOneWay_7FFFD267615F26EC(global::SharedScenarios.BindOneWay.SinglePropertyStringToString.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyStringToString.MyView target) { // BindOneWay: Name -> NameText var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WC#BindOneWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WC#BindOneWayDispatch.g.verified.cs index 112edc52..9654b34b 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WC#BindOneWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WC#BindOneWayDispatch.g.verified.cs @@ -30,13 +30,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Count" && targetPropertyExpression == "x => x.CountText") { - return __BindOneWay_7FFFE88AB8C050DB(source, target, conversionFunc); + return __BindOneWay_7FFFE88AB8C05119(source, target, conversionFunc); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindOneWay_7FFFE88AB8C050DB(global::SharedScenarios.BindOneWay.SinglePropertyWithConverter.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyWithConverter.MyView target, global::System.Func conversionFunc) + private static global::System.IDisposable __BindOneWay_7FFFE88AB8C05119(global::SharedScenarios.BindOneWay.SinglePropertyWithConverter.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyWithConverter.MyView target, global::System.Func conversionFunc) { // BindOneWay: Count -> CountText (with conversion) var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WCSched#BindOneWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WCSched#BindOneWayDispatch.g.verified.cs index 84a697f7..6cbfdf14 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WCSched#BindOneWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WCSched#BindOneWayDispatch.g.verified.cs @@ -31,13 +31,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Count" && targetPropertyExpression == "x => x.CountText") { - return __BindOneWay_7FFFED3E0F13A543(source, target, conversionFunc, scheduler); + return __BindOneWay_7FFFED3E0F13A581(source, target, conversionFunc, scheduler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindOneWay_7FFFED3E0F13A543(global::SharedScenarios.BindOneWay.SinglePropertyWithConverterAndScheduler.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyWithConverterAndScheduler.MyView target, global::System.Func conversionFunc, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) + private static global::System.IDisposable __BindOneWay_7FFFED3E0F13A581(global::SharedScenarios.BindOneWay.SinglePropertyWithConverterAndScheduler.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyWithConverterAndScheduler.MyView target, global::System.Func conversionFunc, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) { // BindOneWay: Count -> CountText (with conversion) (with scheduler) var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WithScheduler#BindOneWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WithScheduler#BindOneWayDispatch.g.verified.cs index a144c863..6602df34 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WithScheduler#BindOneWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BOG.SP_WithScheduler#BindOneWayDispatch.g.verified.cs @@ -30,13 +30,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Name" && targetPropertyExpression == "x => x.NameText") { - return __BindOneWay_000023CFCD42C47A(source, target, scheduler); + return __BindOneWay_000023CFCD42C4B8(source, target, scheduler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindOneWay_000023CFCD42C47A(global::SharedScenarios.BindOneWay.SinglePropertyWithScheduler.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyWithScheduler.MyView target, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) + private static global::System.IDisposable __BindOneWay_000023CFCD42C4B8(global::SharedScenarios.BindOneWay.SinglePropertyWithScheduler.MyViewModel source, global::SharedScenarios.BindOneWay.SinglePropertyWithScheduler.MyView target, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) { // BindOneWay: Name -> NameText (with scheduler) var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.ReactiveObject_Both#BindTwoWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.ReactiveObject_Both#BindTwoWayDispatch.g.verified.cs index 94602885..fa0e7888 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.ReactiveObject_Both#BindTwoWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.ReactiveObject_Both#BindTwoWayDispatch.g.verified.cs @@ -29,13 +29,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Name" && targetPropertyExpression == "x => x.NameText") { - return __BindTwoWay_000022F0C1901D5C(source, target); + return __BindTwoWay_000022F0C1901D9A(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTwoWay_000022F0C1901D5C(global::SharedScenarios.BindTwoWay.ReactiveObjectBoth.MyViewModel source, global::SharedScenarios.BindTwoWay.ReactiveObjectBoth.MyView target) + private static global::System.IDisposable __BindTwoWay_000022F0C1901D9A(global::SharedScenarios.BindTwoWay.ReactiveObjectBoth.MyViewModel source, global::SharedScenarios.BindTwoWay.ReactiveObjectBoth.MyView target) { // BindTwoWay: Name <-> NameText var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_I2I#BindTwoWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_I2I#BindTwoWayDispatch.g.verified.cs index 6cc9fa82..2c7643e1 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_I2I#BindTwoWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_I2I#BindTwoWayDispatch.g.verified.cs @@ -29,13 +29,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Count" && targetPropertyExpression == "x => x.DisplayCount") { - return __BindTwoWay_000002183E718F05(source, target); + return __BindTwoWay_000002183E718F43(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTwoWay_000002183E718F05(global::SharedScenarios.BindTwoWay.SinglePropertyIntToInt.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyIntToInt.MyView target) + private static global::System.IDisposable __BindTwoWay_000002183E718F43(global::SharedScenarios.BindTwoWay.SinglePropertyIntToInt.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyIntToInt.MyView target) { // BindTwoWay: Count <-> DisplayCount var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_S2S#BindTwoWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_S2S#BindTwoWayDispatch.g.verified.cs index cb8bc63a..2238cdba 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_S2S#BindTwoWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_S2S#BindTwoWayDispatch.g.verified.cs @@ -29,13 +29,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Name" && targetPropertyExpression == "x => x.NameText") { - return __BindTwoWay_7FFFEF88F2A77910(source, target); + return __BindTwoWay_7FFFEF88F2A7794E(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTwoWay_7FFFEF88F2A77910(global::SharedScenarios.BindTwoWay.SinglePropertyStringToString.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyStringToString.MyView target) + private static global::System.IDisposable __BindTwoWay_7FFFEF88F2A7794E(global::SharedScenarios.BindTwoWay.SinglePropertyStringToString.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyStringToString.MyView target) { // BindTwoWay: Name <-> NameText var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_S2S_CFP#BindTwoWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_S2S_CFP#BindTwoWayDispatch.g.verified.cs index ead8edc9..5da3ba9b 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_S2S_CFP#BindTwoWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_S2S_CFP#BindTwoWayDispatch.g.verified.cs @@ -23,16 +23,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 72 + if (callerLineNumber == 74 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindTwoWay_7FFFEF88F2A77910(source, target); + return __BindTwoWay_7FFFEF88F2A7794E(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTwoWay_7FFFEF88F2A77910(global::SharedScenarios.BindTwoWay.SinglePropertyStringToString.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyStringToString.MyView target) + private static global::System.IDisposable __BindTwoWay_7FFFEF88F2A7794E(global::SharedScenarios.BindTwoWay.SinglePropertyStringToString.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyStringToString.MyView target) { // BindTwoWay: Name <-> NameText var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WC#BindTwoWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WC#BindTwoWayDispatch.g.verified.cs index 026d051e..199564cc 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WC#BindTwoWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WC#BindTwoWayDispatch.g.verified.cs @@ -31,13 +31,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Count" && targetPropertyExpression == "x => x.CountText") { - return __BindTwoWay_000013957A2E9404(source, target, sourceToTargetConv, targetToSourceConv); + return __BindTwoWay_000013957A2E9442(source, target, sourceToTargetConv, targetToSourceConv); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTwoWay_000013957A2E9404(global::SharedScenarios.BindTwoWay.SinglePropertyWithConverters.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyWithConverters.MyView target, global::System.Func sourceToTargetConv, global::System.Func targetToSourceConv) + private static global::System.IDisposable __BindTwoWay_000013957A2E9442(global::SharedScenarios.BindTwoWay.SinglePropertyWithConverters.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyWithConverters.MyView target, global::System.Func sourceToTargetConv, global::System.Func targetToSourceConv) { // BindTwoWay: Count <-> CountText (with conversion) var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WCSched#BindTwoWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WCSched#BindTwoWayDispatch.g.verified.cs index 612fe71f..46a86f8b 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WCSched#BindTwoWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WCSched#BindTwoWayDispatch.g.verified.cs @@ -32,13 +32,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Count" && targetPropertyExpression == "x => x.CountText") { - return __BindTwoWay_00000972B7EA330C(source, target, sourceToTargetConv, targetToSourceConv, scheduler); + return __BindTwoWay_00000972B7EA334A(source, target, sourceToTargetConv, targetToSourceConv, scheduler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTwoWay_00000972B7EA330C(global::SharedScenarios.BindTwoWay.SinglePropertyWithConvertersAndScheduler.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyWithConvertersAndScheduler.MyView target, global::System.Func sourceToTargetConv, global::System.Func targetToSourceConv, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) + private static global::System.IDisposable __BindTwoWay_00000972B7EA334A(global::SharedScenarios.BindTwoWay.SinglePropertyWithConvertersAndScheduler.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyWithConvertersAndScheduler.MyView target, global::System.Func sourceToTargetConv, global::System.Func targetToSourceConv, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) { // BindTwoWay: Count <-> CountText (with conversion) (with scheduler) var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WithScheduler#BindTwoWayDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WithScheduler#BindTwoWayDispatch.g.verified.cs index 246fd316..bd560494 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WithScheduler#BindTwoWayDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BTG.SP_WithScheduler#BindTwoWayDispatch.g.verified.cs @@ -30,13 +30,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (sourcePropertyExpression == "x => x.Name" && targetPropertyExpression == "x => x.NameText") { - return __BindTwoWay_7FFFF863C3AFACCC(source, target, scheduler); + return __BindTwoWay_7FFFF863C3AFAD0A(source, target, scheduler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTwoWay_7FFFF863C3AFACCC(global::SharedScenarios.BindTwoWay.SinglePropertyWithScheduler.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyWithScheduler.MyView target, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) + private static global::System.IDisposable __BindTwoWay_7FFFF863C3AFAD0A(global::SharedScenarios.BindTwoWay.SinglePropertyWithScheduler.MyViewModel source, global::SharedScenarios.BindTwoWay.SinglePropertyWithScheduler.MyView target, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) { // BindTwoWay: Name <-> NameText (with scheduler) var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.DifferingTypes#BindToDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.DifferingTypes#BindToDispatch.g.verified.cs index e639f795..dfa28a46 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.DifferingTypes#BindToDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.DifferingTypes#BindToDispatch.g.verified.cs @@ -25,13 +25,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyExpression == "x => x.Caption") { - return __BindTo_7FFFF0EE063CE2EC(source, target); + return __BindTo_7FFFF0EE063CE32A(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTo_7FFFF0EE063CE2EC(global::System.IObservable source, global::SharedScenarios.BindTo.DifferingTypes.MyView target) + private static global::System.IDisposable __BindTo_7FFFF0EE063CE32A(global::System.IObservable source, global::SharedScenarios.BindTo.DifferingTypes.MyView target) { // BindTo: observable -> Caption return global::ReactiveUI.Binding.Observables.RxBindingExtensions.Subscribe(source, value => diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.SameTypeString#BindToDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.SameTypeString#BindToDispatch.g.verified.cs index 59ddd2da..73bfec69 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.SameTypeString#BindToDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.SameTypeString#BindToDispatch.g.verified.cs @@ -25,13 +25,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyExpression == "x => x.Caption") { - return __BindTo_000016A7FA446AFA(source, target); + return __BindTo_000016A7FA446B38(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTo_000016A7FA446AFA(global::System.IObservable source, global::SharedScenarios.BindTo.SameTypeString.MyView target) + private static global::System.IDisposable __BindTo_000016A7FA446B38(global::System.IObservable source, global::SharedScenarios.BindTo.SameTypeString.MyView target) { // BindTo: observable -> Caption return global::ReactiveUI.Binding.Observables.RxBindingExtensions.Subscribe(source, value => diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.SameTypeString_CFP#BindToDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.SameTypeString_CFP#BindToDispatch.g.verified.cs index bfe608a6..11bdb5e6 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.SameTypeString_CFP#BindToDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.SameTypeString_CFP#BindToDispatch.g.verified.cs @@ -21,16 +21,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 46 + if (callerLineNumber == 48 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __BindTo_000016A7FA446AFA(source, target); + return __BindTo_000016A7FA446B38(source, target); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTo_000016A7FA446AFA(global::System.IObservable source, global::SharedScenarios.BindTo.SameTypeString.MyView target) + private static global::System.IDisposable __BindTo_000016A7FA446B38(global::System.IObservable source, global::SharedScenarios.BindTo.SameTypeString.MyView target) { // BindTo: observable -> Caption return global::ReactiveUI.Binding.Observables.RxBindingExtensions.Subscribe(source, value => diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.WCOverride#BindToDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.WCOverride#BindToDispatch.g.verified.cs index 6e47ef08..4751a9de 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.WCOverride#BindToDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.WCOverride#BindToDispatch.g.verified.cs @@ -26,13 +26,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyExpression == "x => x.Caption") { - return __BindTo_7FFFF5030A82ACFC(source, target, converterOverride); + return __BindTo_7FFFF5030A82AD3A(source, target, converterOverride); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTo_7FFFF5030A82ACFC(global::System.IObservable source, global::SharedScenarios.BindTo.WithConverterOverride.MyView target, global::ReactiveUI.Binding.IBindingTypeConverter converterOverride) + private static global::System.IDisposable __BindTo_7FFFF5030A82AD3A(global::System.IObservable source, global::SharedScenarios.BindTo.WithConverterOverride.MyView target, global::ReactiveUI.Binding.IBindingTypeConverter converterOverride) { // BindTo: observable -> Caption return global::ReactiveUI.Binding.Observables.RxBindingExtensions.Subscribe(source, value => diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.WithConversionHint#BindToDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.WithConversionHint#BindToDispatch.g.verified.cs index 93faf0ba..d4e18b82 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.WithConversionHint#BindToDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/BToG.WithConversionHint#BindToDispatch.g.verified.cs @@ -26,13 +26,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (propertyExpression == "x => x.Caption") { - return __BindTo_7FFFC579FC797738(source, target, conversionHint); + return __BindTo_7FFFC579FC797776(source, target, conversionHint); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IDisposable __BindTo_7FFFC579FC797738(global::System.IObservable source, global::SharedScenarios.BindTo.WithConversionHint.MyView target, object conversionHint) + private static global::System.IDisposable __BindTo_7FFFC579FC797776(global::System.IObservable source, global::SharedScenarios.BindTo.WithConversionHint.MyView target, object conversionHint) { // BindTo: observable -> Caption return global::ReactiveUI.Binding.Observables.RxBindingExtensions.Subscribe(source, value => diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/CodeGeneration/ObservationCodeGeneratorHelperTests.MethodGeneration.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/CodeGeneration/ObservationCodeGeneratorHelperTests.MethodGeneration.cs index 989bcb73..80abbc1b 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/CodeGeneration/ObservationCodeGeneratorHelperTests.MethodGeneration.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/CodeGeneration/ObservationCodeGeneratorHelperTests.MethodGeneration.cs @@ -44,57 +44,28 @@ public async Task GenerateConcreteOverload_CallerFilePath_GeneratesFilePathDispa await Assert.That(result).Contains("callerFilePath.EndsWith"); } - /// Verifies GenerateRuntimeFallback for single property generates throw (no runtime reflection fallback). + /// Verifies GenerateRuntimeFallback throws rather than falling back to runtime reflection. /// A task representing the asynchronous test operation. [Test] - public async Task GenerateRuntimeFallback_SingleProperty_GeneratesThrow() + public async Task GenerateRuntimeFallback_GeneratesThrowNamingTheMethod() { var sb = new StringBuilder(); - ObservationCodeGenerator.GenerateRuntimeFallback(sb, WhenChangedName, 1, false); + ObservationCodeGenerator.GenerateRuntimeFallback(sb, WhenChangedName); var result = sb.ToString(); await Assert.That(result).Contains(ThrowNewGlobalSystemInvalidOperationExceptionFragment); await Assert.That(result).Contains(WhenChangedName); } - /// Verifies GenerateRuntimeFallback for multi-property generates throw (no runtime reflection fallback). - /// A task representing the asynchronous test operation. - [Test] - public async Task GenerateRuntimeFallback_MultiPropertyWithSelector_GeneratesThrow() - { - const int PropCount = 2; - var sb = new StringBuilder(); - - ObservationCodeGenerator.GenerateRuntimeFallback(sb, WhenChangedName, PropCount, true); - - var result = sb.ToString(); - await Assert.That(result).Contains(ThrowNewGlobalSystemInvalidOperationExceptionFragment); - await Assert.That(result).Contains(WhenChangedName); - } - - /// Verifies GenerateRuntimeFallback for multi-property without selector generates throw. - /// A task representing the asynchronous test operation. - [Test] - public async Task GenerateRuntimeFallback_MultiPropertyNoSelector_GeneratesThrow() - { - const int PropCount = 2; - var sb = new StringBuilder(); - - ObservationCodeGenerator.GenerateRuntimeFallback(sb, WhenChangedName, PropCount, false); - - var result = sb.ToString(); - await Assert.That(result).Contains(ThrowNewGlobalSystemInvalidOperationExceptionFragment); - } - - /// Verifies GenerateRuntimeFallback for WhenChanging includes correct method prefix in error message. + /// Verifies the method prefix is interpolated into the message rather than hard-coded. /// A task representing the asynchronous test operation. [Test] public async Task GenerateRuntimeFallback_WhenChanging_IncludesMethodPrefixInErrorMessage() { var sb = new StringBuilder(); - ObservationCodeGenerator.GenerateRuntimeFallback(sb, WhenChangingName, 1, false); + ObservationCodeGenerator.GenerateRuntimeFallback(sb, WhenChangingName); var result = sb.ToString(); await Assert.That(result).Contains(ThrowNewGlobalSystemInvalidOperationExceptionFragment); diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/CodeGeneration/ObservationCodeGeneratorHelperTests.MultiProperty.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/CodeGeneration/ObservationCodeGeneratorHelperTests.MultiProperty.cs index 0411181d..c918758d 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/CodeGeneration/ObservationCodeGeneratorHelperTests.MultiProperty.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/CodeGeneration/ObservationCodeGeneratorHelperTests.MultiProperty.cs @@ -214,7 +214,7 @@ public async Task GenerateMultiPropertyObservation_NoSelector_GeneratesTupleResu var result = sb.ToString(); await Assert.That(result).Contains(CombineLatestName); - await Assert.That(result).Contains("property1: p1"); - await Assert.That(result).Contains("property2: p2"); + await Assert.That(result).Contains("Property1: p1"); + await Assert.That(result).Contains("Property2: p2"); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/GeneratedNamespaceScopingTests.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/GeneratedNamespaceScopingTests.cs index 8b232905..4651b3e0 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/GeneratedNamespaceScopingTests.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/GeneratedNamespaceScopingTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using Microsoft.CodeAnalysis.CSharp; using ReactiveUI.Binding.SourceGenerators.Tests.Helpers; @@ -187,6 +188,7 @@ public async Task BeforeGlobalUsings_WithoutInternalsVisibleTo_KeepsTheSharedNam /// Renders the consumer source in the given namespace. /// The namespace the consumer's own code is declared in. /// The source code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static string SourceIn(string consumerNamespace) => SourceTemplate.Replace(NamespaceToken, consumerNamespace, StringComparison.Ordinal); diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/CommandExtractorHelperTests.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/CommandExtractorHelperTests.cs index 31cc62cd..6aad1dd2 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/CommandExtractorHelperTests.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/CommandExtractorHelperTests.cs @@ -10,6 +10,9 @@ namespace ReactiveUI.Binding.SourceGenerators.Tests.Helpers; /// Tests for internal helper methods. public class CommandExtractorHelperTests { + /// The event name used by the explicit-event tests. + private const string ClickEventName = "Click"; + /// Verifies that IsToEventArgument returns true for a named argument with "toEvent". /// A task representing the asynchronous test operation. [Test] @@ -325,14 +328,358 @@ public void Method(Vm vm, View view, string s1, string s2) { } await Assert.That(result).IsNull(); } + /// Verifies that an empty toEvent string resolves to no event name. + /// A task representing the asynchronous test operation. + [Test] + public async Task ResolveExplicitEventName_EmptyString_ReturnsNull() => + await Assert.That(await ResolveToEventAsync("\"\"")).IsNull(); + + /// Verifies that a toEvent argument with no compile-time value resolves to no event name. + /// A task representing the asynchronous test operation. + [Test] + public async Task ResolveExplicitEventName_NonConstant_ReturnsNull() => + await Assert.That(await ResolveToEventAsync("System.Environment.MachineName")).IsNull(); + + /// Verifies that a non-empty constant toEvent string resolves to that event name. + /// A task representing the asynchronous test operation. + [Test] + public async Task ResolveExplicitEventName_ConstantString_ReturnsTheEventName() => + await Assert.That(await ResolveToEventAsync("\"Click\"")).IsEqualTo(ClickEventName); + + /// Verifies that a method with no toEvent parameter resolves no event name. + /// A task representing the asynchronous test operation. + [Test] + public async Task ResolveExplicitEventName_NoToEventParameter_ReturnsNull() + { + const string source = """ + namespace TestApp + { + public class Caller + { + public void Go() => Method("cmd"); + + public void Method(string command) { } + } + } + """; + + var compilation = TestHelper.CreateCompilation(source); + var tree = compilation.SyntaxTrees.First(); + var model = compilation.GetSemanticModel(tree); + var invocation = await FirstInvocationAsync(tree); + var methodSymbol = (Microsoft.CodeAnalysis.IMethodSymbol)model.GetSymbolInfo(invocation).Symbol!; + + var result = CommandExtractor.ResolveExplicitEventName( + methodSymbol, + invocation.ArgumentList.Arguments, + model, + CancellationToken.None); + + await Assert.That(result).IsNull(); + } + + /// Verifies that the view and view model sides are read from the receiver and first argument. + /// A task representing the asynchronous test operation. + [Test] + public async Task ResolveBindCommandSides_ReadsReceiverAndFirstArgument() + { + const string source = """ + namespace TestApp + { + public class Vm { } + public class View { public void Method(Vm vm) { } } + + public class Caller + { + public void Go() => new View().Method(new Vm()); + } + } + """; + + var compilation = TestHelper.CreateCompilation(source); + var tree = compilation.SyntaxTrees.First(); + var model = compilation.GetSemanticModel(tree); + var invocation = await FirstInvocationAsync(tree); + var memberAccess = (Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntax)invocation.Expression; + + var (view, viewModel) = CommandExtractor.ResolveBindCommandSides( + memberAccess, + invocation.ArgumentList.Arguments, + model, + CancellationToken.None); + + await Assert.That(view).IsEqualTo("global::TestApp.View"); + await Assert.That(viewModel).IsEqualTo("global::TestApp.Vm"); + } + + /// Verifies that the control binding resolves the explicit event, its args type and the capabilities. + /// A task representing the asynchronous test operation. + [Test] + public async Task ResolveControlBinding_ExplicitEvent_ResolvesEventArgsAndCapabilities() + { + const string source = """ + using System; + using System.Windows.Input; + namespace TestApp + { + public class ButtonControl + { + public event EventHandler Click; + public ICommand Command { get; set; } + public object CommandParameter { get; set; } + public bool Enabled { get; set; } + } + + public class View { public ButtonControl Button { get; set; } } + + public class Caller + { + public void Go() => Method(v => v.Button, "Click"); + + public void Method(System.Linq.Expressions.Expression> controlName, string toEvent) { } + } + } + """; + + var compilation = TestHelper.CreateCompilation(source); + var tree = compilation.SyntaxTrees.First(); + var model = compilation.GetSemanticModel(tree); + var invocation = await FirstInvocationAsync(tree); + var methodSymbol = (Microsoft.CodeAnalysis.IMethodSymbol)model.GetSymbolInfo(invocation).Symbol!; + + var (eventName, eventArgs, capabilities) = CommandExtractor.ResolveControlBinding( + methodSymbol, + invocation.ArgumentList.Arguments, + invocation.ArgumentList.Arguments[0].Expression, + model, + CancellationToken.None); + + await Assert.That(eventName).IsEqualTo(ClickEventName); + await Assert.That(eventArgs).IsNotNull(); + await Assert.That(capabilities.HasCommand).IsTrue(); + await Assert.That(capabilities.HasCommandParameter).IsTrue(); + await Assert.That(capabilities.HasEnabled).IsTrue(); + } + + /// Verifies that a settable ICommand-typed Command property is recognized. + /// A task representing the asynchronous test operation. + [Test] + public async Task IsSettableICommandProperty_SettableCommand_ReturnsTrue() => + await Assert.That(CommandExtractor.IsSettableICommandProperty( + await PropertyAsync("public ICommand Command { get; set; }", "Command"))).IsTrue(); + + /// Verifies that a read-only Command property is rejected. + /// A task representing the asynchronous test operation. + [Test] + public async Task IsSettableICommandProperty_ReadOnlyCommand_ReturnsFalse() => + await Assert.That(CommandExtractor.IsSettableICommandProperty( + await PropertyAsync("public ICommand Command { get; }", "Command"))).IsFalse(); + + /// Verifies that a settable CommandParameter property is recognized. + /// A task representing the asynchronous test operation. + [Test] + public async Task IsSettableCommandParameterProperty_Settable_ReturnsTrue() => + await Assert.That(CommandExtractor.IsSettableCommandParameterProperty( + await PropertyAsync("public object CommandParameter { get; set; }", "CommandParameter"))).IsTrue(); + + /// Verifies that a differently named property is not treated as the command parameter. + /// A task representing the asynchronous test operation. + [Test] + public async Task IsSettableCommandParameterProperty_OtherName_ReturnsFalse() => + await Assert.That(CommandExtractor.IsSettableCommandParameterProperty( + await PropertyAsync("public object Tag { get; set; }", "Tag"))).IsFalse(); + + /// Verifies that a method with no withParameter reports neither overload shape. + /// A task representing the asynchronous test operation. + [Test] + public async Task DetectParameterOverload_NoWithParameter_ReportsNeitherShape() + { + const string source = """ + namespace TestApp + { + public class Caller + { + public void Go() => Method("cmd"); + + public void Method(string command) { } + } + } + """; + + var compilation = TestHelper.CreateCompilation(source); + var tree = compilation.SyntaxTrees.First(); + var model = compilation.GetSemanticModel(tree); + var invocation = await FirstInvocationAsync(tree); + var methodSymbol = (Microsoft.CodeAnalysis.IMethodSymbol)model.GetSymbolInfo(invocation).Symbol!; + + var result = CommandExtractor.DetectParameterOverload( + methodSymbol, + invocation.ArgumentList.Arguments, + model, + CancellationToken.None); + + await Assert.That(result.HasExpressionParameter).IsFalse(); + await Assert.That(result.HasObservableParameter).IsFalse(); + await Assert.That(result.ParameterTypeFullName).IsNull(); + } + + /// Verifies that a null control type resolves no event args type. + /// A task representing the asynchronous test operation. + [Test] + public async Task ResolveEventArgsTypeFullName_NullControlType_ReturnsNull() + { + var eventName = (string?)ClickEventName; + + await Assert.That(CommandExtractor.ResolveEventArgsTypeFullName(null, ref eventName)).IsNull(); + } + + /// Verifies that an explicit event name resolves that event's args type. + /// A task representing the asynchronous test operation. + [Test] + public async Task ResolveEventArgsTypeFullName_ExplicitEvent_ResolvesItsArgsType() + { + const string source = """ + using System; + namespace TestApp + { + public class ButtonControl { public event EventHandler Click; } + } + """; + + var compilation = TestHelper.CreateCompilation(source); + var tree = compilation.SyntaxTrees.First(); + var model = compilation.GetSemanticModel(tree); + var eventName = (string?)ClickEventName; + + var result = CommandExtractor.ResolveEventArgsTypeFullName(GetFirstClassSymbol(tree, model), ref eventName); + + await Assert.That(result).IsNotNull(); + await Assert.That(eventName).IsEqualTo(ClickEventName); + } + + /// Verifies that a null control type reports no capabilities. + /// A task representing the asynchronous test operation. + [Test] + public async Task DetectControlCapabilities_NullControlType_ReportsNone() + { + var result = CommandExtractor.DetectControlCapabilities(null); + + await Assert.That(result.HasCommand).IsFalse(); + await Assert.That(result.HasCommandParameter).IsFalse(); + await Assert.That(result.HasEnabled).IsFalse(); + } + + /// Verifies that a fully featured control reports every capability. + /// A task representing the asynchronous test operation. + [Test] + public async Task DetectControlCapabilities_FullControl_ReportsAll() + { + const string source = """ + using System.Windows.Input; + namespace TestApp + { + public class ButtonControl + { + public ICommand Command { get; set; } + public object CommandParameter { get; set; } + public bool Enabled { get; set; } + } + } + """; + + var compilation = TestHelper.CreateCompilation(source); + var tree = compilation.SyntaxTrees.First(); + var model = compilation.GetSemanticModel(tree); + + var result = CommandExtractor.DetectControlCapabilities(GetFirstClassSymbol(tree, model)); + + await Assert.That(result.HasCommand).IsTrue(); + await Assert.That(result.HasCommandParameter).IsTrue(); + await Assert.That(result.HasEnabled).IsTrue(); + } + + /// Compiles a control declaring the given member and returns one of its properties. + /// The property declaration to place on the control. + /// The name of the property to return. + /// The property symbol. + private static async Task PropertyAsync( + string memberDeclaration, + string propertyName) + { + var source = $$""" + using System.Windows.Input; + namespace TestApp + { + public class ButtonControl + { + {{memberDeclaration}} + } + } + """; + + var compilation = TestHelper.CreateCompilation(source); + var tree = compilation.SyntaxTrees.First(); + var model = compilation.GetSemanticModel(tree); + await Task.CompletedTask; + + return GetFirstClassSymbol(tree, model) + .GetMembers(propertyName) + .OfType() + .First(); + } + + /// Returns the first invocation expression in a syntax tree. + /// The tree to search. + /// The first invocation expression. + private static async Task FirstInvocationAsync( + Microsoft.CodeAnalysis.SyntaxTree tree) => + (await tree.GetRootAsync()) + .DescendantNodes() + .OfType() + .First(); + + /// Resolves the explicit event name for a call passing the given toEvent argument. + /// The argument expression to pass as toEvent. + /// The resolved event name, or null. + private static async Task ResolveToEventAsync(string toEventArgument) + { + var source = $$""" + namespace TestApp + { + public class Caller + { + public void Go() => Method("cmd", {{toEventArgument}}); + + public void Method(string command, string toEvent) { } + } + } + """; + + var compilation = TestHelper.CreateCompilation(source); + var tree = compilation.SyntaxTrees.First(); + var model = compilation.GetSemanticModel(tree); + + var invocation = (await tree.GetRootAsync()) + .DescendantNodes() + .OfType() + .First(); + + var methodSymbol = (Microsoft.CodeAnalysis.IMethodSymbol)model.GetSymbolInfo(invocation).Symbol!; + + return CommandExtractor.ResolveExplicitEventName( + methodSymbol, + invocation.ArgumentList.Arguments, + model, + CancellationToken.None); + } + /// Parses an invocation expression and returns the first argument. /// The invocation expression text to parse. /// The first argument syntax node. private static Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax ParseFirstArgument(string expression) { var parsed = SyntaxFactory.ParseExpression(expression); - var invocation = (Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax)parsed; - return invocation.ArgumentList.Arguments[0]; + return ((Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax)parsed).ArgumentList.Arguments[0]; } /// Gets the first class symbol from a syntax tree. diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/ExtractorValidationTests.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/ExtractorValidationTests.cs index 59805364..896393c3 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/ExtractorValidationTests.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/ExtractorValidationTests.cs @@ -149,8 +149,7 @@ public async Task HasItems_EmptyArray_ReturnsFalse() [Test] public async Task HasItems_DefaultArray_ReturnsFalse() { - var items = default(ImmutableArray); - var result = ExtractorValidation.HasItems(items); + var result = ExtractorValidation.HasItems(default(ImmutableArray)); await Assert.That(result).IsFalse(); } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/SharedSourceReader.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/SharedSourceReader.cs index 21d99d0e..100b7831 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/SharedSourceReader.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/SharedSourceReader.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Text; using System.Text.RegularExpressions; @@ -83,8 +84,6 @@ internal static string ReadScenario(string scenarioPath) return sb.ToString(); } - /// Finds the root directory of the SharedScenarios. - /// The path to the SharedScenarios directory. /// Lists every shared scenario, so a test can sweep all of them without a hand-kept list. /// The scenario paths, relative to the shared scenario root, in a stable order. internal static IReadOnlyList EnumerateScenarioPaths() @@ -106,6 +105,7 @@ internal static IReadOnlyList EnumerateScenarioPaths() /// Locates the shared scenario root in the test output directory. /// The absolute path to the shared scenario root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string FindRoot() => Path.Combine(Path.GetDirectoryName(typeof(SharedSourceReader).Assembly.Location)!, "SharedScenarios"); @@ -269,11 +269,13 @@ private static void SkipToBodyStart(string[] lines, ref int i) while (i < lines.Length && braceDepth > 0) { braceDepth = UpdateBraceDepth(lines[i], braceDepth); - if (braceDepth > 0) + if (braceDepth <= 0) { - bodyEnd = i; - i++; + continue; } + + bodyEnd = i; + i++; } while (bodyStart <= bodyEnd && string.IsNullOrWhiteSpace(lines[bodyStart])) @@ -366,9 +368,11 @@ public void Add(T item) public List ToList() => [.. _list]; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IEnumerator GetEnumerator() => _list.GetEnumerator(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator(); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/SymbolHelpersTests.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/SymbolHelpersTests.cs index 83bdd690..c6b61eb4 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/SymbolHelpersTests.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/SymbolHelpersTests.cs @@ -62,9 +62,8 @@ public class MyVm { public IObservable Obs { get; set; } } var compilation = TestHelper.CreateCompilation(source, LanguageVersion.CSharp10); var typeSymbol = GetNamedTypeSymbol(compilation, "MyVm"); var prop = typeSymbol.GetMembers("Obs").OfType().First(); - var obsPropType = (INamedTypeSymbol)prop.Type; - var result = SymbolHelpers.IsIObservable(obsPropType); + var result = SymbolHelpers.IsIObservable((INamedTypeSymbol)prop.Type); await Assert.That(result).IsTrue(); } @@ -84,9 +83,8 @@ public class MyVm { public string Name { get; set; } = ""; } var compilation = TestHelper.CreateCompilation(source); var typeSymbol = GetNamedTypeSymbol(compilation, "MyVm"); var prop = typeSymbol.GetMembers("Name").OfType().First(); - var stringType = (INamedTypeSymbol)prop.Type; - var result = SymbolHelpers.IsIObservable(stringType); + var result = SymbolHelpers.IsIObservable((INamedTypeSymbol)prop.Type); await Assert.That(result).IsFalse(); } @@ -107,9 +105,8 @@ public class MyVm { public IInteraction Confirm { get; set; } } var compilation = TestHelper.CreateCompilation(source, LanguageVersion.CSharp10); var typeSymbol = GetNamedTypeSymbol(compilation, "MyVm"); var prop = typeSymbol.GetMembers("Confirm").OfType().First(); - var interactionType = (INamedTypeSymbol)prop.Type; - var result = SymbolHelpers.IsInteractionType(interactionType); + var result = SymbolHelpers.IsInteractionType((INamedTypeSymbol)prop.Type); await Assert.That(result).IsTrue(); } @@ -129,9 +126,8 @@ public class MyVm { public string Name { get; set; } = ""; } var compilation = TestHelper.CreateCompilation(source); var typeSymbol = GetNamedTypeSymbol(compilation, "MyVm"); var prop = typeSymbol.GetMembers("Name").OfType().First(); - var stringType = (INamedTypeSymbol)prop.Type; - var result = SymbolHelpers.IsInteractionType(stringType); + var result = SymbolHelpers.IsInteractionType((INamedTypeSymbol)prop.Type); await Assert.That(result).IsFalse(); } @@ -364,37 +360,11 @@ public string Test(MyVm vm) var tree = compilation.SyntaxTrees.First(); var semanticModel = compilation.GetSemanticModel(tree); - // Get a valid segment from a separate compilation with expression-body lambda - const string simpleLambdaSource = """ - using System; - using System.Linq.Expressions; - namespace TestApp - { - public class MyVm2 { public string Name { get; set; } = ""; } - public class Usage2 - { - public void Test() - { - Expression> expr = x => x.Name; - } - } - } - """; - - var compilation2 = TestHelper.CreateCompilation(simpleLambdaSource, LanguageVersion.CSharp10); - var tree2 = compilation2.SyntaxTrees.First(); - var semanticModel2 = compilation2.GetSemanticModel(tree2); - var refLambda = (await tree2.GetRootAsync()).DescendantNodes().OfType().First(); - var path = SyntaxHelpers.ExtractPropertyPathFromLambda(refLambda, semanticModel2, default); - await Assert.That(path).IsNotNull(); - var segment = path![0]; - - // Now get the block-body parenthesized lambda from original source var blockLambda = (await tree.GetRootAsync()).DescendantNodes() .OfType() .First(); - var result = SymbolHelpers.ResolveNamedType(segment, semanticModel, blockLambda, default); + var result = SymbolHelpers.ResolveNamedType(semanticModel, blockLambda, default); await Assert.That(result).IsNull(); } @@ -430,8 +400,7 @@ public void Test() await Assert.That(path).IsNotNull(); // Pass the lambda BODY (a member access expression, not a lambda) as argExpression - var memberAccess = (ExpressionSyntax)lambda.Body; - var result = SymbolHelpers.ResolveNamedType(path![0], semanticModel, memberAccess, default); + var result = SymbolHelpers.ResolveNamedType(semanticModel, (ExpressionSyntax)lambda.Body, default); await Assert.That(result).IsNull(); } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/TestHelper.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/TestHelper.cs index 98f8693a..f76f6653 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/TestHelper.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Helpers/TestHelper.cs @@ -35,12 +35,14 @@ public static LanguageVersion FallbackLanguageVersion(bool nullableEnabled) => /// Creates a compilation from source code, targeting C# 7.3 to verify generated output compatibility. /// The source code to compile. /// A compilation ready for testing. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Compilation CreateCompilation(string source) => CreateCompilation(source, null); /// Creates a compilation from source code with appropriate references. Includes ReactiveUI for IReactiveObject testing. /// The source code to compile. /// The C# language version to target, or for C# 7.3. /// A compilation ready for testing. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Compilation CreateCompilation(string source, LanguageVersion? languageVersion) => CreateCompilation(source, languageVersion, false); @@ -83,13 +85,13 @@ public static Compilation CreateCompilation( : new[] { typeof(ReactiveUIBindingExtensions).Assembly, - typeof(ReactiveUI.Primitives.Concurrency.ISequencer).Assembly + typeof(ReactiveUI.Primitives.Concurrency.ISequencer).Assembly, }; var seedAssemblies = new[] { typeof(ReactiveObject).Assembly, typeof(IReactiveObject).Assembly, - typeof(System.Reactive.Linq.Observable).Assembly + typeof(System.Reactive.Linq.Observable).Assembly, }.Concat(runtimeSeeds).ToArray(); var allReferences = references.Concat(GetTransitiveReferences(seedAssemblies)); @@ -107,6 +109,7 @@ public static Compilation CreateCompilation( /// The source file path of the caller (automatically populated). /// The member name of the caller (automatically populated). /// A task representing the asynchronous verification operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task TestPass( string source, Type callerType, @@ -163,6 +166,7 @@ public static Task TestPass( /// The source file path of the caller (automatically populated). /// The member name of the caller (automatically populated). /// The generator test result for additional assertions. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task TestPassWithResult( string source, Type callerType, @@ -219,12 +223,14 @@ public static async Task TestPassWithResult( /// Runs the source generator on the provided source code and returns the result. /// The source code to compile and generate. /// A containing driver, compilation, and diagnostics. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static GeneratorTestResult RunGenerator(string source) => RunGenerator(source, null); /// Runs the source generator on the provided source code, targeting a specific language version. /// The source code to compile and generate. /// The C# language version to target, or for C# 7.3. /// A containing driver, compilation, and diagnostics. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static GeneratorTestResult RunGenerator(string source, LanguageVersion? languageVersion) => RunGenerator(source, languageVersion, null); @@ -239,6 +245,7 @@ public static GeneratorTestResult RunGenerator(string source, LanguageVersion? l /// other overload does, because an in-memory compilation carries no MSBuild properties. /// /// A containing driver, compilation, and diagnostics. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static GeneratorTestResult RunGenerator( string source, LanguageVersion? languageVersion, @@ -346,6 +353,7 @@ public static (Assembly Assembly, CollectibleAssemblyLoadContext Context) EmitAn /// /// The test method name. /// An abbreviated method name string. + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string AbbreviateMethodName(string methodName) => methodName .Replace("MultipleSameTypeBindings", "MSTB", StringComparison.Ordinal) .Replace("TwoSameTypeBindings", "2STB", StringComparison.Ordinal) diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Models/EquatableArrayTests.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Models/EquatableArrayTests.cs index 6566404f..6a1ec3fa 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Models/EquatableArrayTests.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Models/EquatableArrayTests.cs @@ -91,12 +91,8 @@ public async Task Constructor_CachesHashCode_MatchesComputeHashCode() /// Verifies default-constructed EquatableArray has hash code 0. /// A task representing the asynchronous test operation. [Test] - public async Task DefaultConstructed_HashCode_ReturnsZero() - { - var defaultArray = default(EquatableArray); - - await Assert.That(defaultArray.GetHashCode()).IsEqualTo(0); - } + public async Task DefaultConstructed_HashCode_ReturnsZero() => + await Assert.That(default(EquatableArray).GetHashCode()).IsEqualTo(0); /// Verifies equal arrays are equal via Equals method. /// A task representing the asynchronous test operation. @@ -127,13 +123,10 @@ public async Task Equals_DifferentContent_ReturnsFalse() /// Verifies default arrays are equal to each other. /// A task representing the asynchronous test operation. [Test] - public async Task Equals_BothDefault_ReturnsTrue() - { - var arr1 = default(EquatableArray); - var arr2 = default(EquatableArray); - - await Assert.That(arr1.Equals(arr2)).IsTrue(); - } + public async Task Equals_BothDefault_ReturnsTrue() => + await Assert.That(default(EquatableArray) + .Equals(default(EquatableArray))) + .IsTrue(); /// Verifies Length returns the number of elements. /// A task representing the asynchronous test operation. @@ -152,12 +145,8 @@ public async Task Length_MultipleElements_ReturnsCount() /// Verifies Length returns 0 for default-constructed array. /// A task representing the asynchronous test operation. [Test] - public async Task Length_DefaultConstructed_ReturnsZero() - { - var arr = default(EquatableArray); - - await Assert.That(arr.Length).IsEqualTo(0); - } + public async Task Length_DefaultConstructed_ReturnsZero() => + await Assert.That(default(EquatableArray).Length).IsEqualTo(0); /// /// Verifies ComputeHashCode handles null elements in the array by using 0 for their hash code. @@ -181,7 +170,7 @@ public async Task ComputeHashCode_NullElements_UsesZeroForNullHashCode() { new PropertyPathSegment("A", StringTypeName, GlobalTTypeName, true), new PropertyPathSegment("Name", StringTypeName, GlobalTTypeName, true), - new PropertyPathSegment("B", StringTypeName, GlobalTTypeName, true) + new PropertyPathSegment("B", StringTypeName, GlobalTTypeName, true), }; var nonNullHash = EquatableArray.ComputeHashCode(nonNullArr); @@ -348,13 +337,9 @@ public async Task NonGenericGetEnumerator_Works() /// Verifies operator== returns true for two default-constructed instances. /// A task representing the asynchronous test operation. [Test] - public async Task OperatorEquals_BothDefault_ReturnsTrue() - { - var arr1 = default(EquatableArray); - var arr2 = default(EquatableArray); - - await Assert.That(arr1 == arr2).IsTrue(); - } + public async Task OperatorEquals_BothDefault_ReturnsTrue() => + await Assert.That(default(EquatableArray) == default(EquatableArray)) + .IsTrue(); /// Verifies operator!= returns false for arrays with the same content. /// A task representing the asynchronous test operation. diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Models/ModelEqualityTests.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Models/ModelEqualityTests.cs index 2b792637..7ef05d9c 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Models/ModelEqualityTests.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/Models/ModelEqualityTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.SourceGenerators.CodeGeneration; using ReactiveUI.Binding.SourceGenerators.Models; using ReactiveUI.Binding.SourceGenerators.Tests.Helpers; @@ -636,5 +637,6 @@ public async Task TypeGroup_ReturnTypeFullName_DelegatesToFirst() /// to a constant (CA1508). /// /// A null object reference. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static object? NullReference() => null; } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_I2I#OneWayBindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_I2I#OneWayBindDispatch.g.verified.cs index c91fc9cb..2516190c 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_I2I#OneWayBindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_I2I#OneWayBindDispatch.g.verified.cs @@ -26,13 +26,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (viewModelPropertyExpression == "x => x.Count" && viewPropertyExpression == "x => x.CountValue") { - return __OneWayBind_0000344EFEEA6340(viewModel, view); + return __OneWayBind_0000344EFEEA639D(viewModel, view); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_0000344EFEEA6340(global::SharedScenarios.OneWayBind.SinglePropertyIntToInt.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyIntToInt.MyView view) + private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_0000344EFEEA639D(global::SharedScenarios.OneWayBind.SinglePropertyIntToInt.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyIntToInt.MyView view) { // OneWayBind: Count -> CountValue var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_S2S#OneWayBindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_S2S#OneWayBindDispatch.g.verified.cs index 193d9430..711cdb1d 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_S2S#OneWayBindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_S2S#OneWayBindDispatch.g.verified.cs @@ -26,13 +26,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (viewModelPropertyExpression == "x => x.Name" && viewPropertyExpression == "x => x.NameText") { - return __OneWayBind_7FFFC4A056D62A34(viewModel, view); + return __OneWayBind_7FFFC4A056D62A91(viewModel, view); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_7FFFC4A056D62A34(global::SharedScenarios.OneWayBind.SinglePropertyStringToString.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyStringToString.MyView view) + private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_7FFFC4A056D62A91(global::SharedScenarios.OneWayBind.SinglePropertyStringToString.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyStringToString.MyView view) { // OneWayBind: Name -> NameText var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_S2S_CFP#OneWayBindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_S2S_CFP#OneWayBindDispatch.g.verified.cs index 6ec6a242..ee37d2ff 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_S2S_CFP#OneWayBindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_S2S_CFP#OneWayBindDispatch.g.verified.cs @@ -23,16 +23,16 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 74 + if (callerLineNumber == 77 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __OneWayBind_7FFFC4A056D62A34(viewModel, view); + return __OneWayBind_7FFFC4A056D62A91(viewModel, view); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_7FFFC4A056D62A34(global::SharedScenarios.OneWayBind.SinglePropertyStringToString.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyStringToString.MyView view) + private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_7FFFC4A056D62A91(global::SharedScenarios.OneWayBind.SinglePropertyStringToString.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyStringToString.MyView view) { // OneWayBind: Name -> NameText var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_WS#OneWayBindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_WS#OneWayBindDispatch.g.verified.cs index b207fa3c..839be96e 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_WS#OneWayBindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_WS#OneWayBindDispatch.g.verified.cs @@ -27,13 +27,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (viewModelPropertyExpression == "x => x.Count" && viewPropertyExpression == "x => x.CountText") { - return __OneWayBind_0000321BF9FDEB10(viewModel, view, selector); + return __OneWayBind_0000321BF9FDEB6D(viewModel, view, selector); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_0000321BF9FDEB10(global::SharedScenarios.OneWayBind.SinglePropertyWithSelector.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyWithSelector.MyView view, global::System.Func selector) + private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_0000321BF9FDEB6D(global::SharedScenarios.OneWayBind.SinglePropertyWithSelector.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyWithSelector.MyView view, global::System.Func selector) { // OneWayBind: Count -> CountText (with conversion) var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_WSSched#OneWayBindDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_WSSched#OneWayBindDispatch.g.verified.cs index 1fccf21d..d98fb2a0 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_WSSched#OneWayBindDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/OBG.SP_WSSched#OneWayBindDispatch.g.verified.cs @@ -28,13 +28,13 @@ internal static partial class __ReactiveUIGeneratedBindings if (viewModelPropertyExpression == "x => x.Count" && viewPropertyExpression == "x => x.CountText") { - return __OneWayBind_7FFFFAB8DECC3770(viewModel, view, selector, scheduler); + return __OneWayBind_7FFFFAB8DECC37EC(viewModel, view, selector, scheduler); } throw new global::System.InvalidOperationException( "No generated binding found. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_7FFFFAB8DECC3770(global::SharedScenarios.OneWayBind.SinglePropertyWithSelectorAndScheduler.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyWithSelectorAndScheduler.MyView view, global::System.Func selector, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) + private static global::ReactiveUI.Binding.IReactiveBinding __OneWayBind_7FFFFAB8DECC37EC(global::SharedScenarios.OneWayBind.SinglePropertyWithSelectorAndScheduler.MyViewModel viewModel, global::SharedScenarios.OneWayBind.SinglePropertyWithSelectorAndScheduler.MyView view, global::System.Func selector, global::ReactiveUI.Primitives.Concurrency.ISequencer scheduler) { // OneWayBind: Count -> CountText (with conversion) (with scheduler) var sourceObs = new global::ReactiveUI.Binding.Observables.PropertyObservable( diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/ReactiveRuntimeFlavourTests.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/ReactiveRuntimeFlavourTests.cs index bb17cd74..88eb351b 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/ReactiveRuntimeFlavourTests.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/ReactiveRuntimeFlavourTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using Microsoft.CodeAnalysis.CSharp; using ReactiveUI.Binding.SourceGenerators.Tests.Helpers; @@ -41,6 +42,7 @@ public class ReactiveRuntimeFlavourTests /// Lists the shared scenarios for the sweep. /// Every shared scenario path. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IEnumerable Scenarios() => SharedSourceReader.EnumerateScenarioPaths(); /// Generated output for a System.Reactive consumer compiles against that package. @@ -96,6 +98,7 @@ public async Task LeanRuntime_NamesTheLeanTypes() /// /// The scenario source, written against the lean package. /// The same source, importing the System.Reactive package. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static string ShiftToReactiveRuntime(string source) => source .Replace(LeanSchedulerImport, ReactiveSchedulerImport, StringComparison.Ordinal) diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.MP_2P#WhenAnyDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.MP_2P#WhenAnyDispatch.g.verified.cs index b89900ed..8052a1f0 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.MP_2P#WhenAnyDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.MP_2P#WhenAnyDispatch.g.verified.cs @@ -27,12 +27,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (property1Expression == "x => x.FirstName" && property2Expression == "x => x.LastName") { - return __WhenAny_7FFFD022211E6772(objectToMonitor, selector); + return __WhenAny_7FFFD022211E67B0(objectToMonitor, selector); } throw new global::System.InvalidOperationException("No generated WhenAny dispatch matched. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IObservable __WhenAny_7FFFD022211E6772(global::SharedScenarios.WhenAny.MultiPropertyTwoProperties.MyViewModel obj, global::System.Func, global::ReactiveUI.Binding.IObservedChange, string> selector) + private static global::System.IObservable __WhenAny_7FFFD022211E67B0(global::SharedScenarios.WhenAny.MultiPropertyTwoProperties.MyViewModel obj, global::System.Func, global::ReactiveUI.Binding.IObservedChange, string> selector) { var __propObs0 = new global::ReactiveUI.Binding.Observables.PropertyObservable( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.MP_DC#WhenAnyDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.MP_DC#WhenAnyDispatch.g.verified.cs index 759d8c66..25ae8095 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.MP_DC#WhenAnyDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.MP_DC#WhenAnyDispatch.g.verified.cs @@ -27,12 +27,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (property1Expression == "x => x.Child.Name" && property2Expression == "x => x.Title") { - return __WhenAny_7FFFD8112D4F47EB(objectToMonitor, selector); + return __WhenAny_7FFFD8112D4F4829(objectToMonitor, selector); } throw new global::System.InvalidOperationException("No generated WhenAny dispatch matched. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IObservable __WhenAny_7FFFD8112D4F47EB(global::SharedScenarios.WhenAny.MultiPropertyDeepChain.ParentViewModel obj, global::System.Func, global::ReactiveUI.Binding.IObservedChange, string> selector) + private static global::System.IObservable __WhenAny_7FFFD8112D4F4829(global::SharedScenarios.WhenAny.MultiPropertyDeepChain.ParentViewModel obj, global::System.Func, global::ReactiveUI.Binding.IObservedChange, string> selector) { var __propObs0_s0 = (global::System.IObservable)new global::ReactiveUI.Binding.Observables.PropertyObservable( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_DC#WhenAnyDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_DC#WhenAnyDispatch.g.verified.cs index 882a6b9f..893bd23e 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_DC#WhenAnyDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_DC#WhenAnyDispatch.g.verified.cs @@ -24,12 +24,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (property1Expression == "x => x.Child.Name") { - return __WhenAny_0000044C01973E4E(objectToMonitor, selector); + return __WhenAny_0000044C01973E8C(objectToMonitor, selector); } throw new global::System.InvalidOperationException("No generated WhenAny dispatch matched. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IObservable __WhenAny_0000044C01973E4E(global::SharedScenarios.WhenAny.DeepPropertyChain.ParentViewModel obj, global::System.Func, string> selector) + private static global::System.IObservable __WhenAny_0000044C01973E8C(global::SharedScenarios.WhenAny.DeepPropertyChain.ParentViewModel obj, global::System.Func, string> selector) { var __propObs0_s0 = (global::System.IObservable)new global::ReactiveUI.Binding.Observables.PropertyObservable( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_INPC#WhenAnyDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_INPC#WhenAnyDispatch.g.verified.cs index c219e284..b93e54eb 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_INPC#WhenAnyDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_INPC#WhenAnyDispatch.g.verified.cs @@ -24,12 +24,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (property1Expression == "x => x.Name") { - return __WhenAny_00002E2F49F1247B(objectToMonitor, selector); + return __WhenAny_00002E2F49F124B9(objectToMonitor, selector); } throw new global::System.InvalidOperationException("No generated WhenAny dispatch matched. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IObservable __WhenAny_00002E2F49F1247B(global::SharedScenarios.WhenAny.SinglePropertyINPC.MyViewModel obj, global::System.Func, string> selector) + private static global::System.IObservable __WhenAny_00002E2F49F124B9(global::SharedScenarios.WhenAny.SinglePropertyINPC.MyViewModel obj, global::System.Func, string> selector) { var __propObs0 = new global::ReactiveUI.Binding.Observables.PropertyObservable( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_INPC_CFP#WhenAnyDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_INPC_CFP#WhenAnyDispatch.g.verified.cs index 12428763..66278732 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_INPC_CFP#WhenAnyDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAG.SP_INPC_CFP#WhenAnyDispatch.g.verified.cs @@ -20,14 +20,14 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 45 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) + if (callerLineNumber == 47 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __WhenAny_00002E2F49F1247B(objectToMonitor, selector); + return __WhenAny_00002E2F49F124B9(objectToMonitor, selector); } throw new global::System.InvalidOperationException("No generated WhenAny dispatch matched. Ensure the expression is an inline lambda for compile-time optimization."); } - private static global::System.IObservable __WhenAny_00002E2F49F1247B(global::SharedScenarios.WhenAny.SinglePropertyINPC.MyViewModel obj, global::System.Func, string> selector) + private static global::System.IObservable __WhenAny_00002E2F49F124B9(global::SharedScenarios.WhenAny.SinglePropertyINPC.MyViewModel obj, global::System.Func, string> selector) { var __propObs0 = new global::ReactiveUI.Binding.Observables.PropertyObservable( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_DC_CL#WhenAnyObservableDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_DC_CL#WhenAnyObservableDispatch.g.verified.cs index 46799d8c..c0a4f3a9 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_DC_CL#WhenAnyObservableDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_DC_CL#WhenAnyObservableDispatch.g.verified.cs @@ -27,12 +27,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (obs1Expression == "x => x.Child.Count" && obs2Expression == "x => x.Child.Message") { - return __WhenAnyObservable_7FFFF799BE87597D(objectToMonitor, selector); + return __WhenAnyObservable_7FFFF799BE8759BB(objectToMonitor, selector); } throw new global::System.InvalidOperationException("No generated WhenAnyObservable dispatch matched. This indicates a source generator caching issue."); } - private static global::System.IObservable __WhenAnyObservable_7FFFF799BE87597D(global::SharedScenarios.WhenAnyObservable.DeepObservableCombineLatest.ParentViewModel obj, global::System.Func selector) + private static global::System.IObservable __WhenAnyObservable_7FFFF799BE8759BB(global::SharedScenarios.WhenAnyObservable.DeepObservableCombineLatest.ParentViewModel obj, global::System.Func selector) { var __obsProperty0_s0 = (global::System.IObservable)new global::ReactiveUI.Binding.Observables.PropertyObservable( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_DC_Merge#WhenAnyObservableDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_DC_Merge#WhenAnyObservableDispatch.g.verified.cs index 2f32a360..c77c90e9 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_DC_Merge#WhenAnyObservableDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_DC_Merge#WhenAnyObservableDispatch.g.verified.cs @@ -26,12 +26,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (obs1Expression == "x => x.Child.Command1" && obs2Expression == "x => x.Child.Command2") { - return __WhenAnyObservable_000031E1E650E356(objectToMonitor); + return __WhenAnyObservable_000031E1E650E394(objectToMonitor); } throw new global::System.InvalidOperationException("No generated WhenAnyObservable dispatch matched. This indicates a source generator caching issue."); } - private static global::System.IObservable __WhenAnyObservable_000031E1E650E356(global::SharedScenarios.WhenAnyObservable.DeepObservableMerge.ParentViewModel obj) + private static global::System.IObservable __WhenAnyObservable_000031E1E650E394(global::SharedScenarios.WhenAnyObservable.DeepObservableMerge.ParentViewModel obj) { var __obsProperty0_s0 = (global::System.IObservable)new global::ReactiveUI.Binding.Observables.PropertyObservable( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_Merge#WhenAnyObservableDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_Merge#WhenAnyObservableDispatch.g.verified.cs index caf95a47..fdbf3cae 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_Merge#WhenAnyObservableDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_Merge#WhenAnyObservableDispatch.g.verified.cs @@ -26,12 +26,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (obs1Expression == "x => x.Command1" && obs2Expression == "x => x.Command2") { - return __WhenAnyObservable_000004E8406EC081(objectToMonitor); + return __WhenAnyObservable_000004E8406EC0BF(objectToMonitor); } throw new global::System.InvalidOperationException("No generated WhenAnyObservable dispatch matched. This indicates a source generator caching issue."); } - private static global::System.IObservable __WhenAnyObservable_000004E8406EC081(global::SharedScenarios.WhenAnyObservable.TwoObservablesMerge.MyViewModel obj) + private static global::System.IObservable __WhenAnyObservable_000004E8406EC0BF(global::SharedScenarios.WhenAnyObservable.TwoObservablesMerge.MyViewModel obj) { var __obsProperty0 = new global::ReactiveUI.Binding.Observables.PropertyObservable>( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_WS#WhenAnyObservableDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_WS#WhenAnyObservableDispatch.g.verified.cs index 5954a036..5ae94315 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_WS#WhenAnyObservableDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.2O_WS#WhenAnyObservableDispatch.g.verified.cs @@ -27,12 +27,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (obs1Expression == "x => x.Count" && obs2Expression == "x => x.Message") { - return __WhenAnyObservable_7FFFE3651E3C40A1(objectToMonitor, selector); + return __WhenAnyObservable_7FFFE3651E3C40DF(objectToMonitor, selector); } throw new global::System.InvalidOperationException("No generated WhenAnyObservable dispatch matched. This indicates a source generator caching issue."); } - private static global::System.IObservable __WhenAnyObservable_7FFFE3651E3C40A1(global::SharedScenarios.WhenAnyObservable.TwoObservablesWithSelector.MyViewModel obj, global::System.Func selector) + private static global::System.IObservable __WhenAnyObservable_7FFFE3651E3C40DF(global::SharedScenarios.WhenAnyObservable.TwoObservablesWithSelector.MyViewModel obj, global::System.Func selector) { var __obsProperty0 = new global::ReactiveUI.Binding.Observables.PropertyObservable>( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable#WhenAnyObservableDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable#WhenAnyObservableDispatch.g.verified.cs index 0347bbe9..d698e904 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable#WhenAnyObservableDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable#WhenAnyObservableDispatch.g.verified.cs @@ -23,12 +23,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (obs1Expression == "x => x.MyCommand") { - return __WhenAnyObservable_7FFFCD9779338708(objectToMonitor); + return __WhenAnyObservable_7FFFCD9779338746(objectToMonitor); } throw new global::System.InvalidOperationException("No generated WhenAnyObservable dispatch matched. This indicates a source generator caching issue."); } - private static global::System.IObservable __WhenAnyObservable_7FFFCD9779338708(global::SharedScenarios.WhenAnyObservable.SingleObservable.MyViewModel obj) + private static global::System.IObservable __WhenAnyObservable_7FFFCD9779338746(global::SharedScenarios.WhenAnyObservable.SingleObservable.MyViewModel obj) { var __obsProperty = new global::ReactiveUI.Binding.Observables.PropertyObservable>( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable_CFP#WhenAnyObservableDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable_CFP#WhenAnyObservableDispatch.g.verified.cs index ea00ef3b..9156f361 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable_CFP#WhenAnyObservableDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable_CFP#WhenAnyObservableDispatch.g.verified.cs @@ -19,14 +19,14 @@ internal static partial class __ReactiveUIGeneratedBindings [global::System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = "", [global::System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber = 0) { - if (callerLineNumber == 45 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) + if (callerLineNumber == 47 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { - return __WhenAnyObservable_7FFFCD9779338708(objectToMonitor); + return __WhenAnyObservable_7FFFCD9779338746(objectToMonitor); } throw new global::System.InvalidOperationException("No generated WhenAnyObservable dispatch matched. This indicates a source generator caching issue."); } - private static global::System.IObservable __WhenAnyObservable_7FFFCD9779338708(global::SharedScenarios.WhenAnyObservable.SingleObservable.MyViewModel obj) + private static global::System.IObservable __WhenAnyObservable_7FFFCD9779338746(global::SharedScenarios.WhenAnyObservable.SingleObservable.MyViewModel obj) { var __obsProperty = new global::ReactiveUI.Binding.Observables.PropertyObservable>( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable_DC#WhenAnyObservableDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable_DC#WhenAnyObservableDispatch.g.verified.cs index 84c89866..80cf4bd3 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable_DC#WhenAnyObservableDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAOG.SingleObservable_DC#WhenAnyObservableDispatch.g.verified.cs @@ -23,12 +23,12 @@ internal static partial class __ReactiveUIGeneratedBindings if (obs1Expression == "x => x.Child.MyCommand") { - return __WhenAnyObservable_7FFFD9447DB2ED7A(objectToMonitor); + return __WhenAnyObservable_7FFFD9447DB2EDB8(objectToMonitor); } throw new global::System.InvalidOperationException("No generated WhenAnyObservable dispatch matched. This indicates a source generator caching issue."); } - private static global::System.IObservable __WhenAnyObservable_7FFFD9447DB2ED7A(global::SharedScenarios.WhenAnyObservable.DeepObservableSwitch.ParentViewModel obj) + private static global::System.IObservable __WhenAnyObservable_7FFFD9447DB2EDB8(global::SharedScenarios.WhenAnyObservable.DeepObservableSwitch.ParentViewModel obj) { var __obsProperty_s0 = (global::System.IObservable)new global::ReactiveUI.Binding.Observables.PropertyObservable( obj, diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_2P#WhenAnyValueDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_2P#WhenAnyValueDispatch.g.verified.cs index f6eebc4f..3f15e529 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_2P#WhenAnyValueDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_2P#WhenAnyValueDispatch.g.verified.cs @@ -54,7 +54,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Observables.CombineLatestObservable.Create( __propObs0, __propObs1, - (p1, p2) => (property1: p1, property2: p2)); + (p1, p2) => (Property1: p1, Property2: p2)); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_3P#WhenAnyValueDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_3P#WhenAnyValueDispatch.g.verified.cs index 69a94fe9..8e772e05 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_3P#WhenAnyValueDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_3P#WhenAnyValueDispatch.g.verified.cs @@ -64,7 +64,7 @@ internal static partial class __ReactiveUIGeneratedBindings __propObs0, __propObs1, __propObs2, - (p1, p2, p3) => (property1: p1, property2: p2, property3: p3)); + (p1, p2, p3) => (Property1: p1, Property2: p2, Property3: p3)); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_FiveProperties#WhenAnyValueDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_FiveProperties#WhenAnyValueDispatch.g.verified.cs index 45f450cb..0fe0d6ea 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_FiveProperties#WhenAnyValueDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_FiveProperties#WhenAnyValueDispatch.g.verified.cs @@ -78,7 +78,7 @@ internal static partial class __ReactiveUIGeneratedBindings __propObs2, __propObs3, __propObs4, - (p1, p2, p3, p4, p5) => (property1: p1, property2: p2, property3: p3, property4: p4, property5: p5)); + (p1, p2, p3, p4, p5) => (Property1: p1, Property2: p2, Property3: p3, Property4: p4, Property5: p5)); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_TwelveProperties#WhenAnyValueDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_TwelveProperties#WhenAnyValueDispatch.g.verified.cs index 5f8709c6..84091120 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_TwelveProperties#WhenAnyValueDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.MP_TwelveProperties#WhenAnyValueDispatch.g.verified.cs @@ -148,7 +148,7 @@ internal static partial class __ReactiveUIGeneratedBindings __propObs9, __propObs10, __propObs11, - (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) => (property1: p1, property2: p2, property3: p3, property4: p4, property5: p5, property6: p6, property7: p7, property8: p8, property9: p9, property10: p10, property11: p11, property12: p12)); + (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) => (Property1: p1, Property2: p2, Property3: p3, Property4: p4, Property5: p5, Property6: p6, Property7: p7, Property8: p8, Property9: p9, Property10: p10, Property11: p11, Property12: p12)); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.SP_INPC_CFP#WhenAnyValueDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.SP_INPC_CFP#WhenAnyValueDispatch.g.verified.cs index c137cbf3..d3d79a12 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.SP_INPC_CFP#WhenAnyValueDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WAVG.SP_INPC_CFP#WhenAnyValueDispatch.g.verified.cs @@ -25,7 +25,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Fallback.RuntimeObservationFallback.WhenAnyValue(objectToMonitor, property1); } - if (callerLineNumber == 45 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) + if (callerLineNumber == 47 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { return __WhenAnyValue_0000263492582AFF(objectToMonitor); } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.MP_2P#WhenChangedDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.MP_2P#WhenChangedDispatch.g.verified.cs index 66d08e5b..a401f7a5 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.MP_2P#WhenChangedDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.MP_2P#WhenChangedDispatch.g.verified.cs @@ -54,7 +54,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Observables.CombineLatestObservable.Create( __propObs0, __propObs1, - (p1, p2) => (property1: p1, property2: p2)); + (p1, p2) => (Property1: p1, Property2: p2)); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.MP_3P#WhenChangedDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.MP_3P#WhenChangedDispatch.g.verified.cs index e7ff0846..f4849f64 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.MP_3P#WhenChangedDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.MP_3P#WhenChangedDispatch.g.verified.cs @@ -64,7 +64,7 @@ internal static partial class __ReactiveUIGeneratedBindings __propObs0, __propObs1, __propObs2, - (p1, p2, p3) => (property1: p1, property2: p2, property3: p3)); + (p1, p2, p3) => (Property1: p1, Property2: p2, Property3: p3)); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.SP_INPC_CFP#WhenChangedDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.SP_INPC_CFP#WhenChangedDispatch.g.verified.cs index 690daac1..65fd060e 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.SP_INPC_CFP#WhenChangedDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCG.SP_INPC_CFP#WhenChangedDispatch.g.verified.cs @@ -25,7 +25,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Fallback.RuntimeObservationFallback.WhenChanged(objectToMonitor, property1); } - if (callerLineNumber == 45 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) + if (callerLineNumber == 47 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { return __WhenChanged_7FFFD2E8D6FC818E(objectToMonitor); } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.4LDC_CFP#WhenChangingDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.4LDC_CFP#WhenChangingDispatch.g.verified.cs index 81681049..76a2d3b4 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.4LDC_CFP#WhenChangingDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.4LDC_CFP#WhenChangingDispatch.g.verified.cs @@ -25,7 +25,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Fallback.RuntimeObservationFallback.WhenChanging(objectToMonitor, property1); } - if (callerLineNumber == 139 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) + if (callerLineNumber == 141 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { return __WhenChanging_00001C315F48E7DF(objectToMonitor); } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.DPC_CFP#WhenChangingDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.DPC_CFP#WhenChangingDispatch.g.verified.cs index c85826cb..5c447327 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.DPC_CFP#WhenChangingDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.DPC_CFP#WhenChangingDispatch.g.verified.cs @@ -25,7 +25,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Fallback.RuntimeObservationFallback.WhenChanging(objectToMonitor, property1); } - if (callerLineNumber == 79 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) + if (callerLineNumber == 81 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { return __WhenChanging_7FFFF85E7720B498(objectToMonitor); } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_2P#WhenChangingDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_2P#WhenChangingDispatch.g.verified.cs index d4d25b54..d71d8ec7 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_2P#WhenChangingDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_2P#WhenChangingDispatch.g.verified.cs @@ -52,7 +52,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Observables.CombineLatestObservable.Create( __propObs0, __propObs1, - (p1, p2) => (property1: p1, property2: p2)); + (p1, p2) => (Property1: p1, Property2: p2)); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_2P_CFP#WhenChangingDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_2P_CFP#WhenChangingDispatch.g.verified.cs index 12e62344..9c6bc2ad 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_2P_CFP#WhenChangingDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_2P_CFP#WhenChangingDispatch.g.verified.cs @@ -27,7 +27,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Fallback.RuntimeObservationFallback.WhenChanging(objectToMonitor, property1, property2); } - if (callerLineNumber == 69 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) + if (callerLineNumber == 71 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { return __WhenChanging_000011A95039C09F(objectToMonitor); } @@ -49,7 +49,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Observables.CombineLatestObservable.Create( __propObs0, __propObs1, - (p1, p2) => (property1: p1, property2: p2)); + (p1, p2) => (Property1: p1, Property2: p2)); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_3P#WhenChangingDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_3P#WhenChangingDispatch.g.verified.cs index 65fbe6c0..6a4af19d 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_3P#WhenChangingDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.MP_3P#WhenChangingDispatch.g.verified.cs @@ -61,7 +61,7 @@ internal static partial class __ReactiveUIGeneratedBindings __propObs0, __propObs1, __propObs2, - (p1, p2, p3) => (property1: p1, property2: p2, property3: p3)); + (p1, p2, p3) => (Property1: p1, Property2: p2, Property3: p3)); } } diff --git a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.SP_INPC_CFP#WhenChangingDispatch.g.verified.cs b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.SP_INPC_CFP#WhenChangingDispatch.g.verified.cs index 1744cfb3..79ae0c52 100644 --- a/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.SP_INPC_CFP#WhenChangingDispatch.g.verified.cs +++ b/src/tests/ReactiveUI.Binding.SourceGenerators.Tests/WCnG.SP_INPC_CFP#WhenChangingDispatch.g.verified.cs @@ -25,7 +25,7 @@ internal static partial class __ReactiveUIGeneratedBindings return global::ReactiveUI.Binding.Fallback.RuntimeObservationFallback.WhenChanging(objectToMonitor, property1); } - if (callerLineNumber == 49 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) + if (callerLineNumber == 51 && callerFilePath.EndsWith("", global::System.StringComparison.OrdinalIgnoreCase)) { return __WhenChanging_7FFFD2B6A9CCF5C7(objectToMonitor); } diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/BindingTypeConverterTryConvertTypedTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/BindingTypeConverterTryConvertTypedTests.cs index 82983e3f..74588317 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/BindingTypeConverterTryConvertTypedTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/BindingTypeConverterTryConvertTypedTests.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.Tests.Bindings; /// Unit tests for to ensure coverage of the base class dispatch path. @@ -49,120 +51,140 @@ public class BindingTypeConverterTryConvertTypedTests /// Verifies ByteToStringTypeConverter converts a byte value to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ByteToString_Success() => AssertConverterSuccess(new ByteToStringTypeConverter(), ByteValue, "42"); /// Verifies ByteToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ByteToString_Failure_WrongType() => AssertConverterFailure(new ByteToStringTypeConverter(), WrongTypeInput); /// Verifies ByteToStringTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ByteToString_Failure_Null() => AssertConverterFailure(new ByteToStringTypeConverter(), null); /// Verifies IntegerToStringTypeConverter converts an int value to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task IntegerToString_Success() => AssertConverterSuccess(new IntegerToStringTypeConverter(), IntValue, "123"); /// Verifies IntegerToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task IntegerToString_Failure_WrongType() => AssertConverterFailure(new IntegerToStringTypeConverter(), WrongTypeInput); /// Verifies IntegerToStringTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task IntegerToString_Failure_Null() => AssertConverterFailure(new IntegerToStringTypeConverter(), null); /// Verifies StringToIntegerTypeConverter converts a string to an int. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToInteger_Success() => AssertConverterSuccess(new StringToIntegerTypeConverter(), "456", ParsedIntValue); /// Verifies BooleanToStringTypeConverter converts true to "True". /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task BooleanToString_Success() => AssertConverterSuccess(new BooleanToStringTypeConverter(), true, "True"); /// Verifies DoubleToStringTypeConverter converts a double to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DoubleToString_Success() => AssertConverterSuccess(new DoubleToStringTypeConverter(), DoubleValue, DoubleValue.ToString(System.Globalization.CultureInfo.CurrentCulture)); /// Verifies DoubleToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DoubleToString_Failure_WrongType() => AssertConverterFailure(new DoubleToStringTypeConverter(), WrongTypeInput); /// Verifies DoubleToStringTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DoubleToString_Failure_Null() => AssertConverterFailure(new DoubleToStringTypeConverter(), null); /// Verifies LongToStringTypeConverter converts a long to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task LongToString_Success() => AssertConverterSuccess(new LongToStringTypeConverter(), LongValue, "9876543210"); /// Verifies LongToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task LongToString_Failure_WrongType() => AssertConverterFailure(new LongToStringTypeConverter(), WrongTypeInput); /// Verifies LongToStringTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task LongToString_Failure_Null() => AssertConverterFailure(new LongToStringTypeConverter(), null); /// Verifies ShortToStringTypeConverter converts a short to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ShortToString_Success() => AssertConverterSuccess(new ShortToStringTypeConverter(), ShortValue, "321"); /// Verifies ShortToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ShortToString_Failure_WrongType() => AssertConverterFailure(new ShortToStringTypeConverter(), WrongTypeInput); /// Verifies ShortToStringTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ShortToString_Failure_Null() => AssertConverterFailure(new ShortToStringTypeConverter(), null); /// Verifies SingleToStringTypeConverter converts a float to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task SingleToString_Success() => AssertConverterSuccess(new SingleToStringTypeConverter(), SingleValue, SingleValue.ToString(System.Globalization.CultureInfo.CurrentCulture)); /// Verifies SingleToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task SingleToString_Failure_WrongType() => AssertConverterFailure(new SingleToStringTypeConverter(), WrongTypeInput); /// Verifies SingleToStringTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task SingleToString_Failure_Null() => AssertConverterFailure(new SingleToStringTypeConverter(), null); @@ -172,126 +194,147 @@ public Task SingleToString_Failure_Null() => /// Verifies NullableByteToStringTypeConverter converts a byte to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableByteToString_Success() => AssertConverterSuccess(new NullableByteToStringTypeConverter(), ByteValue, "42"); /// Verifies NullableByteToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableByteToString_Failure_WrongType() => AssertConverterFailure(new NullableByteToStringTypeConverter(), WrongTypeInput); /// Verifies NullableByteToStringTypeConverter succeeds when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableByteToString_Success_Null() => AssertConverterSuccess(new NullableByteToStringTypeConverter(), null, null); /// Verifies NullableDecimalToStringTypeConverter converts a decimal to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDecimalToString_Success() => AssertConverterSuccess(new NullableDecimalToStringTypeConverter(), DecimalValue, DecimalValue.ToString(System.Globalization.CultureInfo.CurrentCulture)); /// Verifies NullableDecimalToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDecimalToString_Failure_WrongType() => AssertConverterFailure(new NullableDecimalToStringTypeConverter(), WrongTypeInput); /// Verifies NullableDecimalToStringTypeConverter succeeds when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDecimalToString_Success_Null() => AssertConverterSuccess(new NullableDecimalToStringTypeConverter(), null, null); /// Verifies NullableDoubleToStringTypeConverter converts a double to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDoubleToString_Success() => AssertConverterSuccess(new NullableDoubleToStringTypeConverter(), EulerDoubleValue, EulerDoubleValue.ToString(System.Globalization.CultureInfo.CurrentCulture)); /// Verifies NullableDoubleToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDoubleToString_Failure_WrongType() => AssertConverterFailure(new NullableDoubleToStringTypeConverter(), WrongTypeInput); /// Verifies NullableDoubleToStringTypeConverter succeeds when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDoubleToString_Success_Null() => AssertConverterSuccess(new NullableDoubleToStringTypeConverter(), null, null); /// Verifies NullableIntegerToStringTypeConverter converts an int to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableIntegerToString_Success() => AssertConverterSuccess(new NullableIntegerToStringTypeConverter(), IntValue, "123"); /// Verifies NullableIntegerToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableIntegerToString_Failure_WrongType() => AssertConverterFailure(new NullableIntegerToStringTypeConverter(), WrongTypeInput); /// Verifies NullableIntegerToStringTypeConverter succeeds when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableIntegerToString_Success_Null() => AssertConverterSuccess(new NullableIntegerToStringTypeConverter(), null, null); /// Verifies NullableLongToStringTypeConverter converts a long to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableLongToString_Success() => AssertConverterSuccess(new NullableLongToStringTypeConverter(), LongValue, "9876543210"); /// Verifies NullableLongToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableLongToString_Failure_WrongType() => AssertConverterFailure(new NullableLongToStringTypeConverter(), WrongTypeInput); /// Verifies NullableLongToStringTypeConverter succeeds when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableLongToString_Success_Null() => AssertConverterSuccess(new NullableLongToStringTypeConverter(), null, null); /// Verifies NullableShortToStringTypeConverter converts a short to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableShortToString_Success() => AssertConverterSuccess(new NullableShortToStringTypeConverter(), ShortValue, "321"); /// Verifies NullableShortToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableShortToString_Failure_WrongType() => AssertConverterFailure(new NullableShortToStringTypeConverter(), WrongTypeInput); /// Verifies NullableShortToStringTypeConverter succeeds when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableShortToString_Success_Null() => AssertConverterSuccess(new NullableShortToStringTypeConverter(), null, null); /// Verifies NullableSingleToStringTypeConverter converts a float to its string representation. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableSingleToString_Success() => AssertConverterSuccess(new NullableSingleToStringTypeConverter(), SingleValue, SingleValue.ToString(System.Globalization.CultureInfo.CurrentCulture)); /// Verifies NullableSingleToStringTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableSingleToString_Failure_WrongType() => AssertConverterFailure(new NullableSingleToStringTypeConverter(), WrongTypeInput); /// Verifies NullableSingleToStringTypeConverter succeeds when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableSingleToString_Success_Null() => AssertConverterSuccess(new NullableSingleToStringTypeConverter(), null, null); @@ -301,126 +344,147 @@ public Task NullableSingleToString_Success_Null() => /// Verifies DoubleToNullableDoubleTypeConverter converts a double to nullable double. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DoubleToNullableDouble_Success() => AssertConverterSuccess(new DoubleToNullableDoubleTypeConverter(), DoubleValue, (double?)DoubleValue); /// Verifies DoubleToNullableDoubleTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DoubleToNullableDouble_Failure_WrongType() => AssertConverterFailure(new DoubleToNullableDoubleTypeConverter(), WrongTypeInput); /// Verifies DoubleToNullableDoubleTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DoubleToNullableDouble_Failure_Null() => AssertConverterFailure(new DoubleToNullableDoubleTypeConverter(), null); /// Verifies IntegerToNullableIntegerTypeConverter converts an int to nullable int. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task IntegerToNullableInteger_Success() => AssertConverterSuccess(new IntegerToNullableIntegerTypeConverter(), SmallIntValue, (int?)SmallIntValue); /// Verifies IntegerToNullableIntegerTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task IntegerToNullableInteger_Failure_WrongType() => AssertConverterFailure(new IntegerToNullableIntegerTypeConverter(), WrongTypeInput); /// Verifies IntegerToNullableIntegerTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task IntegerToNullableInteger_Failure_Null() => AssertConverterFailure(new IntegerToNullableIntegerTypeConverter(), null); /// Verifies ByteToNullableByteTypeConverter converts a byte to nullable byte. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ByteToNullableByte_Success() => AssertConverterSuccess(new ByteToNullableByteTypeConverter(), SmallByteValue, (byte?)SmallByteValue); /// Verifies ByteToNullableByteTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ByteToNullableByte_Failure_WrongType() => AssertConverterFailure(new ByteToNullableByteTypeConverter(), WrongTypeInput); /// Verifies ByteToNullableByteTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ByteToNullableByte_Failure_Null() => AssertConverterFailure(new ByteToNullableByteTypeConverter(), null); /// Verifies LongToNullableLongTypeConverter converts a long to nullable long. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task LongToNullableLong_Success() => AssertConverterSuccess(new LongToNullableLongTypeConverter(), LongValue, (long?)LongValue); /// Verifies LongToNullableLongTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task LongToNullableLong_Failure_WrongType() => AssertConverterFailure(new LongToNullableLongTypeConverter(), WrongTypeInput); /// Verifies LongToNullableLongTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task LongToNullableLong_Failure_Null() => AssertConverterFailure(new LongToNullableLongTypeConverter(), null); /// Verifies ShortToNullableShortTypeConverter converts a short to nullable short. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ShortToNullableShort_Success() => AssertConverterSuccess(new ShortToNullableShortTypeConverter(), ShortValue, (short?)ShortValue); /// Verifies ShortToNullableShortTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ShortToNullableShort_Failure_WrongType() => AssertConverterFailure(new ShortToNullableShortTypeConverter(), WrongTypeInput); /// Verifies ShortToNullableShortTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ShortToNullableShort_Failure_Null() => AssertConverterFailure(new ShortToNullableShortTypeConverter(), null); /// Verifies SingleToNullableSingleTypeConverter converts a float to nullable float. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task SingleToNullableSingle_Success() => AssertConverterSuccess(new SingleToNullableSingleTypeConverter(), SingleValue, (float?)SingleValue); /// Verifies SingleToNullableSingleTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task SingleToNullableSingle_Failure_WrongType() => AssertConverterFailure(new SingleToNullableSingleTypeConverter(), WrongTypeInput); /// Verifies SingleToNullableSingleTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task SingleToNullableSingle_Failure_Null() => AssertConverterFailure(new SingleToNullableSingleTypeConverter(), null); /// Verifies DecimalToNullableDecimalTypeConverter converts a decimal to nullable decimal. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DecimalToNullableDecimal_Success() => AssertConverterSuccess(new DecimalToNullableDecimalTypeConverter(), DecimalValue, (decimal?)DecimalValue); /// Verifies DecimalToNullableDecimalTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DecimalToNullableDecimal_Failure_WrongType() => AssertConverterFailure(new DecimalToNullableDecimalTypeConverter(), WrongTypeInput); /// Verifies DecimalToNullableDecimalTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DecimalToNullableDecimal_Failure_Null() => AssertConverterFailure(new DecimalToNullableDecimalTypeConverter(), null); @@ -430,126 +494,147 @@ public Task DecimalToNullableDecimal_Failure_Null() => /// Verifies NullableDoubleToDoubleTypeConverter converts a double value successfully. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDoubleToDouble_Success() => AssertConverterSuccess(new NullableDoubleToDoubleTypeConverter(), DoubleValue, DoubleValue); /// Verifies NullableDoubleToDoubleTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDoubleToDouble_Failure_WrongType() => AssertConverterFailure(new NullableDoubleToDoubleTypeConverter(), WrongTypeInput); /// Verifies NullableDoubleToDoubleTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDoubleToDouble_Failure_Null() => AssertConverterFailure(new NullableDoubleToDoubleTypeConverter(), null); /// Verifies NullableIntegerToIntegerTypeConverter converts an int value successfully. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableIntegerToInteger_Success() => AssertConverterSuccess(new NullableIntegerToIntegerTypeConverter(), SmallIntValue, SmallIntValue); /// Verifies NullableIntegerToIntegerTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableIntegerToInteger_Failure_WrongType() => AssertConverterFailure(new NullableIntegerToIntegerTypeConverter(), WrongTypeInput); /// Verifies NullableIntegerToIntegerTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableIntegerToInteger_Failure_Null() => AssertConverterFailure(new NullableIntegerToIntegerTypeConverter(), null); /// Verifies NullableByteToByteTypeConverter converts a byte value successfully. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableByteToByte_Success() => AssertConverterSuccess(new NullableByteToByteTypeConverter(), SmallByteValue, SmallByteValue); /// Verifies NullableByteToByteTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableByteToByte_Failure_WrongType() => AssertConverterFailure(new NullableByteToByteTypeConverter(), WrongTypeInput); /// Verifies NullableByteToByteTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableByteToByte_Failure_Null() => AssertConverterFailure(new NullableByteToByteTypeConverter(), null); /// Verifies NullableLongToLongTypeConverter converts a long value successfully. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableLongToLong_Success() => AssertConverterSuccess(new NullableLongToLongTypeConverter(), LongValue, LongValue); /// Verifies NullableLongToLongTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableLongToLong_Failure_WrongType() => AssertConverterFailure(new NullableLongToLongTypeConverter(), WrongTypeInput); /// Verifies NullableLongToLongTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableLongToLong_Failure_Null() => AssertConverterFailure(new NullableLongToLongTypeConverter(), null); /// Verifies NullableShortToShortTypeConverter converts a short value successfully. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableShortToShort_Success() => AssertConverterSuccess(new NullableShortToShortTypeConverter(), ShortValue, ShortValue); /// Verifies NullableShortToShortTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableShortToShort_Failure_WrongType() => AssertConverterFailure(new NullableShortToShortTypeConverter(), WrongTypeInput); /// Verifies NullableShortToShortTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableShortToShort_Failure_Null() => AssertConverterFailure(new NullableShortToShortTypeConverter(), null); /// Verifies NullableSingleToSingleTypeConverter converts a float value successfully. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableSingleToSingle_Success() => AssertConverterSuccess(new NullableSingleToSingleTypeConverter(), SingleValue, SingleValue); /// Verifies NullableSingleToSingleTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableSingleToSingle_Failure_WrongType() => AssertConverterFailure(new NullableSingleToSingleTypeConverter(), WrongTypeInput); /// Verifies NullableSingleToSingleTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableSingleToSingle_Failure_Null() => AssertConverterFailure(new NullableSingleToSingleTypeConverter(), null); /// Verifies NullableDecimalToDecimalTypeConverter converts a decimal value successfully. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDecimalToDecimal_Success() => AssertConverterSuccess(new NullableDecimalToDecimalTypeConverter(), DecimalValue, DecimalValue); /// Verifies NullableDecimalToDecimalTypeConverter fails when given a wrong type. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDecimalToDecimal_Failure_WrongType() => AssertConverterFailure(new NullableDecimalToDecimalTypeConverter(), WrongTypeInput); /// Verifies NullableDecimalToDecimalTypeConverter fails when given null. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDecimalToDecimal_Failure_Null() => AssertConverterFailure(new NullableDecimalToDecimalTypeConverter(), null); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/BindingTypeConvertersUnitTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/BindingTypeConvertersUnitTests.cs index ef14764b..a8c9b9ea 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/BindingTypeConvertersUnitTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/BindingTypeConvertersUnitTests.cs @@ -79,7 +79,7 @@ public async Task LongToStringTypeConverter_Converts_Correctly() public async Task NullableByteToStringTypeConverter_Converts_Correctly() { var converter = new NullableByteToStringTypeConverter(); - byte? val = 123; + const byte val = 123; // Byte? to String var result = converter.TryConvert(val, null, out var output); @@ -119,7 +119,7 @@ public async Task NullableDoubleToStringTypeConverter_Converts_Correctly() public async Task NullableIntegerToStringTypeConverter_Converts_Correctly() { var converter = new NullableIntegerToStringTypeConverter(); - int? val = 123_456_789; + const int val = 123_456_789; var result = converter.TryConvert(val, null, out var output); await Assert.That(result).IsTrue(); @@ -132,7 +132,7 @@ public async Task NullableIntegerToStringTypeConverter_Converts_Correctly() public async Task NullableLongToStringTypeConverter_Converts_Correctly() { var converter = new NullableLongToStringTypeConverter(); - long? val = 1_234_567_890_123_456_789; + const long val = 1_234_567_890_123_456_789; var result = converter.TryConvert(val, null, out var output); await Assert.That(result).IsTrue(); @@ -145,7 +145,7 @@ public async Task NullableLongToStringTypeConverter_Converts_Correctly() public async Task NullableShortToStringTypeConverter_Converts_Correctly() { var converter = new NullableShortToStringTypeConverter(); - short? val = 12_345; + const short val = 12_345; var result = converter.TryConvert(val, null, out var output); await Assert.That(result).IsTrue(); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/BindingTypeConverterRegistryTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/BindingTypeConverterRegistryTests.cs index 3ba80c2f..eb00f743 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/BindingTypeConverterRegistryTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/BindingTypeConverterRegistryTests.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.Tests.Bindings.Converters; /// Tests for the internal method. @@ -12,7 +14,7 @@ public class BindingTypeConverterRegistryTests [Test] public async Task CloneRegistryShallow_EmptyDictionary_ReturnsEmpty() { - var source = new Dictionary<(Type fromType, Type toType), List>(); + var source = new Dictionary<(Type FromType, Type ToType), List>(); var clone = BindingTypeConverterRegistry.CloneRegistryShallow(source); @@ -26,7 +28,7 @@ public async Task CloneRegistryShallow_WithEntries_ReturnsShallowCopy() { var converter = new TestConverter(typeof(string), typeof(int)); var list = new List { converter }; - var source = new Dictionary<(Type fromType, Type toType), List> { [(typeof(string), typeof(int))] = list }; + var source = new Dictionary<(Type FromType, Type ToType), List> { [(typeof(string), typeof(int))] = list }; var clone = BindingTypeConverterRegistry.CloneRegistryShallow(source); @@ -45,7 +47,7 @@ public async Task CloneRegistryShallow_ModifyingClone_DoesNotAffectOriginal() { var converter = new TestConverter(typeof(string), typeof(int)); var list = new List { converter }; - var source = new Dictionary<(Type fromType, Type toType), List> { [(typeof(string), typeof(int))] = list }; + var source = new Dictionary<(Type FromType, Type ToType), List> { [(typeof(string), typeof(int))] = list }; var clone = BindingTypeConverterRegistry.CloneRegistryShallow(source); @@ -79,6 +81,7 @@ private sealed class TestConverter(Type fromType, Type toType) : IBindingTypeCon public Type ToType { get; } = toType; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => StubAffinity; /// diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterAffinityTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterAffinityTests.cs index 0b1d9bf2..0c9f1a17 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterAffinityTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterAffinityTests.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.Tests.Bindings.Converters; /// Tests for verifying converter affinity values are correctly set. @@ -16,6 +18,7 @@ public class ConverterAffinityTests /// Verifies that the EqualityTypeConverter has affinity 1 (last resort). /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task EqualityConverter_ShouldHaveAffinity1() => AssertAffinity(new EqualityTypeConverter(), LastResortAffinity); @@ -25,6 +28,7 @@ public Task EqualityConverter_ShouldHaveAffinity1() => /// Verifies that StringConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringConverter_ShouldHaveAffinity2() => AssertAffinity(new StringConverter(), StringConverterAffinity); @@ -34,84 +38,98 @@ public Task StringConverter_ShouldHaveAffinity2() => /// Verifies that ByteToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ByteToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new ByteToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableByteToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableByteToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableByteToStringTypeConverter(), StringConverterAffinity); /// Verifies that ShortToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task ShortToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new ShortToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableShortToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableShortToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableShortToStringTypeConverter(), StringConverterAffinity); /// Verifies that IntegerToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task IntegerToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new IntegerToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableIntegerToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableIntegerToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableIntegerToStringTypeConverter(), StringConverterAffinity); /// Verifies that LongToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task LongToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new LongToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableLongToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableLongToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableLongToStringTypeConverter(), StringConverterAffinity); /// Verifies that SingleToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task SingleToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new SingleToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableSingleToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableSingleToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableSingleToStringTypeConverter(), StringConverterAffinity); /// Verifies that DoubleToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DoubleToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new DoubleToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableDoubleToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDoubleToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableDoubleToStringTypeConverter(), StringConverterAffinity); /// Verifies that DecimalToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DecimalToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new DecimalToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableDecimalToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDecimalToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableDecimalToStringTypeConverter(), StringConverterAffinity); @@ -121,84 +139,98 @@ public Task NullableDecimalToStringTypeConverter_ShouldHaveAffinity2() => /// Verifies that StringToByteTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToByteTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToByteTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableByteTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableByteTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableByteTypeConverter(), StringConverterAffinity); /// Verifies that StringToShortTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToShortTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToShortTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableShortTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableShortTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableShortTypeConverter(), StringConverterAffinity); /// Verifies that StringToIntegerTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToIntegerTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToIntegerTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableIntegerTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableIntegerTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableIntegerTypeConverter(), StringConverterAffinity); /// Verifies that StringToLongTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToLongTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToLongTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableLongTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableLongTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableLongTypeConverter(), StringConverterAffinity); /// Verifies that StringToSingleTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToSingleTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToSingleTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableSingleTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableSingleTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableSingleTypeConverter(), StringConverterAffinity); /// Verifies that StringToDoubleTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToDoubleTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToDoubleTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableDoubleTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableDoubleTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableDoubleTypeConverter(), StringConverterAffinity); /// Verifies that StringToDecimalTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToDecimalTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToDecimalTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableDecimalTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableDecimalTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableDecimalTypeConverter(), StringConverterAffinity); @@ -208,24 +240,28 @@ public Task StringToNullableDecimalTypeConverter_ShouldHaveAffinity2() => /// Verifies that BooleanToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task BooleanToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new BooleanToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableBooleanToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableBooleanToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableBooleanToStringTypeConverter(), StringConverterAffinity); /// Verifies that StringToBooleanTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToBooleanTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToBooleanTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableBooleanTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableBooleanTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableBooleanTypeConverter(), StringConverterAffinity); @@ -235,24 +271,28 @@ public Task StringToNullableBooleanTypeConverter_ShouldHaveAffinity2() => /// Verifies that GuidToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task GuidToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new GuidToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableGuidToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableGuidToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableGuidToStringTypeConverter(), StringConverterAffinity); /// Verifies that StringToGuidTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToGuidTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToGuidTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableGuidTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableGuidTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableGuidTypeConverter(), StringConverterAffinity); @@ -262,24 +302,28 @@ public Task StringToNullableGuidTypeConverter_ShouldHaveAffinity2() => /// Verifies that DateTimeToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DateTimeToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new DateTimeToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableDateTimeToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDateTimeToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableDateTimeToStringTypeConverter(), StringConverterAffinity); /// Verifies that StringToDateTimeTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToDateTimeTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToDateTimeTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableDateTimeTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableDateTimeTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableDateTimeTypeConverter(), StringConverterAffinity); @@ -289,24 +333,28 @@ public Task StringToNullableDateTimeTypeConverter_ShouldHaveAffinity2() => /// Verifies that DateTimeOffsetToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DateTimeOffsetToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new DateTimeOffsetToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableDateTimeOffsetToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDateTimeOffsetToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableDateTimeOffsetToStringTypeConverter(), StringConverterAffinity); /// Verifies that StringToDateTimeOffsetTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToDateTimeOffsetTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToDateTimeOffsetTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableDateTimeOffsetTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableDateTimeOffsetTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableDateTimeOffsetTypeConverter(), StringConverterAffinity); @@ -316,24 +364,28 @@ public Task StringToNullableDateTimeOffsetTypeConverter_ShouldHaveAffinity2() => /// Verifies that TimeSpanToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task TimeSpanToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new TimeSpanToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableTimeSpanToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableTimeSpanToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableTimeSpanToStringTypeConverter(), StringConverterAffinity); /// Verifies that StringToTimeSpanTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToTimeSpanTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToTimeSpanTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableTimeSpanTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableTimeSpanTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableTimeSpanTypeConverter(), StringConverterAffinity); @@ -343,24 +395,28 @@ public Task StringToNullableTimeSpanTypeConverter_ShouldHaveAffinity2() => /// Verifies that DateOnlyToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task DateOnlyToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new DateOnlyToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableDateOnlyToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableDateOnlyToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableDateOnlyToStringTypeConverter(), StringConverterAffinity); /// Verifies that StringToDateOnlyTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToDateOnlyTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToDateOnlyTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableDateOnlyTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableDateOnlyTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableDateOnlyTypeConverter(), StringConverterAffinity); @@ -370,24 +426,28 @@ public Task StringToNullableDateOnlyTypeConverter_ShouldHaveAffinity2() => /// Verifies that TimeOnlyToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task TimeOnlyToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new TimeOnlyToStringTypeConverter(), StringConverterAffinity); /// Verifies that NullableTimeOnlyToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task NullableTimeOnlyToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new NullableTimeOnlyToStringTypeConverter(), StringConverterAffinity); /// Verifies that StringToTimeOnlyTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToTimeOnlyTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToTimeOnlyTypeConverter(), StringConverterAffinity); /// Verifies that StringToNullableTimeOnlyTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToNullableTimeOnlyTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToNullableTimeOnlyTypeConverter(), StringConverterAffinity); @@ -397,12 +457,14 @@ public Task StringToNullableTimeOnlyTypeConverter_ShouldHaveAffinity2() => /// Verifies that UriToStringTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task UriToStringTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new UriToStringTypeConverter(), StringConverterAffinity); /// Verifies that StringToUriTypeConverter has affinity 2. /// A task representing the asynchronous test operation. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task StringToUriTypeConverter_ShouldHaveAffinity2() => AssertAffinity(new StringToUriTypeConverter(), StringConverterAffinity); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterMigrationHelperTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterMigrationHelperTests.cs index 97c2fcab..6f552dee 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterMigrationHelperTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterMigrationHelperTests.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.Tests.Bindings.Converters; /// @@ -299,18 +301,23 @@ private sealed class TestDependencyResolver : IReadonlyDependencyResolver /// Registers a service instance for later resolution. /// The service type to register. /// The service instance to register. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RegisterService(T? service) => _services.Add(service!); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public object? GetService(Type? serviceType) => _services.FirstOrDefault(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public object? GetService(Type? serviceType, string? contract) => _services.FirstOrDefault(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public T? GetService() => _services.OfType().FirstOrDefault(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public T? GetService(string? contract) => _services.OfType().FirstOrDefault(); /// @@ -321,9 +328,11 @@ public IEnumerable GetServices(Type? serviceType, string? contract) => _services.Where(static s => s is not null)!; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IEnumerable GetServices() => _services.OfType(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IEnumerable GetServices(string? contract) => _services.OfType(); } @@ -349,6 +358,7 @@ public override bool TryConvert(TFrom? from, object? conversionHint, [NotNullWhe private sealed class TestFallbackConverter(int affinity) : IBindingFallbackConverter { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects(Type fromType, Type toType) => affinity; /// @@ -376,9 +386,11 @@ private sealed class TestSetMethodConverter(int affinity) : ISetMethodBindingCon private readonly int _affinity = affinity; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects(Type? fromType, Type? toType) => _affinity; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public object? PerformSet(object? toTarget, object? newValue, object?[]? arguments) => null; } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterRegistryTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterRegistryTests.cs index ed234c10..72562d3a 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterRegistryTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterRegistryTests.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.Tests.Bindings.Converters; /// @@ -376,6 +378,7 @@ public override bool TryConvert(TFrom? from, object? conversionHint, [NotNullWhe private sealed class TestFallbackConverter(int baseAffinity) : IBindingFallbackConverter { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type fromType, @@ -402,9 +405,11 @@ public bool TryConvert( private sealed class TestSetMethodConverter(int baseAffinity) : ISetMethodBindingConverter { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects(Type? fromType, Type? toType) => baseAffinity; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public object? PerformSet(object? toTarget, object? newValue, object?[]? arguments) => newValue; } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterServiceIntegrationTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterServiceIntegrationTests.cs index 6003ab6e..b23e950f 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterServiceIntegrationTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/Converters/ConverterServiceIntegrationTests.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.Tests.Bindings.Converters; /// @@ -229,6 +231,7 @@ public async Task ZeroAffinityConverter_ShouldBeIgnoredInResolution() private sealed class TestFallbackConverter(int baseAffinity) : IBindingFallbackConverter { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type fromType, @@ -255,9 +258,11 @@ public bool TryConvert( private sealed class TestSetMethodConverter(int baseAffinity) : ISetMethodBindingConverter { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects(Type? fromType, Type? toType) => baseAffinity; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public object? PerformSet(object? toTarget, object? newValue, object?[]? arguments) => newValue; } diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/ReactiveBindingTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/ReactiveBindingTests.cs index d479ff14..8e64ef8c 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/ReactiveBindingTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/ReactiveBindingTests.cs @@ -59,13 +59,12 @@ public async Task Properties_ReturnConstructorValues() { var view = new FakeView(); var changed = Observable.Empty(); - var subscription = Disposable.Empty; var binding = new ReactiveBinding( view, changed, BindingDirection.TwoWay, - subscription); + Disposable.Empty); await Assert.That(binding.View).IsEqualTo(view); await Assert.That(binding.Direction).IsEqualTo(BindingDirection.TwoWay); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateOnlyToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateOnlyToStringTypeConverterTests.cs index 93f5f893..e8a3ce61 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateOnlyToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateOnlyToStringTypeConverterTests.cs @@ -47,9 +47,7 @@ public async Task TryConvert_DateOnly_Succeeds() public async Task TryConvert_MinValue_Succeeds() { var converter = new DateOnlyToStringTypeConverter(); - var value = DateOnly.MinValue; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(DateOnly.MinValue, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(DateOnly.MinValue.ToString()); @@ -61,9 +59,7 @@ public async Task TryConvert_MinValue_Succeeds() public async Task TryConvert_MaxValue_Succeeds() { var converter = new DateOnlyToStringTypeConverter(); - var value = DateOnly.MaxValue; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(DateOnly.MaxValue, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(DateOnly.MaxValue.ToString()); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateTimeOffsetToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateTimeOffsetToStringTypeConverterTests.cs index 823ee5b6..d8bcfd1c 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateTimeOffsetToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateTimeOffsetToStringTypeConverterTests.cs @@ -43,9 +43,7 @@ public async Task TryConvert_DateTimeOffset_Succeeds() public async Task TryConvert_MinValue_Succeeds() { var converter = new DateTimeOffsetToStringTypeConverter(); - var value = DateTimeOffset.MinValue; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(DateTimeOffset.MinValue, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(DateTimeOffset.MinValue.ToString()); @@ -57,9 +55,7 @@ public async Task TryConvert_MinValue_Succeeds() public async Task TryConvert_MaxValue_Succeeds() { var converter = new DateTimeOffsetToStringTypeConverter(); - var value = DateTimeOffset.MaxValue; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(DateTimeOffset.MaxValue, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(DateTimeOffset.MaxValue.ToString()); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateTimeToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateTimeToStringTypeConverterTests.cs index 07d2bc37..a0b1680e 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateTimeToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/DateTimeToStringTypeConverterTests.cs @@ -42,9 +42,7 @@ public async Task TryConvert_DateTime_Succeeds() public async Task TryConvert_MinValue_Succeeds() { var converter = new DateTimeToStringTypeConverter(); - var value = DateTime.MinValue; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(DateTime.MinValue, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(DateTime.MinValue.ToString(CultureInfo.CurrentCulture)); @@ -56,9 +54,7 @@ public async Task TryConvert_MinValue_Succeeds() public async Task TryConvert_MaxValue_Succeeds() { var converter = new DateTimeToStringTypeConverter(); - var value = DateTime.MaxValue; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(DateTime.MaxValue, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(DateTime.MaxValue.ToString(CultureInfo.CurrentCulture)); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/GuidToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/GuidToStringTypeConverterTests.cs index 78777f62..f8a7ba09 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/GuidToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/GuidToStringTypeConverterTests.cs @@ -40,9 +40,7 @@ public async Task TryConvert_Guid_Succeeds() public async Task TryConvert_EmptyGuid_Succeeds() { var converter = new GuidToStringTypeConverter(); - var value = Guid.Empty; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(Guid.Empty, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("00000000-0000-0000-0000-000000000000"); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableBooleanToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableBooleanToStringTypeConverterTests.cs index f4d3e9fe..2b23393f 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableBooleanToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableBooleanToStringTypeConverterTests.cs @@ -26,9 +26,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_True_ReturnsTrue() { var converter = new NullableBooleanToStringTypeConverter(); - bool? value = true; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(true, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("True"); @@ -40,9 +38,7 @@ public async Task TryConvert_True_ReturnsTrue() public async Task TryConvert_False_ReturnsFalse() { var converter = new NullableBooleanToStringTypeConverter(); - bool? value = false; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(false, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("False"); @@ -54,9 +50,7 @@ public async Task TryConvert_False_ReturnsFalse() public async Task TryConvert_Null_ReturnsNullString() { var converter = new NullableBooleanToStringTypeConverter(); - bool? value = null; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(null, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsNull(); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableByteToByteTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableByteToByteTypeConverterTests.cs index f264af91..f7a8693d 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableByteToByteTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableByteToByteTypeConverterTests.cs @@ -29,9 +29,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_WithValue_Succeeds() { var converter = new NullableByteToByteTypeConverter(); - byte? value = 42; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleByte, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(SampleByte); @@ -43,8 +41,7 @@ public async Task TryConvert_WithValue_Succeeds() public async Task TryConvert_Null_ReturnsFalse() { var converter = new NullableByteToByteTypeConverter(); - byte? value = null; - var result = converter.TryConvert(value, null, out _); + var result = converter.TryConvert(null, null, out _); await Assert.That(result).IsFalse(); } @@ -73,9 +70,7 @@ public async Task ToType_ReturnsByte() public async Task TryConvertTyped_WithValidValue_ReturnsTrueAndOutput() { var converter = new NullableByteToByteTypeConverter(); - byte? value = 42; - - var success = converter.TryConvertTyped(value, null, out var result); + var success = converter.TryConvertTyped(SampleByte, null, out var result); await Assert.That(success).IsTrue(); await Assert.That(result).IsEqualTo(SampleByte); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableByteToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableByteToStringTypeConverterTests.cs index 9d98e0b4..d69698b7 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableByteToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableByteToStringTypeConverterTests.cs @@ -13,6 +13,15 @@ public class NullableByteToStringTypeConverterTests /// Expected affinity returned for matched converter type pairs. private const int ExpectedAffinity = 2; + /// Byte value converted with the hexadecimal format hint. + private const byte HexByte = 255; + + /// Byte value narrow enough for the width hint to show its zero padding. + private const byte PaddedByte = 5; + + /// Sample byte value used for conversion round-trips. + private const byte SampleByte = 123; + /// Verifies GetAffinityForObjects Returns2. /// A task representing the asynchronous operation. [Test] @@ -29,9 +38,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_ByteNullableToString_Succeeds() { var converter = new NullableByteToStringTypeConverter(); - byte? value = 123; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleByte, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("123"); @@ -84,9 +91,7 @@ public async Task TryConvert_NullValue_ReturnsTrue() public async Task TryConvert_WithConversionHint_FormatsCorrectly() { var converter = new NullableByteToStringTypeConverter(); - byte? value = 5; - - var result = converter.TryConvert(value, ConversionHint, out var output); + var result = converter.TryConvert(PaddedByte, ConversionHint, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("005"); @@ -98,9 +103,7 @@ public async Task TryConvert_WithConversionHint_FormatsCorrectly() public async Task TryConvert_WithStringFormatHint_FormatsCorrectly() { var converter = new NullableByteToStringTypeConverter(); - byte? value = 255; - - var result = converter.TryConvert(value, "X", out var output); + var result = converter.TryConvert(HexByte, "X", out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("FF"); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateOnlyToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateOnlyToStringTypeConverterTests.cs index 5e249e45..49e4674f 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateOnlyToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateOnlyToStringTypeConverterTests.cs @@ -47,9 +47,7 @@ public async Task TryConvert_DateOnly_Succeeds() public async Task TryConvert_Null_ReturnsNullString() { var converter = new NullableDateOnlyToStringTypeConverter(); - DateOnly? value = null; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(null, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsNull(); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateTimeOffsetToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateTimeOffsetToStringTypeConverterTests.cs index 70b3d274..c4b9a33b 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateTimeOffsetToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateTimeOffsetToStringTypeConverterTests.cs @@ -43,9 +43,7 @@ public async Task TryConvert_DateTimeOffset_Succeeds() public async Task TryConvert_Null_ReturnsNullString() { var converter = new NullableDateTimeOffsetToStringTypeConverter(); - DateTimeOffset? value = null; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(null, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsNull(); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateTimeToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateTimeToStringTypeConverterTests.cs index ead7dbf9..202d7a27 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateTimeToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDateTimeToStringTypeConverterTests.cs @@ -40,9 +40,7 @@ public async Task TryConvert_DateTime_Succeeds() public async Task TryConvert_Null_ReturnsNullString() { var converter = new NullableDateTimeToStringTypeConverter(); - DateTime? value = null; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(null, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsNull(); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDecimalToDecimalTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDecimalToDecimalTypeConverterTests.cs index 4f623594..ed078edc 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDecimalToDecimalTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDecimalToDecimalTypeConverterTests.cs @@ -32,9 +32,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_WithValue_Succeeds() { var converter = new NullableDecimalToDecimalTypeConverter(); - decimal? value = 123.456789M; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleDecimal, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(SampleDecimal); @@ -46,8 +44,7 @@ public async Task TryConvert_WithValue_Succeeds() public async Task TryConvert_Null_ReturnsFalse() { var converter = new NullableDecimalToDecimalTypeConverter(); - decimal? value = null; - var result = converter.TryConvert(value, null, out _); + var result = converter.TryConvert(null, null, out _); await Assert.That(result).IsFalse(); } @@ -76,9 +73,7 @@ public async Task ToType_ReturnsDecimal() public async Task TryConvertTyped_WithValidValue_ReturnsTrueAndOutput() { var converter = new NullableDecimalToDecimalTypeConverter(); - decimal? value = 42.5M; - - var success = converter.TryConvertTyped(value, null, out var result); + var success = converter.TryConvertTyped(RoundedDecimal, null, out var result); await Assert.That(success).IsTrue(); await Assert.That(result).IsEqualTo(RoundedDecimal); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDecimalToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDecimalToStringTypeConverterTests.cs index a2aa0902..adb3b414 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDecimalToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDecimalToStringTypeConverterTests.cs @@ -10,6 +10,15 @@ public class NullableDecimalToStringTypeConverterTests /// Expected affinity returned for matched converter type pairs. private const int ExpectedAffinity = 2; + /// Decimal value converted with a width hint that pads it to two decimal places. + private const decimal FormattedDecimal = 42.5M; + + /// Negative decimal value used to check the sign survives conversion. + private const decimal NegativeDecimal = -123.456M; + + /// Sample decimal value used for conversion round-trips. + private const decimal SampleDecimal = 123.456M; + /// Verifies GetAffinityForObjects Returns2. /// A task representing the asynchronous operation. [Test] @@ -26,9 +35,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_DecimalNullableToString_Succeeds() { var converter = new NullableDecimalToStringTypeConverter(); - decimal? value = 123.456M; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleDecimal, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("123.456"); @@ -68,9 +75,7 @@ public async Task TryConvert_MinValue_Succeeds() public async Task TryConvert_NegativeValue_Succeeds() { var converter = new NullableDecimalToStringTypeConverter(); - decimal? value = -123.456M; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(NegativeDecimal, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("-123.456"); @@ -93,9 +98,7 @@ public async Task TryConvert_NullValue_ReturnsTrue() public async Task TryConvert_WithConversionHint_FormatsCorrectly() { var converter = new NullableDecimalToStringTypeConverter(); - decimal? value = 42.5M; - - var result = converter.TryConvert(value, ExpectedAffinity, out var output); + var result = converter.TryConvert(FormattedDecimal, ExpectedAffinity, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("42.50"); @@ -107,9 +110,7 @@ public async Task TryConvert_WithConversionHint_FormatsCorrectly() public async Task TryConvert_Zero_Succeeds() { var converter = new NullableDecimalToStringTypeConverter(); - decimal? value = 0M; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(0M, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("0"); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDoubleToDoubleTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDoubleToDoubleTypeConverterTests.cs index fe0e1d7f..0ee63e0e 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDoubleToDoubleTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDoubleToDoubleTypeConverterTests.cs @@ -29,9 +29,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_WithValue_Succeeds() { var converter = new NullableDoubleToDoubleTypeConverter(); - double? value = 123.456789; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleDouble, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(SampleDouble); @@ -43,8 +41,7 @@ public async Task TryConvert_WithValue_Succeeds() public async Task TryConvert_Null_ReturnsFalse() { var converter = new NullableDoubleToDoubleTypeConverter(); - double? value = null; - var result = converter.TryConvert(value, null, out _); + var result = converter.TryConvert(null, null, out _); await Assert.That(result).IsFalse(); } diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDoubleToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDoubleToStringTypeConverterTests.cs index 23a6a24e..89121044 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDoubleToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableDoubleToStringTypeConverterTests.cs @@ -10,6 +10,9 @@ public class NullableDoubleToStringTypeConverterTests /// Expected affinity returned for matched converter type pairs. private const int ExpectedAffinity = 2; + /// Double value converted with a width hint that pads it to two decimal places. + private const double FormattedDouble = 42.5; + /// Verifies GetAffinityForObjects Returns2. /// A task representing the asynchronous operation. [Test] @@ -93,9 +96,7 @@ public async Task TryConvert_NullValue_ReturnsTrue() public async Task TryConvert_WithConversionHint_FormatsCorrectly() { var converter = new NullableDoubleToStringTypeConverter(); - double? value = 42.5; - - var result = converter.TryConvert(value, ExpectedAffinity, out var output); + var result = converter.TryConvert(FormattedDouble, ExpectedAffinity, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("42.50"); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableGuidToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableGuidToStringTypeConverterTests.cs index 3955cce4..dd4801e3 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableGuidToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableGuidToStringTypeConverterTests.cs @@ -40,9 +40,7 @@ public async Task TryConvert_Guid_Succeeds() public async Task TryConvert_Null_ReturnsNullString() { var converter = new NullableGuidToStringTypeConverter(); - Guid? value = null; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(null, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsNull(); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableIntegerToIntegerTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableIntegerToIntegerTypeConverterTests.cs index 9844fa67..cc0e865c 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableIntegerToIntegerTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableIntegerToIntegerTypeConverterTests.cs @@ -32,9 +32,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_WithValue_Succeeds() { var converter = new NullableIntegerToIntegerTypeConverter(); - int? value = 123_456; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleInteger, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(SampleInteger); @@ -46,8 +44,7 @@ public async Task TryConvert_WithValue_Succeeds() public async Task TryConvert_Null_ReturnsFalse() { var converter = new NullableIntegerToIntegerTypeConverter(); - int? value = null; - var result = converter.TryConvert(value, null, out _); + var result = converter.TryConvert(null, null, out _); await Assert.That(result).IsFalse(); } @@ -76,9 +73,7 @@ public async Task ToType_ReturnsInt() public async Task TryConvertTyped_WithValidValue_ReturnsTrueAndOutput() { var converter = new NullableIntegerToIntegerTypeConverter(); - int? value = 42; - - var success = converter.TryConvertTyped(value, null, out var result); + var success = converter.TryConvertTyped(SmallInteger, null, out var result); await Assert.That(success).IsTrue(); await Assert.That(result).IsEqualTo(SmallInteger); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableIntegerToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableIntegerToStringTypeConverterTests.cs index ff24c1d4..96fc6074 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableIntegerToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableIntegerToStringTypeConverterTests.cs @@ -13,6 +13,15 @@ public class NullableIntegerToStringTypeConverterTests /// Expected affinity returned for matched converter type pairs. private const int ExpectedAffinity = 2; + /// Integer value converted with the hexadecimal format hint. + private const int HexInteger = 255; + + /// Integer value narrow enough for the width hint to show its zero padding. + private const int PaddedInteger = 42; + + /// Sample integer value used for conversion round-trips. + private const int SampleInteger = 123_456; + /// Verifies GetAffinityForObjects Returns2. /// A task representing the asynchronous operation. [Test] @@ -29,9 +38,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_IntNullableToString_Succeeds() { var converter = new NullableIntegerToStringTypeConverter(); - int? value = 123_456; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleInteger, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("123456"); @@ -82,9 +89,7 @@ public async Task TryConvert_NullValue_ReturnsTrue() public async Task TryConvert_WithConversionHint_FormatsCorrectly() { var converter = new NullableIntegerToStringTypeConverter(); - int? value = 42; - - var result = converter.TryConvert(value, ConversionHint, out var output); + var result = converter.TryConvert(PaddedInteger, ConversionHint, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("00000042"); @@ -96,9 +101,7 @@ public async Task TryConvert_WithConversionHint_FormatsCorrectly() public async Task TryConvert_WithStringFormatHint_FormatsCorrectly() { var converter = new NullableIntegerToStringTypeConverter(); - int? value = 255; - - var result = converter.TryConvert(value, "X", out var output); + var result = converter.TryConvert(HexInteger, "X", out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("FF"); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableLongToLongTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableLongToLongTypeConverterTests.cs index 525b5a38..962e2b77 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableLongToLongTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableLongToLongTypeConverterTests.cs @@ -32,9 +32,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_WithValue_Succeeds() { var converter = new NullableLongToLongTypeConverter(); - long? value = 1_234_567_890_123_456L; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleLong, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(SampleLong); @@ -46,8 +44,7 @@ public async Task TryConvert_WithValue_Succeeds() public async Task TryConvert_Null_ReturnsFalse() { var converter = new NullableLongToLongTypeConverter(); - long? value = null; - var result = converter.TryConvert(value, null, out _); + var result = converter.TryConvert(null, null, out _); await Assert.That(result).IsFalse(); } @@ -76,9 +73,7 @@ public async Task ToType_ReturnsLong() public async Task TryConvertTyped_WithValidValue_ReturnsTrueAndOutput() { var converter = new NullableLongToLongTypeConverter(); - long? value = 42L; - - var success = converter.TryConvertTyped(value, null, out var result); + var success = converter.TryConvertTyped(SmallLong, null, out var result); await Assert.That(success).IsTrue(); await Assert.That(result).IsEqualTo(SmallLong); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableLongToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableLongToStringTypeConverterTests.cs index d128fbba..544cbadf 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableLongToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableLongToStringTypeConverterTests.cs @@ -13,6 +13,15 @@ public class NullableLongToStringTypeConverterTests /// Expected affinity returned for matched converter type pairs. private const int ExpectedAffinity = 2; + /// Long value converted with the hexadecimal format hint. + private const long HexLong = 255L; + + /// Long value narrow enough for the width hint to show its zero padding. + private const long PaddedLong = 42L; + + /// Sample long value used for conversion round-trips. + private const long SampleLong = 123_456_789_012L; + /// Verifies GetAffinityForObjects Returns2. /// A task representing the asynchronous operation. [Test] @@ -29,9 +38,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_LongNullableToString_Succeeds() { var converter = new NullableLongToStringTypeConverter(); - long? value = 123_456_789_012; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleLong, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("123456789012"); @@ -82,9 +89,7 @@ public async Task TryConvert_NullValue_ReturnsTrue() public async Task TryConvert_WithConversionHint_FormatsCorrectly() { var converter = new NullableLongToStringTypeConverter(); - long? value = 42; - - var result = converter.TryConvert(value, ConversionHint, out var output); + var result = converter.TryConvert(PaddedLong, ConversionHint, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("0000000042"); @@ -96,9 +101,7 @@ public async Task TryConvert_WithConversionHint_FormatsCorrectly() public async Task TryConvert_WithStringFormatHint_FormatsCorrectly() { var converter = new NullableLongToStringTypeConverter(); - long? value = 255; - - var result = converter.TryConvert(value, "X", out var output); + var result = converter.TryConvert(HexLong, "X", out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("FF"); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableShortToShortTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableShortToShortTypeConverterTests.cs index d0f458f5..0fc450eb 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableShortToShortTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableShortToShortTypeConverterTests.cs @@ -32,9 +32,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_WithValue_Succeeds() { var converter = new NullableShortToShortTypeConverter(); - short? value = 1_234; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleShort, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(SampleShort); @@ -46,8 +44,7 @@ public async Task TryConvert_WithValue_Succeeds() public async Task TryConvert_Null_ReturnsFalse() { var converter = new NullableShortToShortTypeConverter(); - short? value = null; - var result = converter.TryConvert(value, null, out _); + var result = converter.TryConvert(null, null, out _); await Assert.That(result).IsFalse(); } @@ -76,9 +73,7 @@ public async Task ToType_ReturnsShort() public async Task TryConvertTyped_WithValidValue_ReturnsTrueAndOutput() { var converter = new NullableShortToShortTypeConverter(); - short? value = 42; - - var success = converter.TryConvertTyped(value, null, out var result); + var success = converter.TryConvertTyped(SmallShort, null, out var result); await Assert.That(success).IsTrue(); await Assert.That(result).IsEqualTo(SmallShort); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableShortToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableShortToStringTypeConverterTests.cs index a8ffc81c..66afc305 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableShortToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableShortToStringTypeConverterTests.cs @@ -13,6 +13,15 @@ public class NullableShortToStringTypeConverterTests /// Expected affinity returned for matched converter type pairs. private const int ExpectedAffinity = 2; + /// Short value converted with the hexadecimal format hint. + private const short HexShort = 255; + + /// Short value narrow enough for the width hint to show its zero padding. + private const short PaddedShort = 42; + + /// Sample short value used for conversion round-trips. + private const short SampleShort = 12_345; + /// Verifies GetAffinityForObjects Returns2. /// A task representing the asynchronous operation. [Test] @@ -68,9 +77,7 @@ public async Task TryConvert_NullValue_ReturnsTrue() public async Task TryConvert_ShortNullableToString_Succeeds() { var converter = new NullableShortToStringTypeConverter(); - short? value = 12_345; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleShort, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("12345"); @@ -82,9 +89,7 @@ public async Task TryConvert_ShortNullableToString_Succeeds() public async Task TryConvert_WithConversionHint_FormatsCorrectly() { var converter = new NullableShortToStringTypeConverter(); - short? value = 42; - - var result = converter.TryConvert(value, ConversionHint, out var output); + var result = converter.TryConvert(PaddedShort, ConversionHint, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("00042"); @@ -96,9 +101,7 @@ public async Task TryConvert_WithConversionHint_FormatsCorrectly() public async Task TryConvert_WithStringFormatHint_FormatsCorrectly() { var converter = new NullableShortToStringTypeConverter(); - short? value = 255; - - var result = converter.TryConvert(value, "X", out var output); + var result = converter.TryConvert(HexShort, "X", out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("FF"); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableSingleToSingleTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableSingleToSingleTypeConverterTests.cs index e4673ea8..5a5292bb 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableSingleToSingleTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableSingleToSingleTypeConverterTests.cs @@ -32,9 +32,7 @@ public async Task GetAffinityForObjects_Returns2() public async Task TryConvert_WithValue_Succeeds() { var converter = new NullableSingleToSingleTypeConverter(); - float? value = 123.45F; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(SampleSingle, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(SampleSingle); @@ -46,8 +44,7 @@ public async Task TryConvert_WithValue_Succeeds() public async Task TryConvert_Null_ReturnsFalse() { var converter = new NullableSingleToSingleTypeConverter(); - float? value = null; - var result = converter.TryConvert(value, null, out _); + var result = converter.TryConvert(null, null, out _); await Assert.That(result).IsFalse(); } @@ -76,9 +73,7 @@ public async Task ToType_ReturnsSingle() public async Task TryConvertTyped_WithValidValue_ReturnsTrueAndOutput() { var converter = new NullableSingleToSingleTypeConverter(); - float? value = 42.5F; - - var success = converter.TryConvertTyped(value, null, out var result); + var success = converter.TryConvertTyped(RoundedSingle, null, out var result); await Assert.That(success).IsTrue(); await Assert.That(result).IsEqualTo(RoundedSingle); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableSingleToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableSingleToStringTypeConverterTests.cs index 810ac5f0..464c0817 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableSingleToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableSingleToStringTypeConverterTests.cs @@ -10,6 +10,9 @@ public class NullableSingleToStringTypeConverterTests /// Expected affinity returned for matched converter type pairs. private const int ExpectedAffinity = 2; + /// Single-precision value converted with a width hint that pads it to two decimal places. + private const float FormattedSingle = 42.5F; + /// Verifies GetAffinityForObjects Returns2. /// A task representing the asynchronous operation. [Test] @@ -93,9 +96,7 @@ public async Task TryConvert_SingleNullableToString_Succeeds() public async Task TryConvert_WithConversionHint_FormatsCorrectly() { var converter = new NullableSingleToStringTypeConverter(); - float? value = 42.5F; - - var result = converter.TryConvert(value, ExpectedAffinity, out var output); + var result = converter.TryConvert(FormattedSingle, ExpectedAffinity, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("42.50"); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableTimeOnlyToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableTimeOnlyToStringTypeConverterTests.cs index 4517e5ed..806bbfa7 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableTimeOnlyToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableTimeOnlyToStringTypeConverterTests.cs @@ -50,9 +50,7 @@ public async Task TryConvert_TimeOnly_Succeeds() public async Task TryConvert_Null_ReturnsNullString() { var converter = new NullableTimeOnlyToStringTypeConverter(); - TimeOnly? value = null; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(null, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsNull(); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableTimeSpanToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableTimeSpanToStringTypeConverterTests.cs index 669ef44c..78fa2aac 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableTimeSpanToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/NullableTimeSpanToStringTypeConverterTests.cs @@ -43,9 +43,7 @@ public async Task TryConvert_TimeSpan_Succeeds() public async Task TryConvert_Null_ReturnsNullString() { var converter = new NullableTimeSpanToStringTypeConverter(); - TimeSpan? value = null; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(null, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsNull(); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/TimeOnlyToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/TimeOnlyToStringTypeConverterTests.cs index a0a48f24..a5d02c40 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/TimeOnlyToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/TimeOnlyToStringTypeConverterTests.cs @@ -50,9 +50,7 @@ public async Task TryConvert_TimeOnly_Succeeds() public async Task TryConvert_MinValue_Succeeds() { var converter = new TimeOnlyToStringTypeConverter(); - var value = TimeOnly.MinValue; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(TimeOnly.MinValue, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(TimeOnly.MinValue.ToString()); @@ -64,9 +62,7 @@ public async Task TryConvert_MinValue_Succeeds() public async Task TryConvert_MaxValue_Succeeds() { var converter = new TimeOnlyToStringTypeConverter(); - var value = TimeOnly.MaxValue; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(TimeOnly.MaxValue, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo(TimeOnly.MaxValue.ToString()); diff --git a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/TimeSpanToStringTypeConverterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/TimeSpanToStringTypeConverterTests.cs index b23d13bd..ced671be 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/TimeSpanToStringTypeConverterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Bindings/TypeConverters/TimeSpanToStringTypeConverterTests.cs @@ -46,9 +46,7 @@ public async Task TryConvert_TimeSpan_Succeeds() public async Task TryConvert_ZeroTimeSpan_Succeeds() { var converter = new TimeSpanToStringTypeConverter(); - var value = TimeSpan.Zero; - - var result = converter.TryConvert(value, null, out var output); + var result = converter.TryConvert(TimeSpan.Zero, null, out var output); await Assert.That(result).IsTrue(); await Assert.That(output).IsEqualTo("00:00:00"); diff --git a/src/tests/ReactiveUI.Binding.Tests/Builder/BuilderMixinsTests.cs b/src/tests/ReactiveUI.Binding.Tests/Builder/BuilderMixinsTests.cs index 143c11c1..250f9105 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Builder/BuilderMixinsTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Builder/BuilderMixinsTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Builder; using ReactiveUI.Binding.Mixins; using ReactiveUI.Binding.Tests.TestModels; @@ -24,8 +25,7 @@ public async Task BuildApp_WithValidBuilder_Succeeds() var builder = RxBindingBuilder.CreateReactiveUIBindingBuilder(); _ = builder.WithCoreServices(); - IAppBuilder appBuilder = builder; - var instance = appBuilder.BuildApp(); + var instance = ((IAppBuilder)builder).BuildApp(); await Assert.That(instance).IsNotNull(); } @@ -51,8 +51,7 @@ public async Task WithPlatformModule_DelegatesToBuilder() var builder = RxBindingBuilder.CreateReactiveUIBindingBuilder(); var registered = false; - IAppBuilder appBuilder = builder; - var result = appBuilder.WithPlatformModule(new TestModule(() => registered = true)); + var result = ((IAppBuilder)builder).WithPlatformModule(new TestModule(() => registered = true)); _ = builder.BuildApp(); @@ -81,8 +80,7 @@ public async Task WithRegistration_DelegatesToBuilder() var builder = RxBindingBuilder.CreateReactiveUIBindingBuilder(); var executed = false; - IAppBuilder appBuilder = builder; - var result = appBuilder.WithRegistration(_ => executed = true); + var result = ((IAppBuilder)builder).WithRegistration(_ => executed = true); await Assert.That(executed).IsTrue(); await Assert.That(result).IsNotNull(); @@ -112,8 +110,7 @@ public async Task WithConverter_RegistersConverterViaAppBuilder() typeof(bool), static (_, _) => (true, true)); - IAppBuilder appBuilder = builder; - var result = appBuilder.WithConverter(converter); + var result = ((IAppBuilder)builder).WithConverter(converter); var resolved = builder.ConverterService.TypedConverters.TryGetConverter(typeof(int), typeof(bool)); @@ -147,8 +144,7 @@ public async Task WithFallbackConverter_RegistersConverterViaAppBuilder() var builder = RxBindingBuilder.CreateReactiveUIBindingBuilder(); var converter = new StubFallbackConverter(static (_, _, _, _) => (true, "converted")); - IAppBuilder appBuilder = builder; - var result = appBuilder.WithFallbackConverter(converter); + var result = ((IAppBuilder)builder).WithFallbackConverter(converter); var allConverters = builder.ConverterService.FallbackConverters.GetAllConverters().ToList(); @@ -178,8 +174,7 @@ public async Task WithSetMethodConverter_RegistersConverterViaAppBuilder() var builder = RxBindingBuilder.CreateReactiveUIBindingBuilder(); var converter = new StubSetMethodBindingConverter(); - IAppBuilder appBuilder = builder; - var result = appBuilder.WithSetMethodConverter(converter); + var result = ((IAppBuilder)builder).WithSetMethodConverter(converter); var allConverters = builder.ConverterService.SetMethodConverters.GetAllConverters().ToList(); @@ -214,8 +209,7 @@ public async Task FluentChaining_ThroughIAppBuilder_Works() var fallbackConverter = new StubFallbackConverter(static (_, _, _, _) => (true, "fallback")); var setConverter = new StubSetMethodBindingConverter(); - IAppBuilder appBuilder = builder; - var result = appBuilder + var result = ((IAppBuilder)builder) .WithConverter(converter) .WithFallbackConverter(fallbackConverter) .WithSetMethodConverter(setConverter); @@ -288,6 +282,7 @@ private sealed class FakeAppBuilder : IAppBuilder /// Uses the current Splat locator. /// The builder instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IAppBuilder UseCurrentSplatLocator() => WithCoreServices(); /// Registers a module. @@ -304,6 +299,7 @@ public IAppBuilder UsingModule(T registrationModule) /// Builds the application instance. /// The application instance. + /// Always; the fake exists only to fail the builder type check. public IAppInstance Build() => throw new NotSupportedException(); } @@ -318,6 +314,7 @@ private sealed class TestModule : IModule public TestModule(Action onConfigure) => _onConfigure = onConfigure; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Configure(IMutableDependencyResolver resolver) => _onConfigure(); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Builder/ReactiveUIBindingBuilderTests.cs b/src/tests/ReactiveUI.Binding.Tests/Builder/ReactiveUIBindingBuilderTests.cs index 42b6a42c..832cabe2 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Builder/ReactiveUIBindingBuilderTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Builder/ReactiveUIBindingBuilderTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Builder; using ReactiveUI.Binding.Tests.TestModels; @@ -275,8 +276,7 @@ public async Task BuildApp_MarksAsInitialized() _ = builder.BuildApp(); - var action = RxBindingBuilder.EnsureInitialized; - await Assert.That(action).ThrowsNothing(); + await Assert.That(RxBindingBuilder.EnsureInitialized).ThrowsNothing(); } /// Verifies that multiple converters of different types can be registered and all appear in their respective registries. @@ -370,6 +370,7 @@ public async Task ConfigureViewLocator_RegistersConfiguredLocator() private sealed class TestModule(Action onConfigure) : Splat.Builder.IModule { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Configure(IMutableDependencyResolver resolver) => onConfigure(); } @@ -378,10 +379,12 @@ private sealed class StubCommandBinder : ICreatesCommandBinding { /// [SuppressMessage("Design", "SST1452:Unused type parameter", Justification = "Dictated by the interface this test stub implements.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObject(bool hasEventTarget) => 0; /// [RequiresUnreferencedCode("Test stub")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable? BindCommandToObject( System.Windows.Input.ICommand? command, T? target, @@ -391,6 +394,7 @@ private sealed class StubCommandBinder : ICreatesCommandBinding /// [SuppressMessage("Design", "SST1452:Unused type parameter", Justification = "Dictated by the interface this test stub implements.")] [RequiresUnreferencedCode("Test stub")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable? BindCommandToObject( System.Windows.Input.ICommand? command, T? target, @@ -399,6 +403,7 @@ private sealed class StubCommandBinder : ICreatesCommandBinding where T : class => null; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable? BindCommandToObject( System.Windows.Input.ICommand? command, T? target, diff --git a/src/tests/ReactiveUI.Binding.Tests/Builder/RxBindingBuilderTests.cs b/src/tests/ReactiveUI.Binding.Tests/Builder/RxBindingBuilderTests.cs index 911e7192..c4af384e 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Builder/RxBindingBuilderTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Builder/RxBindingBuilderTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Builder; namespace ReactiveUI.Binding.Tests.Builder; @@ -137,17 +138,21 @@ public async Task CreateReactiveUIBindingBuilder_ResolverNotReadonly_FallsBackTo private sealed class MutableOnlyResolver : IMutableDependencyResolver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool HasRegistration(Type? serviceType) => false; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool HasRegistration(Type? serviceType, string? contract) => false; /// [SuppressMessage("Design", "SST1452:Unused type parameter", Justification = "Dictated by the interface this test stub implements.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool HasRegistration() => false; /// [SuppressMessage("Design", "SST1452:Unused type parameter", Justification = "Dictated by the interface this test stub implements.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool HasRegistration(string? contract) => false; /// @@ -231,21 +236,25 @@ public void UnregisterAll(string? contract) } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable ServiceRegistrationCallback(Type serviceType, Action callback) => Disposable.Empty; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable ServiceRegistrationCallback(Type serviceType, string? contract, Action callback) => Disposable.Empty; /// [SuppressMessage("Design", "SST1452:Unused type parameter", Justification = "Dictated by the interface this test stub implements.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable ServiceRegistrationCallback(Action callback) => Disposable.Empty; /// [SuppressMessage("Design", "SST1452:Unused type parameter", Justification = "Dictated by the interface this test stub implements.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable ServiceRegistrationCallback(string? contract, Action callback) => Disposable.Empty; diff --git a/src/tests/ReactiveUI.Binding.Tests/CommandBinding/CommandBinderServiceTests.cs b/src/tests/ReactiveUI.Binding.Tests/CommandBinding/CommandBinderServiceTests.cs index 4bcf0962..eea1f4c1 100644 --- a/src/tests/ReactiveUI.Binding.Tests/CommandBinding/CommandBinderServiceTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/CommandBinding/CommandBinderServiceTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Windows.Input; using ReactiveUI.Binding.Builder; using ReactiveUI.Binding.CommandBinding; @@ -89,16 +90,19 @@ private sealed class HighAffinityBinder : ICreatesCommandBinding /// [SuppressMessage("Design", "SST1452:Unused type parameter", Justification = "Dictated by the interface this test stub implements.")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObject(bool hasEventTarget) => HighAffinity; /// [RequiresUnreferencedCode("Test stub")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable? BindCommandToObject(ICommand? command, T? target, IObservable commandParameter) where T : class => null; /// [SuppressMessage("Design", "SST1452:Unused type parameter", Justification = "Dictated by the interface this test stub implements.")] [RequiresUnreferencedCode("Test stub")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable? BindCommandToObject( ICommand? command, T? target, @@ -107,6 +111,7 @@ private sealed class HighAffinityBinder : ICreatesCommandBinding where T : class => null; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable? BindCommandToObject( ICommand? command, T? target, diff --git a/src/tests/ReactiveUI.Binding.Tests/Expression/ExpressionMixinsTests.cs b/src/tests/ReactiveUI.Binding.Tests/Expression/ExpressionMixinsTests.cs index 8ead64b8..38980995 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Expression/ExpressionMixinsTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Expression/ExpressionMixinsTests.cs @@ -147,8 +147,7 @@ public async Task GetParent_NestedMemberExpression_ReturnsIntermediateExpression await Assert.That(parent).IsNotNull(); await Assert.That(parent!.NodeType).IsEqualTo(ExpressionType.MemberAccess); - var parentMember = (MemberExpression)parent; - await Assert.That(parentMember.Member.Name).IsEqualTo("Address"); + await Assert.That(((MemberExpression)parent).Member.Name).IsEqualTo("Address"); } /// Verifies that GetExpressionChain throws NotSupportedException for a ConstantExpression with a helpful message. diff --git a/src/tests/ReactiveUI.Binding.Tests/Expression/ExpressionRewriterTests.cs b/src/tests/ReactiveUI.Binding.Tests/Expression/ExpressionRewriterTests.cs index 1f14a5c9..20c5a3f5 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Expression/ExpressionRewriterTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Expression/ExpressionRewriterTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Expressions; namespace ReactiveUI.Binding.Tests.Expression; @@ -71,8 +72,7 @@ public async Task Rewrite_WithArrayLength_ReturnsMemberAccess() // ArrayLength should be rewritten to MemberAccess of Length property await Assert.That(result.NodeType).IsEqualTo(ExpressionType.MemberAccess); - var memberExpr = (MemberExpression)result; - await Assert.That(memberExpr.Member.Name).IsEqualTo(LengthPropertyName); + await Assert.That(((MemberExpression)result).Member.Name).IsEqualTo(LengthPropertyName); } /// Verifies that constant expressions pass through unchanged. @@ -185,6 +185,7 @@ public async Task Rewrite_WithNestedMemberAccess_ReturnsMemberExpression() /// Verifies that null expression throws. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Rewrite_WithNullExpression_Throws() => Assert.Throws(static () => Reflection.Rewrite(null)); @@ -247,8 +248,7 @@ public async Task Rewrite_WithConvertWrappingMemberAccess_UnwrapsToMemberAccess( var result = Reflection.Rewrite(convert); await Assert.That(result.NodeType).IsEqualTo(ExpressionType.MemberAccess); - var memberExpr = (MemberExpression)result; - await Assert.That(memberExpr.Member.Name).IsEqualTo(PropertyName); + await Assert.That(((MemberExpression)result).Member.Name).IsEqualTo(PropertyName); } /// Verifies that a static method call (non-special-name) throws NotSupportedException. @@ -306,10 +306,9 @@ public async Task Rewrite_ArrayIndexWithArrayType_ProducesArrayAccess() // After rewrite, it should be an IndexExpression with NodeType == Index await Assert.That(result.NodeType).IsEqualTo(ExpressionType.Index); - var indexExpr = (IndexExpression)result; // The object type should be int[] (array type) - await Assert.That(indexExpr.Object!.Type.IsArray).IsTrue(); + await Assert.That(((IndexExpression)result).Object!.Type.IsArray).IsTrue(); } /// @@ -510,8 +509,7 @@ public async Task Rewrite_DoubleConvert_UnwrapsCompletely() var result = Reflection.Rewrite(outerConvert); await Assert.That(result.NodeType).IsEqualTo(ExpressionType.MemberAccess); - var memberExpr = (MemberExpression)result; - await Assert.That(memberExpr.Member.Name).IsEqualTo(PropertyName); + await Assert.That(((MemberExpression)result).Member.Name).IsEqualTo(PropertyName); } /// @@ -621,6 +619,7 @@ private sealed class TestClass /// Gets the value of . Used to test non-special-name method call rewriting. /// The current value of the . + [MethodImpl(MethodImplOptions.AggressiveInlining)] public string? GetValue() => Property; } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Expression/ReflectionTests.cs b/src/tests/ReactiveUI.Binding.Tests/Expression/ReflectionTests.cs index c9729c5e..00bd2a18 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Expression/ReflectionTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Expression/ReflectionTests.cs @@ -245,8 +245,7 @@ public async Task Rewrite_ConvertExpression_StripsConvertAndReturnsMemberAccess( // After rewriting, the Convert should be stripped, leaving MemberAccess await Assert.That(rewritten.NodeType).IsEqualTo(ExpressionType.MemberAccess); - var member = (MemberExpression)rewritten; - await Assert.That(member.Member.Name).IsEqualTo("Age"); + await Assert.That(((MemberExpression)rewritten).Member.Name).IsEqualTo("Age"); } /// diff --git a/src/tests/ReactiveUI.Binding.Tests/Fallback/CommandBindingAffinityCheckerTests.cs b/src/tests/ReactiveUI.Binding.Tests/Fallback/CommandBindingAffinityCheckerTests.cs index 82a2b3c5..21c1d310 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Fallback/CommandBindingAffinityCheckerTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Fallback/CommandBindingAffinityCheckerTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using System.Windows.Input; using ReactiveUI.Binding.Fallback; @@ -175,6 +176,7 @@ public async Task HasHigherAffinityPlugin_MultiplePlugins_NoneHigher_ReturnsFals } /// Restores default plugins by re-initializing the binding infrastructure. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void RestoreDefaultPlugins() => RuntimeObservationFallbackTests.EnsureInitialized(); diff --git a/src/tests/ReactiveUI.Binding.Tests/Fallback/ObservationAffinityCheckerTests.cs b/src/tests/ReactiveUI.Binding.Tests/Fallback/ObservationAffinityCheckerTests.cs index 0bc9e28c..f1f38576 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Fallback/ObservationAffinityCheckerTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Fallback/ObservationAffinityCheckerTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Fallback; using Splat; @@ -184,6 +185,7 @@ public async Task HasHigherAffinityPlugin_MultiplePlugins_NoneHigher_ReturnsFals } /// Restores default plugins by re-initializing the binding infrastructure. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void RestoreDefaultPlugins() => RuntimeObservationFallbackTests.EnsureInitialized(); diff --git a/src/tests/ReactiveUI.Binding.Tests/ObservableForProperty/ChainLinkReaderTests.cs b/src/tests/ReactiveUI.Binding.Tests/ObservableForProperty/ChainLinkReaderTests.cs index 65355263..6f1765af 100644 --- a/src/tests/ReactiveUI.Binding.Tests/ObservableForProperty/ChainLinkReaderTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/ObservableForProperty/ChainLinkReaderTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.ObservableForProperty; using ReactiveUI.Binding.Tests.TestModels; using LinqExpression = System.Linq.Expressions.Expression; @@ -86,6 +87,7 @@ await Assert.That(() => ChainLinkReader.ReadValue(fixture, null, null, link)) /// Builds an array index link, whose expression carries no indexer. /// The link expression. + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static IndexExpression ArrayIndexLink() => LinqExpression.ArrayAccess(LinqExpression.Constant(IndexedValues), LinqExpression.Constant(0)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/ObservableForProperty/INPCObservableForPropertyTests.cs b/src/tests/ReactiveUI.Binding.Tests/ObservableForProperty/INPCObservableForPropertyTests.cs index f86da4c9..9ccf2fee 100644 --- a/src/tests/ReactiveUI.Binding.Tests/ObservableForProperty/INPCObservableForPropertyTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/ObservableForProperty/INPCObservableForPropertyTests.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Reflection; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Expressions; using ReactiveUI.Binding.ObservableForProperty; using ReactiveUI.Binding.Tests.TestModels; @@ -592,20 +593,24 @@ public string this[string key] } /// Raises PropertyChanged with null property name (all properties changed). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaiseAllPropertiesChanged() => PropertyChanged?.Invoke(this, new(null)); /// Raises PropertyChanged with a specific property name. /// The property name to raise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaisePropertyChangedWithName(string? propertyName) => PropertyChanged?.Invoke(this, new(propertyName)); /// Raises PropertyChanging with null property name (all properties changing). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaiseAllPropertyChanging() => PropertyChanging?.Invoke(this, new(null)); /// Raises PropertyChanging with a specific property name. /// The property name to raise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaisePropertyChangingWithName(string? propertyName) => PropertyChanging?.Invoke(this, new(propertyName)); } @@ -651,6 +656,7 @@ private sealed class NullPropertyNameViewModel : INotifyPropertyChanged public string Name { get; set; } = string.Empty; /// Raises PropertyChanged with null property name (all properties changed). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaiseAllPropertiesChanged() => PropertyChanged?.Invoke(this, new(null)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/ActionDisposableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/ActionDisposableTests.cs index d70d9724..96947389 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/ActionDisposableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/ActionDisposableTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -38,6 +39,7 @@ public async Task Dispose_CalledTwice_InvokesActionOnlyOnce() /// Verifies that constructor throws ArgumentNullException when action is null. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Constructor_NullAction_ThrowsArgumentNullException() => Assert.Throws(static () => _ = new ActionDisposable(null!)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest10ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest10ObservableTests.cs index 50628c97..be8b7d3d 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest10ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest10ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -1034,12 +1035,15 @@ public async Task CompletedInSource_DoesNotPropagateCompletion() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest11ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest11ObservableTests.cs index 3e57c0b2..9d3346e1 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest11ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest11ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -372,12 +373,15 @@ public async Task Subscribe_NullObserver_Throws() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest12ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest12ObservableTests.cs index d53818ac..f1a57073 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest12ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest12ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -414,12 +415,15 @@ public async Task Subscribe_NullObserver_Throws() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest13ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest13ObservableTests.cs index 51ad0203..b74a7507 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest13ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest13ObservableTests.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; - +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -459,12 +459,15 @@ public async Task Subscribe_NullObserver_Throws() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest14ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest14ObservableTests.cs index eb5163b5..d7bc3261 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest14ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest14ObservableTests.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; - +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -505,12 +505,15 @@ public async Task Subscribe_NullObserver_Throws() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest15ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest15ObservableTests.cs index 2aafc65f..cf65fb46 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest15ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest15ObservableTests.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; - +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -553,12 +553,15 @@ public async Task Subscribe_NullObserver_Throws() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest16ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest16ObservableTests.cs index 315f6a1c..47ff339d 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest16ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest16ObservableTests.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; - +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -603,12 +603,15 @@ public async Task Subscribe_NullObserver_Throws() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest2ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest2ObservableTests.cs index 09fa2584..a1477da8 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest2ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest2ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -284,12 +285,15 @@ public async Task CompletedInSource_DoesNotPropagateCompletion() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest3ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest3ObservableTests.cs index 5a82bb73..5d88f93a 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest3ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest3ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -359,12 +360,15 @@ public async Task CompletedInSource_DoesNotPropagateCompletion() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest4ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest4ObservableTests.cs index 3ec6ef65..53578d2b 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest4ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest4ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -440,12 +441,15 @@ public async Task CompletedInSource_DoesNotPropagateCompletion() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest5ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest5ObservableTests.cs index b2eba8bc..e98412b3 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest5ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest5ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -527,12 +528,15 @@ public async Task CompletedInSource_DoesNotPropagateCompletion() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest6ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest6ObservableTests.cs index 26adcb6f..5f659888 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest6ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest6ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -609,12 +610,15 @@ public async Task CompletedInSource_DoesNotPropagateCompletion() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest7ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest7ObservableTests.cs index 2a49c58a..b7b80f66 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest7ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest7ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -708,12 +709,15 @@ public async Task CompletedInSource_DoesNotPropagateCompletion() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest8ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest8ObservableTests.cs index 48574831..5294877e 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest8ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest8ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -835,12 +836,15 @@ public async Task CompletedInSource_DoesNotPropagateCompletion() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest9ObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest9ObservableTests.cs index e0952e0d..99b25726 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest9ObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/CombineLatest9ObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -917,12 +918,15 @@ public async Task CompletedInSource_DoesNotPropagateCompletion() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/DistinctUntilChangedObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/DistinctUntilChangedObservableTests.cs index 54e46352..d4eba9d1 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/DistinctUntilChangedObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/DistinctUntilChangedObservableTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -139,6 +140,7 @@ public async Task Subscribe_NullObserver_ThrowsArgumentNullException() private sealed class AnonymousObservable(Func, IDisposable> subscribe) : IObservable { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable Subscribe(IObserver observer) => subscribe(observer); } @@ -150,12 +152,15 @@ private sealed class AnonymousObservable(Func, IDisposable> subs private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/EmptyObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/EmptyObservableTests.cs index 7bb95004..f86dca48 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/EmptyObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/EmptyObservableTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -28,6 +29,7 @@ public async Task Subscribe_CompletesImmediately() /// Verifies that EmptyObservable throws ArgumentNullException for null observer. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Subscribe_NullObserver_ThrowsArgumentNullException() => Assert.Throws(static () => EmptyObservable.Instance.Subscribe(null!)); @@ -50,12 +52,15 @@ public async Task Instance_IsSingleton() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/EventObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/EventObservableTests.cs index 778756f9..bb5140a7 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/EventObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/EventObservableTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -255,12 +256,15 @@ public async Task Dispose_CalledTwice_IsSafe() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/MergeObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/MergeObservableTests.cs index 9c0163d1..6ee17f81 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/MergeObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/MergeObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -152,12 +153,15 @@ public async Task ErrorInSecondSource_AfterFirstEmitted_PropagatedToSubscriber() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/ObserveOnObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/ObserveOnObservableTests.cs index 84e1110c..4d72551d 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/ObserveOnObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/ObserveOnObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Primitives.Concurrency; @@ -106,11 +107,13 @@ public void Subscribe_NullObserver_ThrowsArgumentNullException() /// Verifies that the constructor rejects a null source. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Constructor_NullSource_ThrowsArgumentNullException() => Assert.Throws(static () => _ = new ObserveOnObservable(null!, ImmediateSequencer.Instance)); /// Verifies that the constructor rejects a null sequencer. [Test] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Constructor_NullSequencer_ThrowsArgumentNullException() => Assert.Throws(static () => _ = new ObserveOnObservable(new Subject(), null!)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyChangingObservableInitialEmitSerializationTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyChangingObservableInitialEmitSerializationTests.cs index e5ffd2e2..54857dd9 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyChangingObservableInitialEmitSerializationTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyChangingObservableInitialEmitSerializationTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -97,10 +98,12 @@ public async Task Subscribe_NoConcurrentNotification_EmitsTheInitialValueToEvery var second = new EmissionRecorder(); using (observable.Subscribe(first)) - using (observable.Subscribe(second)) { - await AssertSequence(first.Snapshot(), 0); - await AssertSequence(second.Snapshot(), 0); + using (observable.Subscribe(second)) + { + await AssertSequence(first.Snapshot(), 0); + await AssertSequence(second.Snapshot(), 0); + } } } @@ -137,20 +140,22 @@ private sealed class InitialEmitCompetitor : IDisposable /// The thread performing the competing writes. private readonly Thread _thread; - /// Whether the contention has been driven already, so later reads run plainly. - private bool _contended; + /// + /// The latch claiming the right to drive the contention: zero until a caller claims it, one + /// afterwards, so later reads run plainly. It is an interlocked integer rather than a boolean + /// because the read it guards is the very code a subscription that stopped serializing would let + /// two threads into at once, where a check-then-set would start the thread twice. + /// + private int _contended; /// Initializes a new instance of the class. /// Writes the observed property. - public InitialEmitCompetitor(Action write) + public InitialEmitCompetitor(Action write) => _thread = new(() => { - _thread = new(() => - { - _started.Set(); - write(1); - write(SecondWrite); - }) { IsBackground = true }; - } + _started.Set(); + write(1); + write(SecondWrite); + }) { IsBackground = true }; /// /// Builds a property read that, the first time it runs, releases the competing thread and holds @@ -162,12 +167,11 @@ public Func CreateContendedRead(Func read) => { var valueOnEntry = read(); - if (_contended) + if (Interlocked.Exchange(ref _contended, 1) != 0) { return valueOnEntry; } - _contended = true; _thread.Start(); _started.Wait(); _ = _thread.Join(InterleaveWindowMilliseconds); @@ -176,9 +180,11 @@ public Func CreateContendedRead(Func read) => }; /// Waits for the competing writes to finish. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void WaitForCompletion() => _thread.Join(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Dispose() => _started.Dispose(); } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyChangingObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyChangingObservableTests.cs index 62e04a12..5beb13a8 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyChangingObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyChangingObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -273,6 +274,7 @@ private sealed class ConcurrentChangingTestViewModel : INotifyPropertyChanging /// Raises the event for the specified property. /// The name of the property that is changing. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaisePropertyChanging(string? propertyName) => PropertyChanging?.Invoke(this, new(propertyName)); } @@ -288,6 +290,7 @@ private sealed class ManualTestViewModel : INotifyPropertyChanging /// Raises the event for the specified property. /// The name of the property that is changing. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaisePropertyChanging(string? propertyName) => PropertyChanging?.Invoke(this, new(propertyName)); } @@ -300,12 +303,15 @@ public void RaisePropertyChanging(string? propertyName) => private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyObservableInitialEmitSerializationTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyObservableInitialEmitSerializationTests.cs index eb187986..47f6f8fe 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyObservableInitialEmitSerializationTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyObservableInitialEmitSerializationTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -185,11 +186,13 @@ public async Task Subscribe_ValueIsTheTypeDefault_StillEmitsTheInitialValue(bool distinctUntilChanged); using (nameObservable.Subscribe(nameRecorder)) - using (countObservable.Subscribe(countRecorder)) { - await Assert.That(nameRecorder.Snapshot()).Count().IsEqualTo(1); - await Assert.That(nameRecorder.Snapshot()[0]).IsNull(); - await AssertSequence(countRecorder.Snapshot(), 0); + using (countObservable.Subscribe(countRecorder)) + { + await Assert.That(nameRecorder.Snapshot()).Count().IsEqualTo(1); + await Assert.That(nameRecorder.Snapshot()[0]).IsNull(); + await AssertSequence(countRecorder.Snapshot(), 0); + } } } @@ -217,10 +220,12 @@ public async Task Subscribe_ValueAlreadyDeliveredToAnotherSubscriber_StillEmitsT var afterDisposal = new EmissionRecorder(); using (observable.Subscribe(first)) - using (observable.Subscribe(second)) { - await AssertSequence(first.Snapshot(), InitialName); - await AssertSequence(second.Snapshot(), InitialName); + using (observable.Subscribe(second)) + { + await AssertSequence(first.Snapshot(), InitialName); + await AssertSequence(second.Snapshot(), InitialName); + } } using (observable.Subscribe(afterDisposal)) @@ -441,6 +446,7 @@ public int Count /// Raises without writing anything. /// The property to report. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaisePropertyChanged(string propertyName) => _handlers?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyObservableTests.cs index 42d65f17..74b8342f 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/PropertyObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using ReactiveUI.Binding.Tests.TestModels; @@ -305,6 +306,7 @@ private sealed class ConcurrentTestViewModel : INotifyPropertyChanged /// Raises the event for the specified property. /// The name of the property that changed. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaisePropertyChanged(string? propertyName) => PropertyChanged?.Invoke(this, new(propertyName)); } @@ -320,6 +322,7 @@ private sealed class ManualTestViewModel : INotifyPropertyChanged /// Raises the event for the specified property. /// The name of the property that changed. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaisePropertyChanged(string? propertyName) => PropertyChanged?.Invoke(this, new(propertyName)); } @@ -332,12 +335,15 @@ public void RaisePropertyChanged(string? propertyName) => private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/ReturnObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/ReturnObservableTests.cs index d8152de8..431d8e4e 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/ReturnObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/ReturnObservableTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -70,12 +71,15 @@ public async Task Subscribe_NullObserver_ThrowsArgumentNullException() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/RxBindingExtensionsTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/RxBindingExtensionsTests.cs index 92a38dfa..318f37cb 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/RxBindingExtensionsTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/RxBindingExtensionsTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; using RxBinding = ReactiveUI.Binding.Observables.RxBindingExtensions; @@ -165,6 +166,7 @@ public async Task Subscribe_NullOnNext_ThrowsArgumentNullException() private sealed class AnonymousObservable(Func, IDisposable> subscribe) : IObservable { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable Subscribe(IObserver observer) => subscribe(observer); } @@ -176,12 +178,15 @@ private sealed class AnonymousObservable(Func, IDisposable> subs private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/SelectObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/SelectObservableTests.cs index 8980ba14..9eb9a6cb 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/SelectObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/SelectObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -138,12 +139,15 @@ public async Task Selector_TransformsValues() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/SkipObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/SkipObservableTests.cs index b25ac2f0..77328444 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/SkipObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/SkipObservableTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -134,6 +135,7 @@ public async Task Subscribe_NullObserver_ThrowsArgumentNullException() private sealed class AnonymousObservable(Func, IDisposable> subscribe) : IObservable { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public IDisposable Subscribe(IObserver observer) => subscribe(observer); } @@ -145,12 +147,15 @@ private sealed class AnonymousObservable(Func, IDisposable> subs private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/Observables/SwitchObservableTests.cs b/src/tests/ReactiveUI.Binding.Tests/Observables/SwitchObservableTests.cs index b6ea2a3b..441c4db3 100644 --- a/src/tests/ReactiveUI.Binding.Tests/Observables/SwitchObservableTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/Observables/SwitchObservableTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive.Subjects; +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Observables; namespace ReactiveUI.Binding.Tests.Observables; @@ -364,12 +365,15 @@ public async Task OnNext_AfterDispose_ViaManualObservable_IsIgnored() private sealed class AnonymousObserver(Action onNext, Action onError, Action onCompleted) : IObserver { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnCompleted() => onCompleted(); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnError(Exception error) => onError(error); /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(T value) => onNext(value); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/HostTestFixture.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/HostTestFixture.cs index 644c8cd7..db253d68 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/HostTestFixture.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/HostTestFixture.cs @@ -72,11 +72,13 @@ public NonObservableTestFixture? PocoChild /// Raises the PropertyChanging event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanging([CallerMemberName] string? propertyName = null) => PropertyChanging?.Invoke(this, new(propertyName)); /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/LateRegistrationFixture.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/LateRegistrationFixture.cs index 58231f86..b5936979 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/LateRegistrationFixture.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/LateRegistrationFixture.cs @@ -56,6 +56,7 @@ public string Title /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/NonReactiveINotifyPropertyChangedObject.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/NonReactiveINotifyPropertyChangedObject.cs index dab2190f..c766d922 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/NonReactiveINotifyPropertyChangedObject.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/NonReactiveINotifyPropertyChangedObject.cs @@ -34,6 +34,7 @@ public string InpcProperty /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain1.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain1.cs index b27648b5..42ba8545 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain1.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain1.cs @@ -31,6 +31,7 @@ public ObjChain2? Chain2 /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain2.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain2.cs index fedafb23..365fcb60 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain2.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain2.cs @@ -31,6 +31,7 @@ public ObjChain3? Chain3 /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain3.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain3.cs index c8297ed8..cd854270 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain3.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/ObjChain3.cs @@ -31,6 +31,7 @@ public HostTestFixture? Host /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/ObservedValueFixture.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/ObservedValueFixture.cs index 263383f3..4de30309 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/ObservedValueFixture.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/ObservedValueFixture.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Runtime.CompilerServices; namespace ReactiveUI.Binding.Tests.TestModels; @@ -35,5 +36,6 @@ public string Value = string.Empty; /// Raises a change notification for without altering it. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RaiseValueChanged() => PropertyChanged?.Invoke(this, new(nameof(Value))); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/OwnerClass.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/OwnerClass.cs index 58b2eaee..6ea1a443 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/OwnerClass.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/OwnerClass.cs @@ -31,6 +31,7 @@ public string Name /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/StubBindingTypeConverter.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/StubBindingTypeConverter.cs index 1b8d4eb3..ea87db8b 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/StubBindingTypeConverter.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/StubBindingTypeConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.Tests.TestModels; /// A stub implementation of for testing. @@ -11,7 +13,7 @@ public class StubBindingTypeConverter : IBindingTypeConverter private const int StubAffinity = 10; /// The conversion logic. - private readonly Func _tryConvert; + private readonly Func _tryConvert; /// Initializes a new instance of the class. /// The source type. @@ -20,7 +22,7 @@ public class StubBindingTypeConverter : IBindingTypeConverter public StubBindingTypeConverter( Type fromType, Type toType, - Func tryConvert) + Func tryConvert) { FromType = fromType; ToType = toType; @@ -34,6 +36,7 @@ public StubBindingTypeConverter( public Type ToType { get; } /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects() => StubAffinity; /// diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/StubFallbackConverter.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/StubFallbackConverter.cs index 49353e24..45999d25 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/StubFallbackConverter.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/StubFallbackConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.Tests.TestModels; /// A stub implementation of for testing. @@ -11,14 +13,15 @@ public class StubFallbackConverter : IBindingFallbackConverter private const int StubAffinity = 5; /// The conversion logic. - private readonly Func _tryConvert; + private readonly Func _tryConvert; /// Initializes a new instance of the class. /// The conversion logic. - public StubFallbackConverter(Func tryConvert) => + public StubFallbackConverter(Func tryConvert) => _tryConvert = tryConvert; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects(Type fromType, Type toType) => StubAffinity; /// diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/StubSetMethodBindingConverter.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/StubSetMethodBindingConverter.cs index 21d37efc..b3588a26 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/StubSetMethodBindingConverter.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/StubSetMethodBindingConverter.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace ReactiveUI.Binding.Tests.TestModels; /// A stub implementation of for testing. @@ -24,8 +26,10 @@ public StubSetMethodBindingConverter() public StubSetMethodBindingConverter(int affinity) => _affinity = affinity; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetAffinityForObjects(Type? fromType, Type? toType) => _affinity; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public object? PerformSet(object? toTarget, object? newValue, object?[]? arguments) => newValue; } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/TestFixture.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/TestFixture.cs index 3d8697d2..632f5f35 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/TestFixture.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/TestFixture.cs @@ -106,11 +106,13 @@ public string UsesExprRaiseSet /// Raises the PropertyChanging event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanging([CallerMemberName] string? propertyName = null) => PropertyChanging?.Invoke(this, new(propertyName)); /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/TestViewModel.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/TestViewModel.cs index 07d18c57..41d33c7f 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/TestViewModel.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/TestViewModel.cs @@ -69,11 +69,13 @@ public TestAddress? Address /// Raises the PropertyChanging event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanging([CallerMemberName] string? propertyName = null) => PropertyChanging?.Invoke(this, new(propertyName)); /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/TestWhenAnyObsViewModel.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/TestWhenAnyObsViewModel.cs index 3916051f..2946ad44 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/TestWhenAnyObsViewModel.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/TestWhenAnyObsViewModel.cs @@ -79,6 +79,7 @@ public IObservable? Changes /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/TestModels/WhenAnyTestFixture.cs b/src/tests/ReactiveUI.Binding.Tests/TestModels/WhenAnyTestFixture.cs index 7dff382e..7dd00894 100644 --- a/src/tests/ReactiveUI.Binding.Tests/TestModels/WhenAnyTestFixture.cs +++ b/src/tests/ReactiveUI.Binding.Tests/TestModels/WhenAnyTestFixture.cs @@ -207,6 +207,7 @@ public string Value12 /// Raises the PropertyChanged event. /// The property name. + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new(propertyName)); } diff --git a/src/tests/ReactiveUI.Binding.Tests/View/ViewLocatorTests.cs b/src/tests/ReactiveUI.Binding.Tests/View/ViewLocatorTests.cs index 2282f060..f4f8f7cb 100644 --- a/src/tests/ReactiveUI.Binding.Tests/View/ViewLocatorTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/View/ViewLocatorTests.cs @@ -33,8 +33,6 @@ public async Task GetCurrent_NotRegistered_ThrowsViewLocatorNotFoundException() // Reset without rebuilding to ensure no IViewLocator is registered RxBindingBuilder.ResetForTesting(); - var action = ViewLocator.GetCurrent; - - await Assert.That(action).ThrowsException(); + await Assert.That(ViewLocator.GetCurrent).ThrowsException(); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/WhenAny/ExpressionChainNotificationTests.cs b/src/tests/ReactiveUI.Binding.Tests/WhenAny/ExpressionChainNotificationTests.cs index a3bf92b1..f65ec719 100644 --- a/src/tests/ReactiveUI.Binding.Tests/WhenAny/ExpressionChainNotificationTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/WhenAny/ExpressionChainNotificationTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Builder; using ReactiveUI.Binding.ObservableForProperty; using ReactiveUI.Binding.Tests.TestModels; @@ -127,6 +128,7 @@ private sealed class ChainRecorder : IObserver + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(IObservedChange value) => Values.Add(value); /// @@ -156,6 +158,7 @@ public int GetAffinityForObject(Type type, string propertyName, bool beforeChang type == typeof(ObservedValueFixture) ? WinningAffinity : 0; /// Forgets the previous test's subscribers so each starts from an empty stream. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Reset() => _observers.Clear(); /// @@ -239,6 +242,7 @@ private sealed record ChainContext( IDisposable Subscription) : IDisposable { /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Dispose() => Subscription.Dispose(); } } diff --git a/src/tests/ReactiveUI.Binding.Tests/WhenAny/ExpressionChainTests.cs b/src/tests/ReactiveUI.Binding.Tests/WhenAny/ExpressionChainTests.cs index 34ea05f2..c60ce724 100644 --- a/src/tests/ReactiveUI.Binding.Tests/WhenAny/ExpressionChainTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/WhenAny/ExpressionChainTests.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding.Builder; using ReactiveUI.Binding.ObservableForProperty; using ReactiveUI.Binding.Tests.TestModels; @@ -233,6 +234,7 @@ private sealed class Recorder : IObserver + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(IObservedChange value) => Values.Add(value); /// diff --git a/src/tests/ReactiveUI.Binding.Tests/WhenAny/WhenAnyValueMultiPropertyTests.cs b/src/tests/ReactiveUI.Binding.Tests/WhenAny/WhenAnyValueMultiPropertyTests.cs index 5520be4a..d5ded3ab 100644 --- a/src/tests/ReactiveUI.Binding.Tests/WhenAny/WhenAnyValueMultiPropertyTests.cs +++ b/src/tests/ReactiveUI.Binding.Tests/WhenAny/WhenAnyValueMultiPropertyTests.cs @@ -44,14 +44,14 @@ public async Task WhenAnyValue_2Properties() EnsureInitialized(); var fixture = new WhenAnyTestFixture { Value1 = "A", Value2 = "B" }; - var values = new List<(string property1, string property2)>(); + var values = new List<(string Property1, string Property2)>(); using var sub = fixture.WhenAnyValue(x => x.Value1, x => x.Value2) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("A"); - await Assert.That(values[0].property2).IsEqualTo("B"); + await Assert.That(values[0].Property1).IsEqualTo("A"); + await Assert.That(values[0].Property2).IsEqualTo("B"); } /// Verifies that WhenAnyValue with 3 properties emits tuples. @@ -62,15 +62,15 @@ public async Task WhenAnyValue_3Properties() EnsureInitialized(); var fixture = new WhenAnyTestFixture { Value1 = "A", Value2 = "B", Value3 = "C" }; - var values = new List<(string property1, string property2, string property3)>(); + var values = new List<(string Property1, string Property2, string Property3)>(); using var sub = fixture.WhenAnyValue(x => x.Value1, x => x.Value2, x => x.Value3) .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("A"); - await Assert.That(values[0].property2).IsEqualTo("B"); - await Assert.That(values[0].property3).IsEqualTo("C"); + await Assert.That(values[0].Property1).IsEqualTo("A"); + await Assert.That(values[0].Property2).IsEqualTo("B"); + await Assert.That(values[0].Property3).IsEqualTo("C"); } /// Verifies that WhenAnyValue with 4 properties emits tuples. @@ -81,7 +81,7 @@ public async Task WhenAnyValue_4Properties() EnsureInitialized(); var fixture = new WhenAnyTestFixture { Value1 = "A", Value2 = "B", Value3 = "C", Value4 = "D" }; - var values = new List<(string property1, string property2, string property3, string property4)>(); + var values = new List<(string Property1, string Property2, string Property3, string Property4)>(); using var sub = fixture.WhenAnyValue( x => x.Value1, @@ -91,8 +91,8 @@ public async Task WhenAnyValue_4Properties() .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("A"); - await Assert.That(values[0].property4).IsEqualTo("D"); + await Assert.That(values[0].Property1).IsEqualTo("A"); + await Assert.That(values[0].Property4).IsEqualTo("D"); } /// Verifies that WhenAnyValue with 5 properties emits tuples. @@ -104,7 +104,7 @@ public async Task WhenAnyValue_5Properties() var fixture = new WhenAnyTestFixture { Value1 = "A", Value2 = "B", Value3 = "C", Value4 = "D", Value5 = "E" }; var values = - new List<(string property1, string property2, string property3, string property4, string property5)>(); + new List<(string Property1, string Property2, string Property3, string Property4, string Property5)>(); using var sub = fixture.WhenAnyValue( x => x.Value1, @@ -115,8 +115,8 @@ public async Task WhenAnyValue_5Properties() .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("A"); - await Assert.That(values[0].property5).IsEqualTo("E"); + await Assert.That(values[0].Property1).IsEqualTo("A"); + await Assert.That(values[0].Property5).IsEqualTo("E"); } /// Verifies that WhenAnyValue with 6 properties emits tuples. @@ -128,8 +128,8 @@ public async Task WhenAnyValue_6Properties() var fixture = new WhenAnyTestFixture { Value1 = "A", Value2 = "B", Value3 = "C", Value4 = "D", Value5 = "E", Value6 = "F" }; var values = - new List<(string property1, string property2, string property3, string property4, string property5, string - property6)>(); + new List<(string Property1, string Property2, string Property3, string Property4, string Property5, string + Property6)>(); using var sub = fixture.WhenAnyValue( x => x.Value1, @@ -141,8 +141,8 @@ public async Task WhenAnyValue_6Properties() .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property1).IsEqualTo("A"); - await Assert.That(values[0].property6).IsEqualTo("F"); + await Assert.That(values[0].Property1).IsEqualTo("A"); + await Assert.That(values[0].Property6).IsEqualTo("F"); } /// Verifies that WhenAnyValue with 7 properties emits tuples. @@ -154,8 +154,8 @@ public async Task WhenAnyValue_7Properties() var fixture = new WhenAnyTestFixture { Value1 = "A", Value2 = "B", Value3 = "C", Value4 = "D", Value5 = "E", Value6 = "F", Value7 = "G" }; var values = - new List<(string property1, string property2, string property3, string property4, string property5, string - property6, string property7)>(); + new List<(string Property1, string Property2, string Property3, string Property4, string Property5, string + Property6, string Property7)>(); using var sub = fixture.WhenAnyValue( x => x.Value1, @@ -168,7 +168,7 @@ public async Task WhenAnyValue_7Properties() .Subscribe(values.Add); await Assert.That(values.Count).IsGreaterThanOrEqualTo(1); - await Assert.That(values[0].property7).IsEqualTo("G"); + await Assert.That(values[0].Property7).IsEqualTo("G"); } /// Verifies that WhenAnyValue with 8 properties emits tuples. @@ -191,7 +191,7 @@ public async Task WhenAnyValue_8Properties() x => x.Value6, x => x.Value7, x => x.Value8) - .Subscribe(v => lastItem8 = v.property8); + .Subscribe(v => lastItem8 = v.Property8); await Assert.That(lastItem8).IsEqualTo("H"); } @@ -217,7 +217,7 @@ public async Task WhenAnyValue_9Properties() x => x.Value7, x => x.Value8, x => x.Value9) - .Subscribe(v => lastItem9 = v.property9); + .Subscribe(v => lastItem9 = v.Property9); await Assert.That(lastItem9).IsEqualTo("I"); } @@ -244,7 +244,7 @@ public async Task WhenAnyValue_10Properties() x => x.Value8, x => x.Value9, x => x.Value10) - .Subscribe(v => lastItem10 = v.property10); + .Subscribe(v => lastItem10 = v.Property10); await Assert.That(lastItem10).IsEqualTo("J"); } @@ -268,7 +268,7 @@ public async Task WhenAnyValue_11Properties() Value8 = "H", Value9 = "I", Value10 = "J", - Value11 = "K" + Value11 = "K", }; string? lastItem11 = null; @@ -285,7 +285,7 @@ public async Task WhenAnyValue_11Properties() x => x.Value9, x => x.Value10, x => x.Value11) - .Subscribe(v => lastItem11 = v.property11); + .Subscribe(v => lastItem11 = v.Property11); await Assert.That(lastItem11).IsEqualTo("K"); } @@ -310,7 +310,7 @@ public async Task WhenAnyValue_12Properties() Value9 = "I", Value10 = "J", Value11 = "K", - Value12 = "L" + Value12 = "L", }; string? lastItem12 = null; @@ -328,7 +328,7 @@ public async Task WhenAnyValue_12Properties() x => x.Value10, x => x.Value11, x => x.Value12) - .Subscribe(v => lastItem12 = v.property12); + .Subscribe(v => lastItem12 = v.Property12); await Assert.That(lastItem12).IsEqualTo("L"); } diff --git a/src/tests/ReactiveUI.Binding.WinForms.Tests/WinFormsCreatesObservableForPropertyTests.cs b/src/tests/ReactiveUI.Binding.WinForms.Tests/WinFormsCreatesObservableForPropertyTests.cs index 11ebb2c5..ab830bee 100644 --- a/src/tests/ReactiveUI.Binding.WinForms.Tests/WinFormsCreatesObservableForPropertyTests.cs +++ b/src/tests/ReactiveUI.Binding.WinForms.Tests/WinFormsCreatesObservableForPropertyTests.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Linq.Expressions; +using System.Runtime.CompilerServices; namespace ReactiveUI.Binding.WinForms.Tests; @@ -170,6 +171,7 @@ public void OnCompleted() public void OnError(Exception error) => throw error; /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void OnNext(IObservedChange value) => onNext(); } } diff --git a/src/tests/ReactiveUI.Binding.Wpf.Tests/DependencyObjectObservableForPropertyTests.cs b/src/tests/ReactiveUI.Binding.Wpf.Tests/DependencyObjectObservableForPropertyTests.cs new file mode 100644 index 00000000..a927360f --- /dev/null +++ b/src/tests/ReactiveUI.Binding.Wpf.Tests/DependencyObjectObservableForPropertyTests.cs @@ -0,0 +1,169 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Runtime.CompilerServices; +using System.Windows; + +namespace ReactiveUI.Binding.Wpf.Tests; + +/// +/// Tests for the WPF observation factory that watches a . Every +/// dependency object here is created and mutated before the first await, because a dependency object +/// has thread affinity and an await may resume the test on another thread. +/// +/// +/// Serialized: these share one static , and the value-changed +/// subscription that DependencyPropertyDescriptor.AddValueChanged installs lives in a +/// process-wide table keyed by that property. Run in parallel they race on it, which shows up as an +/// occasional failure rather than a consistent one. +/// +[NotInParallel] +public class DependencyObjectObservableForPropertyTests +{ + /// The value written to trigger the first change notification. + private const string FirstValue = "first"; + + /// The value written after the subscription has been disposed. + private const string SecondValue = "second"; + + /// Verifies that a dependency-property-backed property scores the WPF affinity. + /// A task representing the asynchronous test operation. + [Test] + public async Task GetAffinityForObject_DependencyProperty_ScoresAsWpfDependencyObject() => + await Assert.That(new DependencyObjectObservableForProperty() + .GetAffinityForObject(typeof(Fixture), nameof(Fixture.Value), false)) + .IsEqualTo(BindingAffinity.WpfDependencyObject); + + /// Verifies that a type which is not a dependency object does not match at all. + /// A task representing the asynchronous test operation. + [Test] + public async Task GetAffinityForObject_NonDependencyObject_ScoresZero() => + await Assert.That(new DependencyObjectObservableForProperty() + .GetAffinityForObject(typeof(string), nameof(string.Length), false)) + .IsEqualTo(0); + + /// Verifies that a dependency object without a matching dependency property does not match. + /// A task representing the asynchronous test operation. + [Test] + public async Task GetAffinityForObject_PropertyWithoutDependencyProperty_ScoresZero() => + await Assert.That(new DependencyObjectObservableForProperty() + .GetAffinityForObject(typeof(Fixture), nameof(Fixture.Plain), false)) + .IsEqualTo(0); + + /// Verifies that changing the dependency property notifies the subscriber. + /// A task representing the asynchronous test operation. + [Test] + public async Task GetNotificationForProperty_EmitsWhenTheDependencyPropertyChanges() + { + var target = new Fixture(); + var recorder = new Recorder(); + + using (new DependencyObjectObservableForProperty() + .GetNotificationForProperty(target, ValueExpression(), nameof(Fixture.Value), false, false) + .Subscribe(recorder)) + { + target.Value = FirstValue; + } + + await Assert.That(recorder.Count).IsEqualTo(1); + await Assert.That(recorder.Last!.Sender).IsSameReferenceAs(target); + } + + /// + /// Verifies that disposing the subscription unhooks the value-changed handler. This is the teardown + /// the observation hands back, and without it the descriptor keeps the target alive and emitting. + /// + /// A task representing the asynchronous test operation. + [Test] + public async Task GetNotificationForProperty_StopsEmittingOnceDisposed() + { + var target = new Fixture(); + var recorder = new Recorder(); + + var subscription = new DependencyObjectObservableForProperty() + .GetNotificationForProperty(target, ValueExpression(), nameof(Fixture.Value), false, false) + .Subscribe(recorder); + + target.Value = FirstValue; + subscription.Dispose(); + target.Value = SecondValue; + + await Assert.That(recorder.Count).IsEqualTo(1); + } + + /// Verifies that observing a property with no dependency property behind it is rejected. + /// A task representing the asynchronous test operation. + [Test] + public async Task GetNotificationForProperty_PropertyWithoutDependencyProperty_Throws() + { + var target = new Fixture(); + + await Assert.That(() => new DependencyObjectObservableForProperty() + .GetNotificationForProperty(target, ValueExpression(), nameof(Fixture.Plain), false, false)) + .Throws(); + } + + /// Verifies that a null sender is rejected. + /// A task representing the asynchronous test operation. + [Test] + public async Task GetNotificationForProperty_NullSender_Throws() => + await Assert.That(static () => new DependencyObjectObservableForProperty() + .GetNotificationForProperty(null!, ValueExpression(), nameof(Fixture.Value), false, false)) + .Throws(); + + /// Builds the member expression the observation carries on its observed changes. + /// The body of an expression selecting . + /// Fully qualified: System.Windows declares an Expression of its own. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static System.Linq.Expressions.Expression ValueExpression() => + ((System.Linq.Expressions.Expression>)(x => x.Value)).Body; + + /// A minimal dependency object, so the tests do not need a visual tree or an STA thread. + private sealed class Fixture : DependencyObject + { + /// Identifies the dependency property. + public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( + nameof(Value), + typeof(string), + typeof(Fixture), + new(default(string))); + + /// Gets or sets the observed dependency property. + public string? Value + { + get => (string?)GetValue(ValueProperty); + set => SetValue(ValueProperty, value); + } + + /// Gets a plain property with no dependency property behind it. + public string Plain => nameof(Plain); + } + + /// Records the observed changes a subscription delivers. + private sealed class Recorder : IObserver> + { + /// Gets the number of changes observed. + public int Count { get; private set; } + + /// Gets the most recently observed change. + public IObservedChange? Last { get; private set; } + + /// + public void OnNext(IObservedChange value) + { + Count++; + Last = value; + } + + /// + public void OnError(Exception error) + { + } + + /// + public void OnCompleted() + { + } + } +} diff --git a/src/tests/SharedScenarios/Bind/MultipleBindings/Scenario.cs b/src/tests/SharedScenarios/Bind/MultipleBindings/Scenario.cs index f6f4d819..fb6e938d 100644 --- a/src/tests/SharedScenarios/Bind/MultipleBindings/Scenario.cs +++ b/src/tests/SharedScenarios/Bind/MultipleBindings/Scenario.cs @@ -13,8 +13,8 @@ public static class Scenario /// The target view. /// The source view model. /// A tuple of bindings. - public static (IReactiveBinding name, - IReactiveBinding age) Execute(MyView view, MyViewModel vm) => + public static (IReactiveBinding Name, + IReactiveBinding Age) Execute(MyView view, MyViewModel vm) => (view.Bind(vm, x => x.Name, x => x.NameText), view.Bind(vm, x => x.Age, x => x.AgeText)); } diff --git a/src/tests/SharedScenarios/Bind/SinglePropertyStringToString/Scenario.cs b/src/tests/SharedScenarios/Bind/SinglePropertyStringToString/Scenario.cs index bd3740ef..7a1afe2f 100644 --- a/src/tests/SharedScenarios/Bind/SinglePropertyStringToString/Scenario.cs +++ b/src/tests/SharedScenarios/Bind/SinglePropertyStringToString/Scenario.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.Bind.SinglePropertyStringToString; @@ -13,6 +14,7 @@ public static class Scenario /// The target view. /// The source view model. /// A reactive binding representing the binding. - public static IReactiveBinding Execute(MyView view, MyViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IReactiveBinding Execute(MyView view, MyViewModel vm) => view.Bind(vm, x => x.Name, x => x.NameText); } diff --git a/src/tests/SharedScenarios/Bind/SinglePropertyWithConverters/Scenario.cs b/src/tests/SharedScenarios/Bind/SinglePropertyWithConverters/Scenario.cs index ac169914..00f7a260 100644 --- a/src/tests/SharedScenarios/Bind/SinglePropertyWithConverters/Scenario.cs +++ b/src/tests/SharedScenarios/Bind/SinglePropertyWithConverters/Scenario.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.Bind.SinglePropertyWithConverters; @@ -13,6 +14,7 @@ public static class Scenario /// The target view. /// The source view model. /// A reactive binding representing the binding. - public static IReactiveBinding Execute(MyView view, MyViewModel vm) => + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IReactiveBinding Execute(MyView view, MyViewModel vm) => view.Bind(vm, x => x.Count, x => x.CountText, count => count.ToString(), int.Parse); } diff --git a/src/tests/SharedScenarios/Bind/SinglePropertyWithConvertersAndScheduler/Scenario.cs b/src/tests/SharedScenarios/Bind/SinglePropertyWithConvertersAndScheduler/Scenario.cs index 4777a525..ebc48e9c 100644 --- a/src/tests/SharedScenarios/Bind/SinglePropertyWithConvertersAndScheduler/Scenario.cs +++ b/src/tests/SharedScenarios/Bind/SinglePropertyWithConvertersAndScheduler/Scenario.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding; using ReactiveUI.Primitives.Concurrency; @@ -15,7 +16,8 @@ public static class Scenario /// The source view model. /// The scheduler to observe on. /// A reactive binding representing the binding. - public static IReactiveBinding Execute( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IReactiveBinding Execute( MyView view, MyViewModel vm, ISequencer scheduler) => view.Bind(vm, x => x.Count, x => x.CountText, count => count.ToString(), int.Parse, scheduler); diff --git a/src/tests/SharedScenarios/Bind/TwoSameTypeBindings/Scenario.cs b/src/tests/SharedScenarios/Bind/TwoSameTypeBindings/Scenario.cs index 5bec42c5..6ace688b 100644 --- a/src/tests/SharedScenarios/Bind/TwoSameTypeBindings/Scenario.cs +++ b/src/tests/SharedScenarios/Bind/TwoSameTypeBindings/Scenario.cs @@ -19,8 +19,8 @@ public static class Scenario /// The target view. /// The source view model. /// A tuple of bindings. - public static (IReactiveBinding first, - IReactiveBinding last) Execute(MyView view, MyViewModel vm) => + public static (IReactiveBinding First, + IReactiveBinding Last) Execute(MyView view, MyViewModel vm) => (view.Bind(vm, x => x.FirstName, x => x.FirstNameText), view.Bind(vm, x => x.LastName, x => x.LastNameText)); } diff --git a/src/tests/SharedScenarios/BindCommand/BasicNoParam/MyButton.cs b/src/tests/SharedScenarios/BindCommand/BasicNoParam/MyButton.cs index aec31e7e..2e61bbfc 100644 --- a/src/tests/SharedScenarios/BindCommand/BasicNoParam/MyButton.cs +++ b/src/tests/SharedScenarios/BindCommand/BasicNoParam/MyButton.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace SharedScenarios.BindCommand.BasicNoParam; @@ -13,5 +14,6 @@ public class MyButton public event EventHandler? Click; /// Simulates a button click. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PerformClick() => Click?.Invoke(this, EventArgs.Empty); } diff --git a/src/tests/SharedScenarios/BindCommand/BasicNoParam/Scenario.cs b/src/tests/SharedScenarios/BindCommand/BasicNoParam/Scenario.cs index 4bac6d87..d9e69b23 100644 --- a/src/tests/SharedScenarios/BindCommand/BasicNoParam/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/BasicNoParam/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.BasicNoParam; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindCommand(vm, x => x.Save, x => x.SaveButton); } diff --git a/src/tests/SharedScenarios/BindCommand/CommandProperty/Scenario.cs b/src/tests/SharedScenarios/BindCommand/CommandProperty/Scenario.cs index 214da44c..afad5821 100644 --- a/src/tests/SharedScenarios/BindCommand/CommandProperty/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/CommandProperty/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.CommandProperty; @@ -17,6 +18,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindCommand(vm, x => x.Save, x => x.SaveButton); } diff --git a/src/tests/SharedScenarios/BindCommand/CommandPropertyExprParam/Scenario.cs b/src/tests/SharedScenarios/BindCommand/CommandPropertyExprParam/Scenario.cs index 0c75d031..c7354d30 100644 --- a/src/tests/SharedScenarios/BindCommand/CommandPropertyExprParam/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/CommandPropertyExprParam/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.CommandPropertyExprParam; @@ -17,6 +18,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindCommand(vm, x => x.Save, x => x.SaveButton, x => x.CurrentItem); } diff --git a/src/tests/SharedScenarios/BindCommand/CommandPropertyObsParam/Scenario.cs b/src/tests/SharedScenarios/BindCommand/CommandPropertyObsParam/Scenario.cs index 4ded05b0..c5ed75f9 100644 --- a/src/tests/SharedScenarios/BindCommand/CommandPropertyObsParam/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/CommandPropertyObsParam/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.CommandPropertyObsParam; @@ -18,6 +19,7 @@ public static class Scenario /// The target view. /// An observable producing command parameters. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view, IObservable parameter) => view.BindCommand(vm, x => x.Save, x => x.SaveButton, parameter); } diff --git a/src/tests/SharedScenarios/BindCommand/CustomEvent/MyButton.cs b/src/tests/SharedScenarios/BindCommand/CustomEvent/MyButton.cs index a3d1a3f8..375a443b 100644 --- a/src/tests/SharedScenarios/BindCommand/CustomEvent/MyButton.cs +++ b/src/tests/SharedScenarios/BindCommand/CustomEvent/MyButton.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace SharedScenarios.BindCommand.CustomEvent; @@ -13,5 +14,6 @@ public class MyButton public event EventHandler? MouseUp; /// Simulates a mouse up event. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PerformMouseUp() => MouseUp?.Invoke(this, EventArgs.Empty); } diff --git a/src/tests/SharedScenarios/BindCommand/CustomEvent/Scenario.cs b/src/tests/SharedScenarios/BindCommand/CustomEvent/Scenario.cs index 4aaee5ec..1b03fc0a 100644 --- a/src/tests/SharedScenarios/BindCommand/CustomEvent/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/CustomEvent/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.CustomEvent; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindCommand(vm, x => x.Save, x => x.SaveButton, "MouseUp"); } diff --git a/src/tests/SharedScenarios/BindCommand/DeepCommandPath/MyButton.cs b/src/tests/SharedScenarios/BindCommand/DeepCommandPath/MyButton.cs index 9349a039..b38bebed 100644 --- a/src/tests/SharedScenarios/BindCommand/DeepCommandPath/MyButton.cs +++ b/src/tests/SharedScenarios/BindCommand/DeepCommandPath/MyButton.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace SharedScenarios.BindCommand.DeepCommandPath; @@ -13,5 +14,6 @@ public class MyButton public event EventHandler? Click; /// Simulates a button click. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PerformClick() => Click?.Invoke(this, EventArgs.Empty); } diff --git a/src/tests/SharedScenarios/BindCommand/DeepCommandPath/Scenario.cs b/src/tests/SharedScenarios/BindCommand/DeepCommandPath/Scenario.cs index 3dc00e9b..77c18c33 100644 --- a/src/tests/SharedScenarios/BindCommand/DeepCommandPath/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/DeepCommandPath/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.DeepCommandPath; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindCommand(vm, x => x.Child!.SaveCommand, x => x.SaveButton); } diff --git a/src/tests/SharedScenarios/BindCommand/EventEnabled/Scenario.cs b/src/tests/SharedScenarios/BindCommand/EventEnabled/Scenario.cs index 8675527a..dfa2505c 100644 --- a/src/tests/SharedScenarios/BindCommand/EventEnabled/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/EventEnabled/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.EventEnabled; @@ -17,6 +18,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindCommand(vm, x => x.Save, x => x.SaveButton); } diff --git a/src/tests/SharedScenarios/BindCommand/EventEnabled/WinFormsLikeButton.cs b/src/tests/SharedScenarios/BindCommand/EventEnabled/WinFormsLikeButton.cs index 8abdbf4e..8a9acdc1 100644 --- a/src/tests/SharedScenarios/BindCommand/EventEnabled/WinFormsLikeButton.cs +++ b/src/tests/SharedScenarios/BindCommand/EventEnabled/WinFormsLikeButton.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace SharedScenarios.BindCommand.EventEnabled; @@ -16,5 +17,6 @@ public class WinFormsLikeButton public bool Enabled { get; set; } /// Simulates a button click. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PerformClick() => Click?.Invoke(this, EventArgs.Empty); } diff --git a/src/tests/SharedScenarios/BindCommand/EventEnabledExprParam/Scenario.cs b/src/tests/SharedScenarios/BindCommand/EventEnabledExprParam/Scenario.cs index 0238a1f8..7b3f6e79 100644 --- a/src/tests/SharedScenarios/BindCommand/EventEnabledExprParam/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/EventEnabledExprParam/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.EventEnabledExprParam; @@ -17,6 +18,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindCommand(vm, x => x.Save, x => x.SaveButton, x => x.CurrentItem); } diff --git a/src/tests/SharedScenarios/BindCommand/EventEnabledExprParam/WinFormsLikeButton.cs b/src/tests/SharedScenarios/BindCommand/EventEnabledExprParam/WinFormsLikeButton.cs index 9dfa1ac4..270149be 100644 --- a/src/tests/SharedScenarios/BindCommand/EventEnabledExprParam/WinFormsLikeButton.cs +++ b/src/tests/SharedScenarios/BindCommand/EventEnabledExprParam/WinFormsLikeButton.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace SharedScenarios.BindCommand.EventEnabledExprParam; @@ -16,5 +17,6 @@ public class WinFormsLikeButton public bool Enabled { get; set; } /// Simulates a button click. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PerformClick() => Click?.Invoke(this, EventArgs.Empty); } diff --git a/src/tests/SharedScenarios/BindCommand/EventEnabledObsParam/Scenario.cs b/src/tests/SharedScenarios/BindCommand/EventEnabledObsParam/Scenario.cs index 0a1b004b..e44e7ae5 100644 --- a/src/tests/SharedScenarios/BindCommand/EventEnabledObsParam/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/EventEnabledObsParam/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.EventEnabledObsParam; @@ -18,6 +19,7 @@ public static class Scenario /// The target view. /// An observable producing command parameters. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view, IObservable parameter) => view.BindCommand(vm, x => x.Save, x => x.SaveButton, parameter); } diff --git a/src/tests/SharedScenarios/BindCommand/EventEnabledObsParam/WinFormsLikeButton.cs b/src/tests/SharedScenarios/BindCommand/EventEnabledObsParam/WinFormsLikeButton.cs index 9b9d68bc..cfa6dc63 100644 --- a/src/tests/SharedScenarios/BindCommand/EventEnabledObsParam/WinFormsLikeButton.cs +++ b/src/tests/SharedScenarios/BindCommand/EventEnabledObsParam/WinFormsLikeButton.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace SharedScenarios.BindCommand.EventEnabledObsParam; @@ -16,5 +17,6 @@ public class WinFormsLikeButton public bool Enabled { get; set; } /// Simulates a button click. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PerformClick() => Click?.Invoke(this, EventArgs.Empty); } diff --git a/src/tests/SharedScenarios/BindCommand/ExpressionParam/MyButton.cs b/src/tests/SharedScenarios/BindCommand/ExpressionParam/MyButton.cs index b0f80b67..bbc2991f 100644 --- a/src/tests/SharedScenarios/BindCommand/ExpressionParam/MyButton.cs +++ b/src/tests/SharedScenarios/BindCommand/ExpressionParam/MyButton.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace SharedScenarios.BindCommand.ExpressionParam; @@ -13,5 +14,6 @@ public class MyButton public event EventHandler? Click; /// Simulates a button click. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PerformClick() => Click?.Invoke(this, EventArgs.Empty); } diff --git a/src/tests/SharedScenarios/BindCommand/ExpressionParam/Scenario.cs b/src/tests/SharedScenarios/BindCommand/ExpressionParam/Scenario.cs index 3d1e10db..ae7f33b7 100644 --- a/src/tests/SharedScenarios/BindCommand/ExpressionParam/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/ExpressionParam/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.ExpressionParam; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindCommand(vm, x => x.Save, x => x.SaveButton, x => x.CurrentItem); } diff --git a/src/tests/SharedScenarios/BindCommand/NoEvent/Scenario.cs b/src/tests/SharedScenarios/BindCommand/NoEvent/Scenario.cs index 89122ca4..7a22e5f6 100644 --- a/src/tests/SharedScenarios/BindCommand/NoEvent/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/NoEvent/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.NoEvent; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindCommand(vm, x => x.Save, x => x.Label); } diff --git a/src/tests/SharedScenarios/BindCommand/ObservableParam/MyButton.cs b/src/tests/SharedScenarios/BindCommand/ObservableParam/MyButton.cs index 98cde800..4e0db305 100644 --- a/src/tests/SharedScenarios/BindCommand/ObservableParam/MyButton.cs +++ b/src/tests/SharedScenarios/BindCommand/ObservableParam/MyButton.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; namespace SharedScenarios.BindCommand.ObservableParam; @@ -13,5 +14,6 @@ public class MyButton public event EventHandler? Click; /// Simulates a button click. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PerformClick() => Click?.Invoke(this, EventArgs.Empty); } diff --git a/src/tests/SharedScenarios/BindCommand/ObservableParam/Scenario.cs b/src/tests/SharedScenarios/BindCommand/ObservableParam/Scenario.cs index bbda98bb..129ae239 100644 --- a/src/tests/SharedScenarios/BindCommand/ObservableParam/Scenario.cs +++ b/src/tests/SharedScenarios/BindCommand/ObservableParam/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindCommand.ObservableParam; @@ -15,6 +16,7 @@ public static class Scenario /// The target view. /// An observable producing command parameters. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view, IObservable parameter) => view.BindCommand(vm, x => x.Save, x => x.SaveButton, parameter); } diff --git a/src/tests/SharedScenarios/BindInteraction/DeepPropertyPath/Scenario.cs b/src/tests/SharedScenarios/BindInteraction/DeepPropertyPath/Scenario.cs index d23d1b3d..30f96f36 100644 --- a/src/tests/SharedScenarios/BindInteraction/DeepPropertyPath/Scenario.cs +++ b/src/tests/SharedScenarios/BindInteraction/DeepPropertyPath/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using System.Threading.Tasks; using ReactiveUI.Binding; @@ -15,6 +16,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindInteraction(vm, x => x.Child!.Confirm, ctx => { diff --git a/src/tests/SharedScenarios/BindInteraction/NonINPCViewModel/Scenario.cs b/src/tests/SharedScenarios/BindInteraction/NonINPCViewModel/Scenario.cs index 92c43141..94df7519 100644 --- a/src/tests/SharedScenarios/BindInteraction/NonINPCViewModel/Scenario.cs +++ b/src/tests/SharedScenarios/BindInteraction/NonINPCViewModel/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using System.Threading.Tasks; using ReactiveUI.Binding; @@ -15,6 +16,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindInteraction(vm, x => x.Confirm, ctx => { diff --git a/src/tests/SharedScenarios/BindInteraction/ObservableHandler/Scenario.cs b/src/tests/SharedScenarios/BindInteraction/ObservableHandler/Scenario.cs index 847f1443..d8bb2b5f 100644 --- a/src/tests/SharedScenarios/BindInteraction/ObservableHandler/Scenario.cs +++ b/src/tests/SharedScenarios/BindInteraction/ObservableHandler/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindInteraction.ObservableHandler; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindInteraction(vm, x => x.Confirm, ctx => { diff --git a/src/tests/SharedScenarios/BindInteraction/TaskHandler/Scenario.cs b/src/tests/SharedScenarios/BindInteraction/TaskHandler/Scenario.cs index 4d2abebf..daa5d03f 100644 --- a/src/tests/SharedScenarios/BindInteraction/TaskHandler/Scenario.cs +++ b/src/tests/SharedScenarios/BindInteraction/TaskHandler/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using System.Threading.Tasks; using ReactiveUI.Binding; @@ -15,6 +16,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => view.BindInteraction(vm, x => x.Confirm, ctx => { diff --git a/src/tests/SharedScenarios/BindOneWay/ReactiveObjectSource/Scenario.cs b/src/tests/SharedScenarios/BindOneWay/ReactiveObjectSource/Scenario.cs index c1eacf2f..19bf88f5 100644 --- a/src/tests/SharedScenarios/BindOneWay/ReactiveObjectSource/Scenario.cs +++ b/src/tests/SharedScenarios/BindOneWay/ReactiveObjectSource/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindOneWay.ReactiveObjectSource; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => vm.BindOneWay(view, x => x.Name, x => x.NameText); } diff --git a/src/tests/SharedScenarios/BindOneWay/SinglePropertyIntToInt/Scenario.cs b/src/tests/SharedScenarios/BindOneWay/SinglePropertyIntToInt/Scenario.cs index 1eb5d5da..c363ffbb 100644 --- a/src/tests/SharedScenarios/BindOneWay/SinglePropertyIntToInt/Scenario.cs +++ b/src/tests/SharedScenarios/BindOneWay/SinglePropertyIntToInt/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindOneWay.SinglePropertyIntToInt; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => vm.BindOneWay(view, x => x.Count, x => x.DisplayCount); } diff --git a/src/tests/SharedScenarios/BindOneWay/SinglePropertyStringToString/Scenario.cs b/src/tests/SharedScenarios/BindOneWay/SinglePropertyStringToString/Scenario.cs index 18784e35..cecdc4be 100644 --- a/src/tests/SharedScenarios/BindOneWay/SinglePropertyStringToString/Scenario.cs +++ b/src/tests/SharedScenarios/BindOneWay/SinglePropertyStringToString/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindOneWay.SinglePropertyStringToString; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => vm.BindOneWay(view, x => x.Name, x => x.NameText); } diff --git a/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithConverter/Scenario.cs b/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithConverter/Scenario.cs index 9a0d4ff3..af3c47b7 100644 --- a/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithConverter/Scenario.cs +++ b/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithConverter/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindOneWay.SinglePropertyWithConverter; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => vm.BindOneWay(view, x => x.Count, x => x.CountText, count => count.ToString()); } diff --git a/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithConverterAndScheduler/Scenario.cs b/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithConverterAndScheduler/Scenario.cs index dfd8082b..42c66cf2 100644 --- a/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithConverterAndScheduler/Scenario.cs +++ b/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithConverterAndScheduler/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; using ReactiveUI.Primitives.Concurrency; @@ -16,6 +17,7 @@ public static class Scenario /// The target view. /// The scheduler to observe on. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view, ISequencer scheduler) => vm.BindOneWay(view, x => x.Count, x => x.CountText, count => count.ToString(), scheduler); } diff --git a/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithScheduler/Scenario.cs b/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithScheduler/Scenario.cs index ffac9e0c..0d95fc3c 100644 --- a/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithScheduler/Scenario.cs +++ b/src/tests/SharedScenarios/BindOneWay/SinglePropertyWithScheduler/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; using ReactiveUI.Primitives.Concurrency; @@ -16,6 +17,7 @@ public static class Scenario /// The target view. /// The scheduler to observe on. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view, ISequencer scheduler) => vm.BindOneWay(view, x => x.Name, x => x.NameText, scheduler); } diff --git a/src/tests/SharedScenarios/BindTo/DifferingTypes/Scenario.cs b/src/tests/SharedScenarios/BindTo/DifferingTypes/Scenario.cs index 73cfb6b6..9c634de1 100644 --- a/src/tests/SharedScenarios/BindTo/DifferingTypes/Scenario.cs +++ b/src/tests/SharedScenarios/BindTo/DifferingTypes/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindTo.DifferingTypes; @@ -14,6 +15,7 @@ public static class Scenario /// The source observable stream. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(IObservable source, MyView view) => source.BindTo(view, x => x.Caption); } diff --git a/src/tests/SharedScenarios/BindTo/SameTypeString/Scenario.cs b/src/tests/SharedScenarios/BindTo/SameTypeString/Scenario.cs index b79d2c4b..754cfce1 100644 --- a/src/tests/SharedScenarios/BindTo/SameTypeString/Scenario.cs +++ b/src/tests/SharedScenarios/BindTo/SameTypeString/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindTo.SameTypeString; @@ -14,6 +15,7 @@ public static class Scenario /// The source observable stream. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(IObservable source, MyView view) => source.BindTo(view, x => x.Caption); } diff --git a/src/tests/SharedScenarios/BindTo/WithConversionHint/Scenario.cs b/src/tests/SharedScenarios/BindTo/WithConversionHint/Scenario.cs index 8f1eee76..ea4c3663 100644 --- a/src/tests/SharedScenarios/BindTo/WithConversionHint/Scenario.cs +++ b/src/tests/SharedScenarios/BindTo/WithConversionHint/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindTo.WithConversionHint; @@ -14,6 +15,7 @@ public static class Scenario /// The source observable stream. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(IObservable source, MyView view) => source.BindTo(view, x => x.Caption, (object)"D2"); } diff --git a/src/tests/SharedScenarios/BindTo/WithConverterOverride/Scenario.cs b/src/tests/SharedScenarios/BindTo/WithConverterOverride/Scenario.cs index 899e2f75..cbe49191 100644 --- a/src/tests/SharedScenarios/BindTo/WithConverterOverride/Scenario.cs +++ b/src/tests/SharedScenarios/BindTo/WithConverterOverride/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindTo.WithConverterOverride; @@ -15,6 +16,7 @@ public static class Scenario /// The target view. /// The explicit converter to use. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(IObservable source, MyView view, IBindingTypeConverter converter) => source.BindTo(view, x => x.Caption, converter); } diff --git a/src/tests/SharedScenarios/BindTwoWay/ReactiveObjectBoth/Scenario.cs b/src/tests/SharedScenarios/BindTwoWay/ReactiveObjectBoth/Scenario.cs index 0d485254..3d5d114c 100644 --- a/src/tests/SharedScenarios/BindTwoWay/ReactiveObjectBoth/Scenario.cs +++ b/src/tests/SharedScenarios/BindTwoWay/ReactiveObjectBoth/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindTwoWay.ReactiveObjectBoth; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => vm.BindTwoWay(view, x => x.Name, x => x.NameText); } diff --git a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyIntToInt/Scenario.cs b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyIntToInt/Scenario.cs index 9e4c4f75..5dd12e83 100644 --- a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyIntToInt/Scenario.cs +++ b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyIntToInt/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindTwoWay.SinglePropertyIntToInt; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => vm.BindTwoWay(view, x => x.Count, x => x.DisplayCount); } diff --git a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyStringToString/Scenario.cs b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyStringToString/Scenario.cs index 2ba8bcb8..41046811 100644 --- a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyStringToString/Scenario.cs +++ b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyStringToString/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindTwoWay.SinglePropertyStringToString; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => vm.BindTwoWay(view, x => x.Name, x => x.NameText); } diff --git a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithConverters/Scenario.cs b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithConverters/Scenario.cs index 77bcc5bd..4774ef9a 100644 --- a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithConverters/Scenario.cs +++ b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithConverters/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.BindTwoWay.SinglePropertyWithConverters; @@ -14,6 +15,7 @@ public static class Scenario /// The source view model. /// The target view. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view) => vm.BindTwoWay( view, diff --git a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithConvertersAndScheduler/Scenario.cs b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithConvertersAndScheduler/Scenario.cs index 8b7a78de..8fb32ba6 100644 --- a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithConvertersAndScheduler/Scenario.cs +++ b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithConvertersAndScheduler/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; using ReactiveUI.Primitives.Concurrency; @@ -16,6 +17,7 @@ public static class Scenario /// The target view. /// The scheduler to observe on. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view, ISequencer scheduler) => vm.BindTwoWay( view, diff --git a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithScheduler/Scenario.cs b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithScheduler/Scenario.cs index 329b279b..5b3b2024 100644 --- a/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithScheduler/Scenario.cs +++ b/src/tests/SharedScenarios/BindTwoWay/SinglePropertyWithScheduler/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; using ReactiveUI.Primitives.Concurrency; @@ -16,6 +17,7 @@ public static class Scenario /// The target view. /// The scheduler to observe on. /// A disposable representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IDisposable Execute(MyViewModel vm, MyView view, ISequencer scheduler) => vm.BindTwoWay(view, x => x.Name, x => x.NameText, scheduler); } diff --git a/src/tests/SharedScenarios/OneWayBind/MultipleBindings/Scenario.cs b/src/tests/SharedScenarios/OneWayBind/MultipleBindings/Scenario.cs index bf0af1e4..91c72c16 100644 --- a/src/tests/SharedScenarios/OneWayBind/MultipleBindings/Scenario.cs +++ b/src/tests/SharedScenarios/OneWayBind/MultipleBindings/Scenario.cs @@ -13,7 +13,7 @@ public static class Scenario /// The target view. /// The source view model. /// A tuple of bindings. - public static (IReactiveBinding name, IReactiveBinding age) Execute( + public static (IReactiveBinding Name, IReactiveBinding Age) Execute( MyView view, MyViewModel vm) => (view.OneWayBind(vm, x => x.Name, x => x.NameText), diff --git a/src/tests/SharedScenarios/OneWayBind/SinglePropertyIntToInt/Scenario.cs b/src/tests/SharedScenarios/OneWayBind/SinglePropertyIntToInt/Scenario.cs index 5682d776..4fd6338d 100644 --- a/src/tests/SharedScenarios/OneWayBind/SinglePropertyIntToInt/Scenario.cs +++ b/src/tests/SharedScenarios/OneWayBind/SinglePropertyIntToInt/Scenario.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.OneWayBind.SinglePropertyIntToInt; @@ -13,6 +14,7 @@ public static class Scenario /// The target view. /// The source view model. /// A reactive binding representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IReactiveBinding Execute(MyView view, MyViewModel vm) => view.OneWayBind(vm, x => x.Count, x => x.CountValue); } diff --git a/src/tests/SharedScenarios/OneWayBind/SinglePropertyStringToString/Scenario.cs b/src/tests/SharedScenarios/OneWayBind/SinglePropertyStringToString/Scenario.cs index 40616134..2c7bc9d2 100644 --- a/src/tests/SharedScenarios/OneWayBind/SinglePropertyStringToString/Scenario.cs +++ b/src/tests/SharedScenarios/OneWayBind/SinglePropertyStringToString/Scenario.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.OneWayBind.SinglePropertyStringToString; @@ -13,6 +14,7 @@ public static class Scenario /// The target view. /// The source view model. /// A reactive binding representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IReactiveBinding Execute(MyView view, MyViewModel vm) => view.OneWayBind(vm, x => x.Name, x => x.NameText); } diff --git a/src/tests/SharedScenarios/OneWayBind/SinglePropertyWithSelector/Scenario.cs b/src/tests/SharedScenarios/OneWayBind/SinglePropertyWithSelector/Scenario.cs index bbcd1ede..f93292b4 100644 --- a/src/tests/SharedScenarios/OneWayBind/SinglePropertyWithSelector/Scenario.cs +++ b/src/tests/SharedScenarios/OneWayBind/SinglePropertyWithSelector/Scenario.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.OneWayBind.SinglePropertyWithSelector; @@ -13,6 +14,7 @@ public static class Scenario /// The target view. /// The source view model. /// A reactive binding representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IReactiveBinding Execute(MyView view, MyViewModel vm) => view.OneWayBind(vm, x => x.Count, x => x.CountText, count => count.ToString()); } diff --git a/src/tests/SharedScenarios/OneWayBind/SinglePropertyWithSelectorAndScheduler/Scenario.cs b/src/tests/SharedScenarios/OneWayBind/SinglePropertyWithSelectorAndScheduler/Scenario.cs index 58dc464f..cba6bb27 100644 --- a/src/tests/SharedScenarios/OneWayBind/SinglePropertyWithSelectorAndScheduler/Scenario.cs +++ b/src/tests/SharedScenarios/OneWayBind/SinglePropertyWithSelectorAndScheduler/Scenario.cs @@ -2,6 +2,7 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; using ReactiveUI.Binding; using ReactiveUI.Primitives.Concurrency; @@ -15,6 +16,7 @@ public static class Scenario /// The source view model. /// The scheduler to observe on. /// A reactive binding representing the binding. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IReactiveBinding Execute(MyView view, MyViewModel vm, ISequencer scheduler) => view.OneWayBind(vm, x => x.Count, x => x.CountText, count => count.ToString(), scheduler); } diff --git a/src/tests/SharedScenarios/OneWayBind/TwoSameTypeBindings/Scenario.cs b/src/tests/SharedScenarios/OneWayBind/TwoSameTypeBindings/Scenario.cs index 1a061141..5c6abdfb 100644 --- a/src/tests/SharedScenarios/OneWayBind/TwoSameTypeBindings/Scenario.cs +++ b/src/tests/SharedScenarios/OneWayBind/TwoSameTypeBindings/Scenario.cs @@ -19,7 +19,7 @@ public static class Scenario /// The target view. /// The source view model. /// A tuple of bindings. - public static (IReactiveBinding first, IReactiveBinding last) Execute( + public static (IReactiveBinding First, IReactiveBinding Last) Execute( MyView view, MyViewModel vm) => (view.OneWayBind(vm, x => x.FirstName, x => x.FirstNameText), diff --git a/src/tests/SharedScenarios/WhenAny/DeepPropertyChain/Scenario.cs b/src/tests/SharedScenarios/WhenAny/DeepPropertyChain/Scenario.cs index deb23726..e825b441 100644 --- a/src/tests/SharedScenarios/WhenAny/DeepPropertyChain/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAny/DeepPropertyChain/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAny.DeepPropertyChain; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAny observable for Child.Name via IObservedChange. /// The parent view model to observe. /// An observable of name values from the child. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(ParentViewModel vm) => vm.WhenAny(x => x.Child.Name, c => c.Value); } diff --git a/src/tests/SharedScenarios/WhenAny/MultiPropertyDeepChain/Scenario.cs b/src/tests/SharedScenarios/WhenAny/MultiPropertyDeepChain/Scenario.cs index 5afdb24c..f7c78876 100644 --- a/src/tests/SharedScenarios/WhenAny/MultiPropertyDeepChain/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAny/MultiPropertyDeepChain/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAny.MultiPropertyDeepChain; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAny observable combining a deep chain (Child.Name) and a shallow property (Title). /// The parent view model to observe. /// An observable of combined name and title strings. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(ParentViewModel vm) => vm.WhenAny(x => x.Child.Name, x => x.Title, (c1, c2) => $"{c1.Value} - {c2.Value}"); } diff --git a/src/tests/SharedScenarios/WhenAny/MultiPropertyTwoProperties/Scenario.cs b/src/tests/SharedScenarios/WhenAny/MultiPropertyTwoProperties/Scenario.cs index 531cdb3f..b5701952 100644 --- a/src/tests/SharedScenarios/WhenAny/MultiPropertyTwoProperties/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAny/MultiPropertyTwoProperties/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAny.MultiPropertyTwoProperties; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAny observable combining FirstName and LastName via IObservedChange. /// The view model to observe. /// An observable of combined name strings. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenAny(x => x.FirstName, x => x.LastName, (c1, c2) => $"{c1.Value} {c2.Value}"); } diff --git a/src/tests/SharedScenarios/WhenAny/SinglePropertyINPC/Scenario.cs b/src/tests/SharedScenarios/WhenAny/SinglePropertyINPC/Scenario.cs index 47eeae5b..6e74295a 100644 --- a/src/tests/SharedScenarios/WhenAny/SinglePropertyINPC/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAny/SinglePropertyINPC/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAny.SinglePropertyINPC; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAny observable for the Name property, extracting the value from IObservedChange. /// The view model to observe. /// An observable of name values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenAny(x => x.Name, c => c.Value); } diff --git a/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableCombineLatest/Scenario.cs b/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableCombineLatest/Scenario.cs index 08b49518..f2362e3f 100644 --- a/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableCombineLatest/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableCombineLatest/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyObservable.DeepObservableCombineLatest; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyObservable that combines two deep observable properties using a selector. /// The parent view model to observe. /// An observable that combines values from both deep observable properties. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(ParentViewModel vm) => vm.WhenAnyObservable(x => x.Child.Count, x => x.Child.Message, (count, message) => $"{message}: {count}"); } diff --git a/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableMerge/Scenario.cs b/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableMerge/Scenario.cs index 5dbcf3cc..bdf9ad69 100644 --- a/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableMerge/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableMerge/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyObservable.DeepObservableMerge; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyObservable that merges two deep observable properties. /// The parent view model to observe. /// An observable that merges values from both deep observable properties. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(ParentViewModel vm) => vm.WhenAnyObservable(x => x.Child.Command1, x => x.Child.Command2); } diff --git a/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableSwitch/Scenario.cs b/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableSwitch/Scenario.cs index b4f5b0a5..d332fba1 100644 --- a/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableSwitch/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyObservable/DeepObservableSwitch/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyObservable.DeepObservableSwitch; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyObservable that switches to the latest value of Child.MyCommand. /// The parent view model to observe. /// An observable that switches to the latest Child.MyCommand observable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(ParentViewModel vm) => vm.WhenAnyObservable(x => x.Child.MyCommand); } diff --git a/src/tests/SharedScenarios/WhenAnyObservable/SingleObservable/Scenario.cs b/src/tests/SharedScenarios/WhenAnyObservable/SingleObservable/Scenario.cs index b6b12400..13a74c7a 100644 --- a/src/tests/SharedScenarios/WhenAnyObservable/SingleObservable/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyObservable/SingleObservable/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyObservable.SingleObservable; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyObservable that switches to the latest value of MyCommand. /// The view model to observe. /// An observable that switches to the latest MyCommand observable. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenAnyObservable(x => x.MyCommand); } diff --git a/src/tests/SharedScenarios/WhenAnyObservable/TwoObservablesMerge/Scenario.cs b/src/tests/SharedScenarios/WhenAnyObservable/TwoObservablesMerge/Scenario.cs index ab5bfc79..f9a24aac 100644 --- a/src/tests/SharedScenarios/WhenAnyObservable/TwoObservablesMerge/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyObservable/TwoObservablesMerge/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyObservable.TwoObservablesMerge; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyObservable that merges the two command observables. /// The view model to observe. /// An observable that merges values from both command observables. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenAnyObservable(x => x.Command1, x => x.Command2); } diff --git a/src/tests/SharedScenarios/WhenAnyObservable/TwoObservablesWithSelector/Scenario.cs b/src/tests/SharedScenarios/WhenAnyObservable/TwoObservablesWithSelector/Scenario.cs index f91e5446..e8417b16 100644 --- a/src/tests/SharedScenarios/WhenAnyObservable/TwoObservablesWithSelector/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyObservable/TwoObservablesWithSelector/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyObservable.TwoObservablesWithSelector; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyObservable that combines the two observable properties using a selector. /// The view model to observe. /// An observable that combines values from both observable properties. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenAnyObservable(x => x.Count, x => x.Message, (count, message) => $"{message}: {count}"); } diff --git a/src/tests/SharedScenarios/WhenAnyValue/DeepPropertyChain/Scenario.cs b/src/tests/SharedScenarios/WhenAnyValue/DeepPropertyChain/Scenario.cs index 33bd42b8..a892f27d 100644 --- a/src/tests/SharedScenarios/WhenAnyValue/DeepPropertyChain/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyValue/DeepPropertyChain/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyValue.DeepPropertyChain; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyValue observable for Child.Name. /// The parent view model to observe. /// An observable of name values from the child. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(ParentViewModel vm) => vm.WhenAnyValue(x => x.Child.Name); } diff --git a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyFiveProperties/Scenario.cs b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyFiveProperties/Scenario.cs index ae5cd7b6..ef34db1c 100644 --- a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyFiveProperties/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyFiveProperties/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyValue.MultiPropertyFiveProperties; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyValue observable for five properties. /// The view model to observe. /// An observable of five-property tuples. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable<(string Prop1, int Prop2, double Prop3, bool Prop4, string Prop5)> Execute(MyViewModel vm) => vm.WhenAnyValue(x => x.Prop1, x => x.Prop2, x => x.Prop3, x => x.Prop4, x => x.Prop5); } diff --git a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyThreeProperties/Scenario.cs b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyThreeProperties/Scenario.cs index 06b3617b..f3af1d98 100644 --- a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyThreeProperties/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyThreeProperties/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyValue.MultiPropertyThreeProperties; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyValue observable for Name, Age, and Score. /// The view model to observe. /// An observable of (name, age, score) tuples. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable<(string Name, int Age, double Score)> Execute(MyViewModel vm) => vm.WhenAnyValue(x => x.Name, x => x.Age, x => x.Score); } diff --git a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyTwelveProperties/Scenario.cs b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyTwelveProperties/Scenario.cs index 03ef5fc2..309dbebd 100644 --- a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyTwelveProperties/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyTwelveProperties/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyValue.MultiPropertyTwelveProperties; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyValue observable for twelve properties. /// The fixture to observe. /// An observable of twelve-property tuples. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable<(string V1, string V2, string V3, string V4, string V5, string V6, string V7, string V8, string V9, string V10, string V11, string V12)> Execute(WhenAnyFixture fixture) => diff --git a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyTwoProperties/Scenario.cs b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyTwoProperties/Scenario.cs index 24cd2c34..a8c09a57 100644 --- a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyTwoProperties/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyTwoProperties/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyValue.MultiPropertyTwoProperties; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyValue observable for Name and Age. /// The view model to observe. /// An observable of (name, age) tuples. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable<(string Name, int Age)> Execute(MyViewModel vm) => vm.WhenAnyValue(x => x.Name, x => x.Age); } diff --git a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyWithSelector/Scenario.cs b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyWithSelector/Scenario.cs index fdf3b325..4e11802d 100644 --- a/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyWithSelector/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyValue/MultiPropertyWithSelector/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyValue.MultiPropertyWithSelector; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyValue observable combining FirstName and LastName. /// The view model to observe. /// An observable of combined name strings. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenAnyValue(x => x.FirstName, x => x.LastName, (f, l) => $"{f} {l}"); } diff --git a/src/tests/SharedScenarios/WhenAnyValue/SinglePropertyINPC/Scenario.cs b/src/tests/SharedScenarios/WhenAnyValue/SinglePropertyINPC/Scenario.cs index c239b05d..4cb971f3 100644 --- a/src/tests/SharedScenarios/WhenAnyValue/SinglePropertyINPC/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyValue/SinglePropertyINPC/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenAnyValue.SinglePropertyINPC; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyValue observable for the Name property. /// The view model to observe. /// An observable of name values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenAnyValue(x => x.Name); } diff --git a/src/tests/SharedScenarios/WhenAnyValue/SinglePropertyReactiveObject/Scenario.cs b/src/tests/SharedScenarios/WhenAnyValue/SinglePropertyReactiveObject/Scenario.cs index a2e3b65c..888ff4b2 100644 --- a/src/tests/SharedScenarios/WhenAnyValue/SinglePropertyReactiveObject/Scenario.cs +++ b/src/tests/SharedScenarios/WhenAnyValue/SinglePropertyReactiveObject/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI; namespace SharedScenarios.WhenAnyValue.SinglePropertyReactiveObject; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenAnyValue observable for the Name property. /// The view model to observe. /// An observable of name values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenAnyValue(x => x.Name); } diff --git a/src/tests/SharedScenarios/WhenChanged/DeepPropertyChain/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/DeepPropertyChain/Scenario.cs index 84c00f46..35ad888e 100644 --- a/src/tests/SharedScenarios/WhenChanged/DeepPropertyChain/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/DeepPropertyChain/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.DeepPropertyChain; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable for Child.Name. /// The parent view model to observe. /// An observable of name values from the child. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(ParentViewModel vm) => vm.WhenChanged(x => x.Child.Name); } diff --git a/src/tests/SharedScenarios/WhenChanged/FourLevelDeepChain/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/FourLevelDeepChain/Scenario.cs index 327a7596..cb3eaf03 100644 --- a/src/tests/SharedScenarios/WhenChanged/FourLevelDeepChain/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/FourLevelDeepChain/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.FourLevelDeepChain; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable for Model.Model.Model.Value. /// The top-level object in the chain. /// An observable of value strings from the leaf. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(Level1 chain) => chain.WhenChanged(x => x.Model.Model.Model.Value); } diff --git a/src/tests/SharedScenarios/WhenChanged/IntProperty/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/IntProperty/Scenario.cs index 3e083e05..016d3817 100644 --- a/src/tests/SharedScenarios/WhenChanged/IntProperty/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/IntProperty/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.IntProperty; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable for the Count property. /// The view model to observe. /// An observable of count values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanged(x => x.Count); } diff --git a/src/tests/SharedScenarios/WhenChanged/MultiPropertyThreeProperties/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/MultiPropertyThreeProperties/Scenario.cs index f65092a5..51bd2f6a 100644 --- a/src/tests/SharedScenarios/WhenChanged/MultiPropertyThreeProperties/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/MultiPropertyThreeProperties/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.MultiPropertyThreeProperties; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable for Name, Age, and Score. /// The view model to observe. /// An observable of (name, age, score) tuples. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable<(string Name, int Age, double Score)> Execute(MyViewModel vm) => vm.WhenChanged(x => x.Name, x => x.Age, x => x.Score); } diff --git a/src/tests/SharedScenarios/WhenChanged/MultiPropertyTwoProperties/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/MultiPropertyTwoProperties/Scenario.cs index 907487c3..b6868a14 100644 --- a/src/tests/SharedScenarios/WhenChanged/MultiPropertyTwoProperties/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/MultiPropertyTwoProperties/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.MultiPropertyTwoProperties; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable for Name and Age. /// The view model to observe. /// An observable of (name, age) tuples. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable<(string Name, int Age)> Execute(MyViewModel vm) => vm.WhenChanged(x => x.Name, x => x.Age); } diff --git a/src/tests/SharedScenarios/WhenChanged/MultiPropertyWithDeepChains/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/MultiPropertyWithDeepChains/Scenario.cs index c6aee8ed..87d54a05 100644 --- a/src/tests/SharedScenarios/WhenChanged/MultiPropertyWithDeepChains/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/MultiPropertyWithDeepChains/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.MultiPropertyWithDeepChains; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable combining Address.City and Name with a selector. /// The view model to observe. /// An observable of combined city and name strings. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanged(x => x.Address.City, x => x.Name, (city, name) => $"{city}: {name}"); } diff --git a/src/tests/SharedScenarios/WhenChanged/MultiPropertyWithSelector/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/MultiPropertyWithSelector/Scenario.cs index 8df3cb46..d39fcbdb 100644 --- a/src/tests/SharedScenarios/WhenChanged/MultiPropertyWithSelector/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/MultiPropertyWithSelector/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.MultiPropertyWithSelector; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable combining FirstName and LastName. /// The view model to observe. /// An observable of combined name strings. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanged(x => x.FirstName, x => x.LastName, (f, l) => $"{f} {l}"); } diff --git a/src/tests/SharedScenarios/WhenChanged/NullForgivingDeepChain/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/NullForgivingDeepChain/Scenario.cs index e7a50aaf..d610a15d 100644 --- a/src/tests/SharedScenarios/WhenChanged/NullForgivingDeepChain/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/NullForgivingDeepChain/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.NullForgivingDeepChain; @@ -16,6 +17,7 @@ public static class Scenario /// Creates a WhenChanged observable for Child!.Name using the null-forgiving operator. /// The parent view model to observe. /// An observable of name values from the child. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(ParentViewModel vm) => vm.WhenChanged(x => x.Child!.Name); } diff --git a/src/tests/SharedScenarios/WhenChanged/NullableProperty/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/NullableProperty/Scenario.cs index df2d8ca1..9406e6f0 100644 --- a/src/tests/SharedScenarios/WhenChanged/NullableProperty/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/NullableProperty/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.NullableProperty; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable for the NullableName property. /// The view model to observe. /// An observable of nullable name values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanged(x => x.NullableName!); } diff --git a/src/tests/SharedScenarios/WhenChanged/SinglePropertyINPC/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/SinglePropertyINPC/Scenario.cs index 1ce30694..7ffe89d7 100644 --- a/src/tests/SharedScenarios/WhenChanged/SinglePropertyINPC/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/SinglePropertyINPC/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.SinglePropertyINPC; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable for the Name property. /// The view model to observe. /// An observable of name values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanged(x => x.Name); } diff --git a/src/tests/SharedScenarios/WhenChanged/SinglePropertyReactiveObject/Scenario.cs b/src/tests/SharedScenarios/WhenChanged/SinglePropertyReactiveObject/Scenario.cs index f2892984..e12d0aa1 100644 --- a/src/tests/SharedScenarios/WhenChanged/SinglePropertyReactiveObject/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanged/SinglePropertyReactiveObject/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanged.SinglePropertyReactiveObject; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanged observable for the Name property. /// The view model to observe. /// An observable of name values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanged(x => x.Name); } diff --git a/src/tests/SharedScenarios/WhenChanging/DeepPropertyChain/Scenario.cs b/src/tests/SharedScenarios/WhenChanging/DeepPropertyChain/Scenario.cs index 74e0a913..c952eae7 100644 --- a/src/tests/SharedScenarios/WhenChanging/DeepPropertyChain/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanging/DeepPropertyChain/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanging.DeepPropertyChain; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanging observable for Child.Name. /// The parent view model to observe. /// An observable of name values (before change). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(ParentViewModel vm) => vm.WhenChanging(x => x.Child.Name); } diff --git a/src/tests/SharedScenarios/WhenChanging/FourLevelDeepChain/Scenario.cs b/src/tests/SharedScenarios/WhenChanging/FourLevelDeepChain/Scenario.cs index ad64c066..33dbf543 100644 --- a/src/tests/SharedScenarios/WhenChanging/FourLevelDeepChain/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanging/FourLevelDeepChain/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanging.FourLevelDeepChain; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanging observable for Model.Model.Model.Value. /// The top-level object in the chain. /// An observable of value strings from the leaf (before change). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(Level1 chain) => chain.WhenChanging(x => x.Model.Model.Model.Value); } diff --git a/src/tests/SharedScenarios/WhenChanging/MultiPropertyThreeProperties/Scenario.cs b/src/tests/SharedScenarios/WhenChanging/MultiPropertyThreeProperties/Scenario.cs index 0006287c..b4b61330 100644 --- a/src/tests/SharedScenarios/WhenChanging/MultiPropertyThreeProperties/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanging/MultiPropertyThreeProperties/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanging.MultiPropertyThreeProperties; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanging observable for Name, Age, and Score. /// The view model to observe. /// An observable of (name, age, score) tuples (before change). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable<(string Name, int Age, double Score)> Execute(MyViewModel vm) => vm.WhenChanging(x => x.Name, x => x.Age, x => x.Score); } diff --git a/src/tests/SharedScenarios/WhenChanging/MultiPropertyTwoProperties/Scenario.cs b/src/tests/SharedScenarios/WhenChanging/MultiPropertyTwoProperties/Scenario.cs index 5ca07a80..a94b46f0 100644 --- a/src/tests/SharedScenarios/WhenChanging/MultiPropertyTwoProperties/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanging/MultiPropertyTwoProperties/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanging.MultiPropertyTwoProperties; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanging observable for Name and Age. /// The view model to observe. /// An observable of (name, age) tuples (before change). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable<(string Name, int Age)> Execute(MyViewModel vm) => vm.WhenChanging(x => x.Name, x => x.Age); } diff --git a/src/tests/SharedScenarios/WhenChanging/MultiPropertyWithDeepChains/Scenario.cs b/src/tests/SharedScenarios/WhenChanging/MultiPropertyWithDeepChains/Scenario.cs index f0975619..d7255f9e 100644 --- a/src/tests/SharedScenarios/WhenChanging/MultiPropertyWithDeepChains/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanging/MultiPropertyWithDeepChains/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanging.MultiPropertyWithDeepChains; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanging observable combining Address.City and Name with a selector. /// The view model to observe. /// An observable of combined city and name strings (before change). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanging(x => x.Address.City, x => x.Name, (city, name) => $"{city}: {name}"); } diff --git a/src/tests/SharedScenarios/WhenChanging/MultiPropertyWithSelector/Scenario.cs b/src/tests/SharedScenarios/WhenChanging/MultiPropertyWithSelector/Scenario.cs index f885321f..b2077fcb 100644 --- a/src/tests/SharedScenarios/WhenChanging/MultiPropertyWithSelector/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanging/MultiPropertyWithSelector/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanging.MultiPropertyWithSelector; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanging observable combining FirstName and LastName. /// The view model to observe. /// An observable of combined name strings (before change). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanging(x => x.FirstName, x => x.LastName, (f, l) => $"{f} {l}"); } diff --git a/src/tests/SharedScenarios/WhenChanging/SinglePropertyINPC/Scenario.cs b/src/tests/SharedScenarios/WhenChanging/SinglePropertyINPC/Scenario.cs index d464f550..9d9b4e90 100644 --- a/src/tests/SharedScenarios/WhenChanging/SinglePropertyINPC/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanging/SinglePropertyINPC/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanging.SinglePropertyINPC; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanging observable for the Name property. /// The view model to observe. /// An observable of name values (before change). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanging(x => x.Name); } diff --git a/src/tests/SharedScenarios/WhenChanging/SinglePropertyReactiveObject/Scenario.cs b/src/tests/SharedScenarios/WhenChanging/SinglePropertyReactiveObject/Scenario.cs index 9f03adf7..5b726539 100644 --- a/src/tests/SharedScenarios/WhenChanging/SinglePropertyReactiveObject/Scenario.cs +++ b/src/tests/SharedScenarios/WhenChanging/SinglePropertyReactiveObject/Scenario.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Runtime.CompilerServices; using ReactiveUI.Binding; namespace SharedScenarios.WhenChanging.SinglePropertyReactiveObject; @@ -13,6 +14,7 @@ public static class Scenario /// Creates a WhenChanging observable for the Name property. /// The view model to observe. /// An observable of name values (before change). + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IObservable Execute(MyViewModel vm) => vm.WhenChanging(x => x.Name); }